Jenkinsfile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. pipeline {
  2. agent {
  3. label "swarm"
  4. }
  5. parameters {
  6. string(
  7. name: "build_repo",
  8. defaultValue: "prod",
  9. description: "Repository to build from. If not presented - build will not run."
  10. )
  11. string(
  12. name: "service_update",
  13. defaultValue: "",
  14. description: "Services to update - i.e. node or/and node-api"
  15. )
  16. }
  17. stages {
  18. stage("Build") {
  19. when {
  20. allOf {
  21. expression { build_repo != null }
  22. expression { not build_repo.empty }
  23. }
  24. }
  25. steps {
  26. echo "Building with repo $build_repo and updating $service_update"
  27. sh 'pwd'
  28. }
  29. post {
  30. always {
  31. echo "Step always"
  32. }
  33. changed {
  34. echo "Step change"
  35. }
  36. failure {
  37. echo "Step failure"
  38. }
  39. }
  40. }
  41. }
  42. post {
  43. always {
  44. echo "It's always good to be here."
  45. }
  46. changed {
  47. echo "Something changed..."
  48. }
  49. failure {
  50. echo "Oh, snap. It's failed again"
  51. }
  52. success {
  53. echo "Fine !!! It's SUCCESS !!!"
  54. }
  55. unstable {
  56. echo "Unstable ...."
  57. }
  58. aborted {
  59. echo "Hmmm... It's aborted"
  60. }
  61. }
  62. }