Commit 9f19d914 authored by Ndoumbe's avatar Ndoumbe

Delete Jenkinsfile

parent 7ff4835a
#!/usr/bin/env groovy
def COLOR_MAP = [
'SUCCESS': 'good',
'FAILURE': 'danger',
]
pipeline {
// Setting up local variables for the 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()
registry = "ndiop/odoo:15.0"
registryCredential = 'docker-hub-ndiop'
}
agent any
stages {
stage('test') {
steps {
script{
echo'testing application'
}
}
}
stage('Building docker image odoo-demo and pushing'){
agent any
steps {
sh 'docker build -t ndiop/repo1:odoo-15.0 .'
withCredentials([usernamePassword(credentialsId: 'docker-hub-ndiop', passwordVariable: 'Password', usernameVariable: 'Username')]) {
sh ('docker login -u ${Username} -p ${Password}')
sh 'docker push ndiop/repo1:odoo-15.0 '
}
}
}
}
// Post-build actions
post {
success {
slackSend channel: 'odoo-demo',
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 odoo-demo 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 {
slackSend channel: 'odoo-demo',
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}"
}
}
}
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