diff --git a/Jenkinsfile b/Jenkinsfile index 4d0ede4..59abc24 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,17 +1,20 @@ pipeline { - agent { - docker { - image 'python:3.10-slim-bullseye' - } - } + agent none environment { HOME = "${env.WORKSPACE}" + DOCKER_IMAGE_NAME = 'registry.digitalocean.com/ailuridae-registry/ailuridae.io/everybodymov' + DOCKER_IMAGE = '' } stages { stage('Setup') { + agent { + docker { + image 'python:3.10-slim-bullseye' + } + } steps { sh 'python -m pip install --no-cache-dir --upgrade --user pip' sh 'python -m pip install --no-cache-dir pipenv --user' @@ -19,9 +22,34 @@ pipeline { } } stage('Check') { - // Security check. + agent { + docker { + image 'python:3.10-slim-bullseye' + } + } steps { - sh 'python -m pipenv run bandit tweetbot.py' + sh 'python -m pipenv verify' + sh 'python -m pipenv check --clear' + sh 'python -m pipenv run bandit -r .' + } + } + stage('Build') { + agent 'main' + steps { + script { + DOCKER_IMAGE = docker.build("${DOCKER_IMAGE_NAME}") + } + } + } + stage('Publish') { + agent 'main' + steps { + script { + docker.withRegistry("", "digital-ocean-ailuridae-registry") { + DOCKER_IMAGE.push("${BUILD_NUMBER}") + DOCKER_IMAGE.push('latest') + } + } } } } diff --git a/Pipfile.lock b/Pipfile.lock index cae1a37..be369d1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3dc4c0a387fc9c5280d0dbfadae8f3d7cac3ddf589af5ec78dfe7090ff2684f2" + "sha256": "e7a1785570cb6182573b0e15cae2ad2c86adb2c280e88ceaa9126c232b720c9c" }, "pipfile-spec": 6, "requires": {