Commit 0d0f01c1 authored by Ndoumbe's avatar Ndoumbe

Update Jenkinsfile

parent 7364fe3d
...@@ -10,6 +10,8 @@ pipeline { ...@@ -10,6 +10,8 @@ pipeline {
// test variable: 0=success, 1=fail; must be string // test variable: 0=success, 1=fail; must be string
doError = '0' doError = '0'
GIT_COMMIT_MSG = sh(returnStdout: true, script: "git log -1 --pretty=%B").trim() GIT_COMMIT_MSG = sh(returnStdout: true, script: "git log -1 --pretty=%B").trim()
registry = "ndiop/repo1:odoo-15.0"
registryCredential = 'docker-hub-ndiop'
} }
agent any agent any
...@@ -35,28 +37,6 @@ pipeline { ...@@ -35,28 +37,6 @@ pipeline {
} }
} }
stage('Prepare files for tai building') {
steps {
script {
last_stage = env.STAGE_NAME
}
ws("$WORKSPACE" + '/tai_build/') {
sh 'cp -rf ../tai .'
sh 'ls'
sh 'rm -r tai/.git*'
sh 'cp -rf tai/Dockerfile .'
sh 'cp -rf tai/entrypoint.sh .'
sh 'cp -rf tai/odoo.conf .'
sh 'cp -rf tai/web_auth_oauth .'
sh 'cp -rf tai/web_auth_signup .'
sh 'cp -rf tai/web_portal .'
sh 'ls'
}
}
}
stage('Building docker image for tai and pushing it') { stage('Building docker image for tai and pushing it') {
steps { steps {
script { script {
...@@ -65,7 +45,7 @@ pipeline { ...@@ -65,7 +45,7 @@ pipeline {
ws("$WORKSPACE" + '/tai_build/') { ws("$WORKSPACE" + '/tai_build/') {
script { script {
docker.withRegistry('', 'docker-hub-ndiop') { docker.withRegistry('', 'docker-hub-ndiop') {
def image = docker.build('baamtu/tai') def image = docker.build registry + ":$BUILD_NUMBER"
image.push() image.push()
} }
} }
...@@ -79,12 +59,12 @@ pipeline { ...@@ -79,12 +59,12 @@ pipeline {
// Post-build actions // Post-build actions
post { post {
success { success {
slackSend channel: 'tai', slackSend channel: 'odoo-demo',
color: COLOR_MAP[currentBuild.currentResult], 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} " 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 { failure {
slackSend channel: 'tai', slackSend channel: 'odoo-demo',
color: COLOR_MAP[currentBuild.currentResult], 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}" 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}"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment