Update Jenkinsfile
This commit is contained in:
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
@@ -57,7 +57,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Clean Old Container') {
|
stage('Clean Old Container') {
|
||||||
steps {
|
steps {
|
||||||
catchError(buildResult: 'SUCCESS',message: 'Container doesn\'t exist on host, skipping...', stageResult: 'ABORTED') {
|
catchError(buildResult: 'SUCCESS', message: 'Container doesn\'t exist on host, skipping...', stageResult: 'ABORTED') {
|
||||||
sh 'docker stop otomai'
|
sh 'docker stop otomai'
|
||||||
sh 'docker rm otomai'
|
sh 'docker rm otomai'
|
||||||
}
|
}
|
||||||
@@ -73,11 +73,21 @@ pipeline {
|
|||||||
// Login to registry
|
// Login to registry
|
||||||
docker.withRegistry('https://git.ruff.co.il', registryCredentialsId) {
|
docker.withRegistry('https://git.ruff.co.il', registryCredentialsId) {
|
||||||
|
|
||||||
// Run container on build
|
// Run container
|
||||||
docker.image(imageName).run('-p 10002:80 --name otomai')
|
docker.image(imageName).run('-p 10002:80 --name otomai')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
// Trigger the deploy-prod-job on success of the build
|
||||||
|
build job: 'deploy-prod-job', wait: false
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
// Optionally, you can handle failure scenarios (e.g., notify team, etc.)
|
||||||
|
echo "Build failed, deployment not triggered."
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user