Commit c481d701 authored by Ndoumbe's avatar Ndoumbe

Update Jenkinsfile.shared

parent af6d8205
...@@ -11,9 +11,9 @@ pipeline { ...@@ -11,9 +11,9 @@ 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()
GITLAB_TOKEN_ID = 'baamtu_ci_user' GITLAB_TOKEN_ID = 'gitlab_credential'
PROJECT = 'waqf' PROJECT = 'docker-demo'
IMAGE_NAME = 'baamtu/waqf-onpremise' IMAGE_NAME = 'ndiop/odooimg'
BRANCH_NAME = "${GIT_BRANCH.split("/")[1]}" BRANCH_NAME = "${GIT_BRANCH.split("/")[1]}"
SHORT_COMMIT = "${GIT_COMMIT[0..7]}" SHORT_COMMIT = "${GIT_COMMIT[0..7]}"
DOCKER_BUILDKIT=1 DOCKER_BUILDKIT=1
...@@ -29,24 +29,19 @@ pipeline { ...@@ -29,24 +29,19 @@ pipeline {
steps steps
{ {
sh "mkdir -p $WORKSPACE/modules" sh "mkdir -p $WORKSPACE/modules"
CloningRepoBaamtuOdooModules(repoFolder:"baamtu-odoo-modules",url:"http://gitlab.baamtu.com/all/tsy/baamtu-odoo-modules.git") CloningRepo(repoFolder:"docker-demo",url:"http://gitlab.baamtu.com/diopbe/docker-demo.git")
CloningRepo(repoFolder:"baamtu-odoo-rh",url:"http://gitlab.baamtu.com/all/baamtu-internes/baamtu-odoo-rh.git") BuildImage(projectFolder:"docker-demo",targetName:"main")
CloningRepo(repoFolder:"ptn",url:"http://gitlab.baamtu.com/tdieng/ptn.git")
CloningRepo(repoFolder:"der",url:"http://gitlab.baamtu.com/all/tdieng/der.git")
CloningRepo(repoFolder:"waqf",url:"http://gitlab.baamtu.com/olimata.sy/waqf.git")
CloningRepoBuild(repoFolder:"build",url:"http://gitlab.baamtu.com/alioune.mbodj/baamtu-systems-devops.git")
BuildImage(projectFolder:"waqf",targetName:"main")
} }
} }
stage ('Building base Docker image') stage ('Building base Docker image')
{ {
when { when {
expression { BRANCH_NAME == 'base' } expression { BRANCH_NAME == 'main' }
} }
steps steps
{ {
CloningRepoBuild(repoFolder:"build",url:"http://gitlab.baamtu.com/alioune.mbodj/baamtu-systems-devops.git") CloningRepoBuild(repoFolder:"build",url:"http://gitlab.baamtu.com/diopbe/docker-demo.git")
BuildImage(projectFolder:"waqf",targetName:"base") BuildImage(projectFolder:"docker-demo",targetName:"main")
} }
} }
stage('Status') { stage('Status') {
...@@ -60,12 +55,12 @@ pipeline { ...@@ -60,12 +55,12 @@ pipeline {
// Post-build actions // Post-build actions
post { post {
success { success {
slackSend channel: '#jenkins-ci', slackSend channel: '#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 WAQF\n Message du commit : ${env.GIT_COMMIT_MSG} \n Lien du commit: http://gitlab.baamtu.com/olimata.sy/waqf/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 WAQF\n Message du commit : ${env.GIT_COMMIT_MSG} \n Lien du commit: http://gitlab.baamtu.com/olimata.sy/waqf/commit/${env.GIT_COMMIT} "
} }
failure { failure {
slackSend channel: '#jenkins-ci', slackSend channel: '#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 Message du commit : ${env.GIT_COMMIT_MSG} \n Lien du commit: http://gitlab.baamtu.com/olimata.sy/waqf/commit/${env.GIT_COMMIT}" message: "*${currentBuild.currentResult}:* JOB ${env.JOB_NAME} | BUILD N° = ${env.BUILD_NUMBER}\n Plus d'infos: ${env.BUILD_URL} \n Message du commit : ${env.GIT_COMMIT_MSG} \n Lien du commit: http://gitlab.baamtu.com/olimata.sy/waqf/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