Upload files to ''

This commit is contained in:
2025-03-05 03:37:25 +00:00
parent 5f7ca5c4a2
commit 7055093f4a

60
Jenkinsfile vendored
View File

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