Jenkinsfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. echo service_update.split()
  39. echo "Updating $service_update"
  40. sh 'ls'
  41. }
  42. }
  43. }
  44. post {
  45. always {
  46. echo "It's always good to be here."
  47. }
  48. changed {
  49. echo "Something changed..."
  50. }
  51. failure {
  52. echo "Oh, snap. It's failed again"
  53. }
  54. success {
  55. echo "Fine !!! It's SUCCESS !!!"
  56. }
  57. unstable {
  58. echo "Unstable ...."
  59. }
  60. aborted {
  61. echo "Hmmm... It's aborted"
  62. }
  63. }
  64. }