jenkinsfile 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. // Powered by Infostretch
  2. pipeline{
  3. agent any
  4. triggers {
  5. pollSCM('H/15 * * * *')
  6. }
  7. stages{
  8. stage ('openvpn - Checkout') {
  9. steps {
  10. checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '', url: 'https://git.snppla.net/snppla/openvpn.git']]])
  11. }
  12. }
  13. stage ('openvpn - Build') {
  14. steps{
  15. // Shell build step
  16. sh """
  17. docker build . -t $DOCKER_REGISTRY/$DOCKER_USER/$JOB_NAME --pull
  18. docker login $DOCKER_REGISTRY/$DOCKER_USER -u $DOCKER_USER -p $DOCKER_PASSWORD
  19. docker push $DOCKER_REGISTRY/$DOCKER_USER/$JOB_NAME
  20. """
  21. }
  22. }
  23. }
  24. post {
  25. failure {
  26. mail to: "${env.ALERT_EMAIL}",
  27. subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
  28. body: "Something is wrong with ${env.BUILD_URL}"
  29. }
  30. }
  31. }