2022-09-01 03:23:10 +00:00
|
|
|
pipeline {
|
|
|
|
|
2022-09-02 03:46:34 +00:00
|
|
|
agent none
|
2022-09-01 03:23:10 +00:00
|
|
|
|
2022-09-01 04:41:17 +00:00
|
|
|
environment {
|
|
|
|
HOME = "${env.WORKSPACE}"
|
2022-09-02 03:46:34 +00:00
|
|
|
DOCKER_IMAGE_NAME = 'registry.digitalocean.com/ailuridae-registry/ailuridae.io/everybodymov'
|
|
|
|
DOCKER_IMAGE = ''
|
2022-09-01 04:41:17 +00:00
|
|
|
}
|
|
|
|
|
2022-09-01 03:23:10 +00:00
|
|
|
stages {
|
|
|
|
stage('Setup') {
|
2022-09-02 03:46:34 +00:00
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'python:3.10-slim-bullseye'
|
|
|
|
}
|
|
|
|
}
|
2022-09-01 03:23:10 +00:00
|
|
|
steps {
|
2022-09-01 04:41:17 +00:00
|
|
|
sh 'python -m pip install --no-cache-dir --upgrade --user pip'
|
|
|
|
sh 'python -m pip install --no-cache-dir pipenv --user'
|
2022-09-01 04:44:15 +00:00
|
|
|
sh 'python -m pipenv install --dev'
|
2022-09-01 03:23:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Check') {
|
2022-09-02 03:46:34 +00:00
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'python:3.10-slim-bullseye'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh 'python -m pipenv verify'
|
|
|
|
sh 'python -m pipenv check --clear'
|
2022-09-02 04:15:33 +00:00
|
|
|
sh 'python -m pipenv run bandit *.py'
|
2022-09-02 03:46:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Build') {
|
2022-09-02 03:48:10 +00:00
|
|
|
agent {
|
|
|
|
label 'main'
|
|
|
|
}
|
2022-09-02 03:46:34 +00:00
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
DOCKER_IMAGE = docker.build("${DOCKER_IMAGE_NAME}")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Publish') {
|
2022-09-02 03:48:10 +00:00
|
|
|
agent {
|
|
|
|
label 'main'
|
|
|
|
}
|
2022-09-01 03:23:10 +00:00
|
|
|
steps {
|
2022-09-02 03:46:34 +00:00
|
|
|
script {
|
|
|
|
docker.withRegistry("", "digital-ocean-ailuridae-registry") {
|
|
|
|
DOCKER_IMAGE.push("${BUILD_NUMBER}")
|
|
|
|
DOCKER_IMAGE.push('latest')
|
|
|
|
}
|
|
|
|
}
|
2022-09-01 03:23:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
always {
|
2022-09-02 03:51:14 +00:00
|
|
|
node('main') {
|
|
|
|
cleanWs()
|
|
|
|
}
|
2022-09-01 03:23:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|