stage('Building docker image for tai and pushing it'){
steps{
script{
last_stage=env.STAGE_NAME
}
ws("$WORKSPACE"+'/tai_build/'){
script{
docker.withRegistry('','docker-hub-ndiop'){
defimage=docker.build('baamtu/tai')
image.push()
}
}
}
}
}
}
// Post-build actions
post{
success{
slackSendchannel:'tai',
color:COLOR_MAP[currentBuild.currentResult],
message:"*${currentBuild.currentResult}:* JOB ${env.JOB_NAME} | BUILD N° = ${env.BUILD_NUMBER}\n Plus d'infos: ${env.BUILD_URL} \n Une nouvelle image est disponible pour le projet TAI sur l'environnement MASTER\n Message du commit : ${env.GIT_COMMIT_MSG} \n Lien du commit: https://gitlab.baamtu.com/root/tai/commit/${env.GIT_COMMIT} "
}
failure{
slackSendchannel:'tai',
color:COLOR_MAP[currentBuild.currentResult],
message:"*${currentBuild.currentResult}:* JOB ${env.JOB_NAME} | BUILD N° = ${env.BUILD_NUMBER} | Stage : "+last_stage+"\n Plus d'infos: ${env.BUILD_URL} \n Message du commit : ${env.GIT_COMMIT_MSG} \n Lien du commit: https://gitlab.baamtu.com/root/tai/commit/${env.GIT_COMMIT}"