Jenkinsfile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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"
  27. sh 'pwd'
  28. }
  29. }
  30. stage("Update") {
  31. when {
  32. allOf {
  33. expression { service_update != null }
  34. expression { not service_update.empty }
  35. }
  36. }
  37. steps {
  38. // service_update.split()
  39. println 'mememe'
  40. echo "Updating $service_update"
  41. sh 'ls'
  42. }
  43. }
  44. }
  45. post {
  46. always {
  47. echo "It's always good to be here."
  48. }
  49. changed {
  50. echo "Something changed..."
  51. }
  52. failure {
  53. echo "Oh, snap. It's failed again"
  54. }
  55. success {
  56. echo "Fine !!! It's SUCCESS !!!"
  57. }
  58. unstable {
  59. echo "Unstable ...."
  60. }
  61. aborted {
  62. echo "Hmmm... It's aborted"
  63. }
  64. }
  65. }