Jenkinsfile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Powered by Infostretch
  2. pipeline{
  3. agent any
  4. options {
  5. buildDiscarder(logRotator(numToKeepStr: '30'))
  6. }
  7. triggers {
  8. pollSCM('H/15 * * * *')
  9. }
  10. stages{
  11. stage ('Checkout') {
  12. steps {
  13. dir("openvpn"){
  14. git 'https://git.snppla.net/snppla/openvpn.git'
  15. }
  16. }
  17. }
  18. stage ('Build') {
  19. steps{
  20. dir("openvpn"){
  21. // Shell build step
  22. sh """
  23. docker build . -t $DOCKER_REGISTRY/$DOCKER_USER/openvpn:latest --pull
  24. docker login $DOCKER_REGISTRY/$DOCKER_USER -u $DOCKER_USER -p $DOCKER_PASSWORD
  25. docker push $DOCKER_REGISTRY/$DOCKER_USER/openvpn:latest
  26. """
  27. }
  28. }
  29. }
  30. }
  31. post {
  32. failure {
  33. mail to: "${env.ALERT_EMAIL}",
  34. subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
  35. body: "Something is wrong with ${env.BUILD_URL}"
  36. }
  37. fixed
  38. {
  39. mail to: "${env.ALERT_EMAIL}",
  40. subject: "Pipeline fixed: ${currentBuild.fullDisplayName}",
  41. body: "The pipeline was fixed with ${env.BUILD_URL}"
  42. }
  43. }
  44. }