🚀 Automatic deployment through jenkins

This commit is contained in:
Joshua Arulsamy 2020-08-09 00:44:32 -06:00
parent 63fea747c6
commit 76d2d97c62
4 changed files with 19 additions and 1 deletions

3
Jenkinsfile vendored
View File

@ -49,7 +49,7 @@ pipeline {
steps { steps {
sh ''' source /var/lib/jenkins/miniconda3/etc/profile.d/conda.sh sh ''' source /var/lib/jenkins/miniconda3/etc/profile.d/conda.sh
conda activate ${BUILD_TAG} conda activate ${BUILD_TAG}
docker build . python deploy/build.py
''' '''
} }
post { post {
@ -58,6 +58,7 @@ pipeline {
archiveArtifacts (allowEmptyArchive: true, archiveArtifacts (allowEmptyArchive: true,
artifacts: 'dist/*whl', artifacts: 'dist/*whl',
fingerprint: true) fingerprint: true)
sh 'python deploy/push.py'
} }
} }
} }

1
PlexBot/__version__.py Normal file
View File

@ -0,0 +1 @@
VERSION = "0.0.4"

8
deploy/build.py Normal file
View File

@ -0,0 +1,8 @@
import os
import sys
sys.path.append("PlexBot")
from __version__ import VERSION
sys.exit(os.system(f"docker build -t jarulsamy/plex-bot:{VERSION} ."))

8
deploy/push.py Executable file
View File

@ -0,0 +1,8 @@
import os
import sys
sys.path.append("PlexBot")
from __version__ import VERSION
sys.exit(os.system(f"docker push jarulsamy/plex-bot:{VERSION}"))