12345678910111213141516171819202122232425262728293031323334353637383940 |
- // Powered by Infostretch
- pipeline{
- agent any
- options {
- buildDiscarder(logRotator(numToKeepStr: '30'))
- }
- triggers {
- pollSCM('H/15 * * * *')
- }
- stages{
- stage ('openvpn - Checkout') {
- steps {
- checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '', url: 'https://git.snppla.net/snppla/openvpn.git']]])
- }
- }
- stage ('openvpn - Build') {
- steps{
- // Shell build step
- sh """
- docker build . -t $DOCKER_REGISTRY/$DOCKER_USER/$JOB_NAME:${env.BRANCH_NAME} --pull
- docker login $DOCKER_REGISTRY/$DOCKER_USER -u $DOCKER_USER -p $DOCKER_PASSWORD
- docker push $DOCKER_REGISTRY/$DOCKER_USER/$JOB_NAME:${env.BRANCH_NAME}
- """
- }
- }
- }
- post {
- failure {
- mail to: "${env.ALERT_EMAIL}",
- subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
- body: "Something is wrong with ${env.BUILD_URL}"
- }
- fixed
- {
- mail to: "${env.ALERT_EMAIL}",
- subject: "Pipeline fixed: ${currentBuild.fullDisplayName}",
- body: "The pipeline was fixed with ${env.BUILD_URL}"
- }
- }
- }
|