Jenkinsfile 979 B

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