Jenkinsfile 1.3 KB

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