Commit af6d8205 authored by Ndoumbe's avatar Ndoumbe

Add new file

parent 22d0c3f2
@Library("odoo-baamtu-shared-lib") _
def COLOR_MAP = [
'SUCCESS': 'good',
'FAILURE': 'danger',
]
pipeline {
environment
{
// test variable: 0=success, 1=fail; must be string
doError = '0'
GIT_COMMIT_MSG = sh(returnStdout: true, script: "git log -1 --pretty=%B").trim()
GITLAB_TOKEN_ID = 'baamtu_ci_user'
PROJECT = 'waqf'
IMAGE_NAME = 'baamtu/waqf-onpremise'
BRANCH_NAME = "${GIT_BRANCH.split("/")[1]}"
SHORT_COMMIT = "${GIT_COMMIT[0..7]}"
DOCKER_BUILDKIT=1
}
agent any
stages
{
stage ('Building main Docker image')
{
when {
expression { BRANCH_NAME == 'dev' || BRANCH_NAME == 'master' }
}
steps
{
sh "mkdir -p $WORKSPACE/modules"
CloningRepoBaamtuOdooModules(repoFolder:"baamtu-odoo-modules",url:"http://gitlab.baamtu.com/all/tsy/baamtu-odoo-modules.git")
CloningRepo(repoFolder:"baamtu-odoo-rh",url:"http://gitlab.baamtu.com/all/baamtu-internes/baamtu-odoo-rh.git")
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')
{
when {
expression { BRANCH_NAME == 'base' }
}
steps
{
CloningRepoBuild(repoFolder:"build",url:"http://gitlab.baamtu.com/alioune.mbodj/baamtu-systems-devops.git")
BuildImage(projectFolder:"waqf",targetName:"base")
}
}
stage('Status') {
steps{
GetStatus(env.doError)
}
}
}
// Post-build actions
post {
success {
slackSend channel: '#jenkins-ci',
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} "
}
failure {
slackSend channel: '#jenkins-ci',
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}"
}
}
}
\ No newline at end of file
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