Upload files to ''

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

104
Jenkinsfile vendored
View File

@@ -1,59 +1,55 @@
pipeline {
agent any
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('Deploy Docker Container') {
steps {
script {
sh "docker stop python-jenkins-container || true"
sh "docker rm python-jenkins-container || true"
sh "docker run -d -p 5555:80 --name python-jenkins-container ${env.IMAGE_NAME}"
}
}
}
stage('Verify Deployment') {
steps {
script {
sh "curl http://38.110.1.139:5555"
}
}
}
agent none
options {
disableConcurrentBuilds(abortPrevious: true)
buildDiscarder(logRotator(numToKeepStr: '1'))
}
stages {
stage('docker compose build') {
agent {
label "xochi"
}
}
steps {
dir('.') {
sh 'docker compose build'
}
}
}
stage('docker compose push') {
agent {
label "xochi"
}
steps {
dir('.') {
sh 'docker compose push'
}
}
}
}}