Jenkinsfile 977 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. pipeline {
  2. agent {
  3. label "swarm"
  4. }
  5. parameters {
  6. string(
  7. name: "service",
  8. defaultValue: "",
  9. description: "The name of service that should be scaled"
  10. )
  11. string(
  12. name: "scale",
  13. defaultValue: "",
  14. description: "Number of replicas to add or remove."
  15. )
  16. }
  17. stages {
  18. stage("Scale") {
  19. steps {
  20. echo "Scaling $service by $scale"
  21. sh 'pwd'
  22. }
  23. post {
  24. always {
  25. echo "Step always"
  26. }
  27. changed {
  28. echo "Step change"
  29. }
  30. failure {
  31. echo "Step failure"
  32. }
  33. }
  34. }
  35. }
  36. post {
  37. always {
  38. echo "It's always good to be here."
  39. }
  40. changed {
  41. echo "Something changed..."
  42. }
  43. failure {
  44. echo "Oh, snap. It's failed again"
  45. }
  46. success {
  47. echo "Fine !!! It's SUCCESS !!!"
  48. }
  49. unstable {
  50. echo "Unstable ...."
  51. }
  52. aborted {
  53. echo "Hmmm... It's aborted"
  54. }
  55. }
  56. }