diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a16f369..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -from python:slim - -ARG MUSIC_FOLDER_ARG=/nas/music -ARG MUSIC_URL_ARG=https://www.kuwo.cn/bang/content?name=%E6%8A%96%E9%9F%B3%E7%83%AD%E6%AD%8C%E6%A6%9C - -ENV MUSIC_URL=${MUSIC_URL_ARG} -ENV MUSIC_FOLDER=${MUSIC_FOLDER_ARG} - -COPY requirements.txt / -RUN pip install -r requirements.txt -COPY src/* / -COPY start.sh / -RUN chmod +x /start.sh -ENTRYPOINT ["/start.sh"] - diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a16f369..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -from python:slim - -ARG MUSIC_FOLDER_ARG=/nas/music -ARG MUSIC_URL_ARG=https://www.kuwo.cn/bang/content?name=%E6%8A%96%E9%9F%B3%E7%83%AD%E6%AD%8C%E6%A6%9C - -ENV MUSIC_URL=${MUSIC_URL_ARG} -ENV MUSIC_FOLDER=${MUSIC_FOLDER_ARG} - -COPY requirements.txt / -RUN pip install -r requirements.txt -COPY src/* / -COPY start.sh / -RUN chmod +x /start.sh -ENTRYPOINT ["/start.sh"] - diff --git a/deployment/Jenkinsfile b/deployment/Jenkinsfile new file mode 100644 index 0000000..356309a --- /dev/null +++ b/deployment/Jenkinsfile @@ -0,0 +1,49 @@ +def dockerImage + +pipeline { + agent any + options { + buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) + } + tools { + 'org.jenkinsci.plugins.docker.commons.tools.DockerTool' 'Default' + } + stages { + stage('Cloning Git') { + steps { + git ([url: 'https://gitbucket.jerxie.com/git/yangyangxie/MusicDownloader.git', branch: 'master', credentialsId: '4f856c5e-4e28-46c5-aaa0-c9be1424f3ae']) + } + + } + stage('Build Docker Image') { + steps { + sh "cp -r src deployment/docker" + sh "cp requirements.txt deployment/docker" + // Change the directory to the staging folder + dir("deployment/docker"){ + script{ + dockerImage = docker.build("docker.jerxie.com/music-downloader:pipeline") + } + } + sh "rm -rf deployment/docker" + } + } + + stage('Push Docker Image') { + steps { + script { + sh "docker login -u registry -p registry https://docker.jerxie.com" + dockerImage.push() + } + } + } + + stage('Cleanup local Docker Image') { + steps { + script { + sh "docker rmi -f docker.jerxie.com/music-downloader:pipeline" + } + } + } + } +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a16f369..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -from python:slim - -ARG MUSIC_FOLDER_ARG=/nas/music -ARG MUSIC_URL_ARG=https://www.kuwo.cn/bang/content?name=%E6%8A%96%E9%9F%B3%E7%83%AD%E6%AD%8C%E6%A6%9C - -ENV MUSIC_URL=${MUSIC_URL_ARG} -ENV MUSIC_FOLDER=${MUSIC_FOLDER_ARG} - -COPY requirements.txt / -RUN pip install -r requirements.txt -COPY src/* / -COPY start.sh / -RUN chmod +x /start.sh -ENTRYPOINT ["/start.sh"] - diff --git a/deployment/Jenkinsfile b/deployment/Jenkinsfile new file mode 100644 index 0000000..356309a --- /dev/null +++ b/deployment/Jenkinsfile @@ -0,0 +1,49 @@ +def dockerImage + +pipeline { + agent any + options { + buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) + } + tools { + 'org.jenkinsci.plugins.docker.commons.tools.DockerTool' 'Default' + } + stages { + stage('Cloning Git') { + steps { + git ([url: 'https://gitbucket.jerxie.com/git/yangyangxie/MusicDownloader.git', branch: 'master', credentialsId: '4f856c5e-4e28-46c5-aaa0-c9be1424f3ae']) + } + + } + stage('Build Docker Image') { + steps { + sh "cp -r src deployment/docker" + sh "cp requirements.txt deployment/docker" + // Change the directory to the staging folder + dir("deployment/docker"){ + script{ + dockerImage = docker.build("docker.jerxie.com/music-downloader:pipeline") + } + } + sh "rm -rf deployment/docker" + } + } + + stage('Push Docker Image') { + steps { + script { + sh "docker login -u registry -p registry https://docker.jerxie.com" + dockerImage.push() + } + } + } + + stage('Cleanup local Docker Image') { + steps { + script { + sh "docker rmi -f docker.jerxie.com/music-downloader:pipeline" + } + } + } + } +} \ No newline at end of file diff --git a/deployment/docker/Dockerfile b/deployment/docker/Dockerfile new file mode 100644 index 0000000..a16f369 --- /dev/null +++ b/deployment/docker/Dockerfile @@ -0,0 +1,15 @@ +from python:slim + +ARG MUSIC_FOLDER_ARG=/nas/music +ARG MUSIC_URL_ARG=https://www.kuwo.cn/bang/content?name=%E6%8A%96%E9%9F%B3%E7%83%AD%E6%AD%8C%E6%A6%9C + +ENV MUSIC_URL=${MUSIC_URL_ARG} +ENV MUSIC_FOLDER=${MUSIC_FOLDER_ARG} + +COPY requirements.txt / +RUN pip install -r requirements.txt +COPY src/* / +COPY start.sh / +RUN chmod +x /start.sh +ENTRYPOINT ["/start.sh"] + diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a16f369..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -from python:slim - -ARG MUSIC_FOLDER_ARG=/nas/music -ARG MUSIC_URL_ARG=https://www.kuwo.cn/bang/content?name=%E6%8A%96%E9%9F%B3%E7%83%AD%E6%AD%8C%E6%A6%9C - -ENV MUSIC_URL=${MUSIC_URL_ARG} -ENV MUSIC_FOLDER=${MUSIC_FOLDER_ARG} - -COPY requirements.txt / -RUN pip install -r requirements.txt -COPY src/* / -COPY start.sh / -RUN chmod +x /start.sh -ENTRYPOINT ["/start.sh"] - diff --git a/deployment/Jenkinsfile b/deployment/Jenkinsfile new file mode 100644 index 0000000..356309a --- /dev/null +++ b/deployment/Jenkinsfile @@ -0,0 +1,49 @@ +def dockerImage + +pipeline { + agent any + options { + buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) + } + tools { + 'org.jenkinsci.plugins.docker.commons.tools.DockerTool' 'Default' + } + stages { + stage('Cloning Git') { + steps { + git ([url: 'https://gitbucket.jerxie.com/git/yangyangxie/MusicDownloader.git', branch: 'master', credentialsId: '4f856c5e-4e28-46c5-aaa0-c9be1424f3ae']) + } + + } + stage('Build Docker Image') { + steps { + sh "cp -r src deployment/docker" + sh "cp requirements.txt deployment/docker" + // Change the directory to the staging folder + dir("deployment/docker"){ + script{ + dockerImage = docker.build("docker.jerxie.com/music-downloader:pipeline") + } + } + sh "rm -rf deployment/docker" + } + } + + stage('Push Docker Image') { + steps { + script { + sh "docker login -u registry -p registry https://docker.jerxie.com" + dockerImage.push() + } + } + } + + stage('Cleanup local Docker Image') { + steps { + script { + sh "docker rmi -f docker.jerxie.com/music-downloader:pipeline" + } + } + } + } +} \ No newline at end of file diff --git a/deployment/docker/Dockerfile b/deployment/docker/Dockerfile new file mode 100644 index 0000000..a16f369 --- /dev/null +++ b/deployment/docker/Dockerfile @@ -0,0 +1,15 @@ +from python:slim + +ARG MUSIC_FOLDER_ARG=/nas/music +ARG MUSIC_URL_ARG=https://www.kuwo.cn/bang/content?name=%E6%8A%96%E9%9F%B3%E7%83%AD%E6%AD%8C%E6%A6%9C + +ENV MUSIC_URL=${MUSIC_URL_ARG} +ENV MUSIC_FOLDER=${MUSIC_FOLDER_ARG} + +COPY requirements.txt / +RUN pip install -r requirements.txt +COPY src/* / +COPY start.sh / +RUN chmod +x /start.sh +ENTRYPOINT ["/start.sh"] + diff --git a/deployment/docker/start.sh b/deployment/docker/start.sh new file mode 100644 index 0000000..a7a92cb --- /dev/null +++ b/deployment/docker/start.sh @@ -0,0 +1,10 @@ +#!/bin/sh +while true +do + echo "" + echo "" + echo "Fetching Musics happens at: $(date +"%Y/%m/%d %I:%M:%S")" + echo "#########################################" + python3 /main.py + sleep 1d +done \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a16f369..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -from python:slim - -ARG MUSIC_FOLDER_ARG=/nas/music -ARG MUSIC_URL_ARG=https://www.kuwo.cn/bang/content?name=%E6%8A%96%E9%9F%B3%E7%83%AD%E6%AD%8C%E6%A6%9C - -ENV MUSIC_URL=${MUSIC_URL_ARG} -ENV MUSIC_FOLDER=${MUSIC_FOLDER_ARG} - -COPY requirements.txt / -RUN pip install -r requirements.txt -COPY src/* / -COPY start.sh / -RUN chmod +x /start.sh -ENTRYPOINT ["/start.sh"] - diff --git a/deployment/Jenkinsfile b/deployment/Jenkinsfile new file mode 100644 index 0000000..356309a --- /dev/null +++ b/deployment/Jenkinsfile @@ -0,0 +1,49 @@ +def dockerImage + +pipeline { + agent any + options { + buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) + } + tools { + 'org.jenkinsci.plugins.docker.commons.tools.DockerTool' 'Default' + } + stages { + stage('Cloning Git') { + steps { + git ([url: 'https://gitbucket.jerxie.com/git/yangyangxie/MusicDownloader.git', branch: 'master', credentialsId: '4f856c5e-4e28-46c5-aaa0-c9be1424f3ae']) + } + + } + stage('Build Docker Image') { + steps { + sh "cp -r src deployment/docker" + sh "cp requirements.txt deployment/docker" + // Change the directory to the staging folder + dir("deployment/docker"){ + script{ + dockerImage = docker.build("docker.jerxie.com/music-downloader:pipeline") + } + } + sh "rm -rf deployment/docker" + } + } + + stage('Push Docker Image') { + steps { + script { + sh "docker login -u registry -p registry https://docker.jerxie.com" + dockerImage.push() + } + } + } + + stage('Cleanup local Docker Image') { + steps { + script { + sh "docker rmi -f docker.jerxie.com/music-downloader:pipeline" + } + } + } + } +} \ No newline at end of file diff --git a/deployment/docker/Dockerfile b/deployment/docker/Dockerfile new file mode 100644 index 0000000..a16f369 --- /dev/null +++ b/deployment/docker/Dockerfile @@ -0,0 +1,15 @@ +from python:slim + +ARG MUSIC_FOLDER_ARG=/nas/music +ARG MUSIC_URL_ARG=https://www.kuwo.cn/bang/content?name=%E6%8A%96%E9%9F%B3%E7%83%AD%E6%AD%8C%E6%A6%9C + +ENV MUSIC_URL=${MUSIC_URL_ARG} +ENV MUSIC_FOLDER=${MUSIC_FOLDER_ARG} + +COPY requirements.txt / +RUN pip install -r requirements.txt +COPY src/* / +COPY start.sh / +RUN chmod +x /start.sh +ENTRYPOINT ["/start.sh"] + diff --git a/deployment/docker/start.sh b/deployment/docker/start.sh new file mode 100644 index 0000000..a7a92cb --- /dev/null +++ b/deployment/docker/start.sh @@ -0,0 +1,10 @@ +#!/bin/sh +while true +do + echo "" + echo "" + echo "Fetching Musics happens at: $(date +"%Y/%m/%d %I:%M:%S")" + echo "#########################################" + python3 /main.py + sleep 1d +done \ No newline at end of file diff --git a/start.sh b/start.sh deleted file mode 100644 index a7a92cb..0000000 --- a/start.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -while true -do - echo "" - echo "" - echo "Fetching Musics happens at: $(date +"%Y/%m/%d %I:%M:%S")" - echo "#########################################" - python3 /main.py - sleep 1d -done \ No newline at end of file