Jenkinsfile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. environment {
  14. DOCKER_BUILDKIT = '1'
  15. }
  16. stages {
  17. stage('Build') {
  18. steps {
  19. script {
  20. docker.withRegistry('https://docker.snppla.net', 'nexus_push') {
  21. def customImage = docker.build("docker.snppla.net/snppla/deluge-web:${env.GIT_BRANCH}", '--pull ./')
  22. customImage.push()
  23. }
  24. }
  25. }
  26. }
  27. }
  28. post {
  29. success {
  30. emailext body: "${env.BUILD_URL} was built", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Built Pipeline: ${currentBuild.fullDisplayName}"
  31. }
  32. failure {
  33. emailext body: "Something is wrong with ${env.BUILD_URL}", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Failed Pipeline: ${currentBuild.fullDisplayName}"
  34. }
  35. fixed {
  36. emailext body: "The pipeline was fixed with ${env.BUILD_URL}", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Pipeline fixed: ${currentBuild.fullDisplayName}"
  37. }
  38. }
  39. }