Jenkinsfile 991 B

123456789101112131415161718192021222324252627282930313233
  1. pipeline{
  2. agent any
  3. triggers {
  4. pollSCM('H * * * *')
  5. cron('H H H * *')
  6. }
  7. stages{
  8. node('docker'){
  9. stage('Build') {
  10. steps {
  11. script {
  12. docker.withRegistry('https://docker.snppla.net', 'nexus_push'){
  13. def customImage = docker.build("docker.snppla.net/snppla/gogs-docker:${env.GIT_BRANCH}", "--pull ./")
  14. customImage.push()
  15. }
  16. }
  17. }
  18. }
  19. }
  20. }
  21. post {
  22. success{
  23. emailext body: "${env.BUILD_URL} was built", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Built Pipeline: ${currentBuild.fullDisplayName}"
  24. }
  25. failure{
  26. emailext body: "Something is wrong with ${env.BUILD_URL}", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Failed Pipeline: ${currentBuild.fullDisplayName}"
  27. }
  28. fixed
  29. {
  30. emailext body: "The pipeline was fixed with ${env.BUILD_URL}", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Pipeline fixed: ${currentBuild.fullDisplayName}"
  31. }
  32. }
  33. }