Update Jenkinsfile
This commit is contained in:
27
Jenkinsfile
vendored
27
Jenkinsfile
vendored
@@ -55,38 +55,13 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Clean Old Container') {
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', message: 'Container doesn\'t exist on host, skipping...', stageResult: 'ABORTED') {
|
||||
sh 'docker stop otomai'
|
||||
sh 'docker rm otomai'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Run new container') {
|
||||
steps {
|
||||
script {
|
||||
// Define registry credentials and image name
|
||||
def registryCredentialsId = '7e506860-ca64-47bd-92a8-1a591dd12cba'
|
||||
def imageName = 'git.ruff.co.il/amai.ig/otomai:latest'
|
||||
|
||||
// Login to registry
|
||||
docker.withRegistry('https://git.ruff.co.il', registryCredentialsId) {
|
||||
|
||||
// Run container
|
||||
docker.image(imageName).run('-p 10002:80 --name otomai')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
// Trigger the deploy-prod-job on success of the build
|
||||
// Trigger the deployment job on success of the build
|
||||
build job: 'otomai-prod', 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