Browse Source

Upload files to ''

master
Jacques Ingram 3 months ago
parent
commit
7055093f4a
  1. 72
      Jenkinsfile

72
Jenkinsfile vendored

@ -1,59 +1,55 @@
pipeline {
agent any
agent none
options {
disableConcurrentBuilds(abortPrevious: true)
buildDiscarder(logRotator(numToKeepStr: '1'))
}
stages {
stage('Build Docker Image') {
steps {
script {
def imageName = "python-jenkins-project:${BUILD_NUMBER}"
sh "DOCKER_BUILDKIT=0 docker build --no-cache -t ${imageName} ."
env.IMAGE_NAME = imageName
}
stage('docker compose build') {
agent {
label "xochi"
}
}
stage('Deploy Docker Container') {
steps {
script {
dir('.') {
sh "docker stop python-jenkins-container || true"
sh 'docker compose build'
}
sh "docker rm python-jenkins-container || true"
}
sh "docker run -d -p 5555:80 --name python-jenkins-container ${env.IMAGE_NAME}"
}
}
stage('docker compose push') {
agent {
label "xochi"
}
}
stage('Verify Deployment') {
steps {
script {
dir('.') {
sh "curl http://38.110.1.139:5555"
}
sh 'docker compose push'
}
}
}
}
}
}
}}

Loading…
Cancel
Save