diff --git a/Jenkinsfile b/Jenkinsfile index 7f28ee8..b08e77a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,7 +49,7 @@ pipeline { steps { sh ''' source /var/lib/jenkins/miniconda3/etc/profile.d/conda.sh conda activate ${BUILD_TAG} - docker build . + python deploy/build.py ''' } post { @@ -58,6 +58,7 @@ pipeline { archiveArtifacts (allowEmptyArchive: true, artifacts: 'dist/*whl', fingerprint: true) + sh 'python deploy/push.py' } } } diff --git a/PlexBot/__version__.py b/PlexBot/__version__.py new file mode 100644 index 0000000..fe96268 --- /dev/null +++ b/PlexBot/__version__.py @@ -0,0 +1 @@ +VERSION = "0.0.4" diff --git a/deploy/build.py b/deploy/build.py new file mode 100644 index 0000000..78c9326 --- /dev/null +++ b/deploy/build.py @@ -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} .")) diff --git a/deploy/push.py b/deploy/push.py new file mode 100755 index 0000000..98fc956 --- /dev/null +++ b/deploy/push.py @@ -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}"))