Guest User

Untitled

a guest
Oct 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. #!/usr/bin/env groovy
  2. node('<place_node_here>'){
  3. //Any code that is placed here will run on every branch
  4. def branch = "${env.BRANCH_NAME}"
  5.  
  6. stage ('Checkout') {
  7. //checkout the ctsupport.bot project
  8. checkout scm
  9. echo "You are building the following branch: " + branch
  10. }
  11.  
  12. stage ('Build') {
  13. echo 'This is where your build code goes. You can build maven, nodejs, docker, go, or anyother project that you can build with a cli.'
  14. }
  15.  
  16. if(env.BRANCH_NAME.startsWith('feature/')) {
  17. stage('Deploy to Dynamic Dev Instance and run Test Automation'){
  18. echo "Execute Test Automation Suite"
  19. }
  20. }
  21.  
  22. if(env.BRANCH_NAME.startsWith('PR-')){
  23. stage('Merge Validation'){
  24. echo "run merge validation script with auto approval for PR on success!"
  25. }
  26. }
  27.  
  28. if (env.BRANCH_NAME.equalsIgnoreCase('develop')){
  29. //run all functionality that should run in develop
  30. stage ('Deploy to QA') {
  31. echo "This is where your deploy code would go. You can run a script or interact with a plugin for this step!"
  32. }
  33.  
  34. stage('Custom Test Script Execution'){
  35. echo 'This is where you run a custom test script to verify your staging environment works'
  36. }
  37.  
  38. stage('Switch Routes') {
  39. echo 'This is where you would run that command that would switch your routes from current staging to new staging version.'
  40. }
  41. }
  42.  
  43. if(env.BRANCH_NAME.startsWith('release/')){
  44. stage('Release Validation'){
  45. echo "run release validation script with single manual reviewer for push button deploy to PROD!"
  46. }
  47. }
  48.  
  49. if (env.BRANCH_NAME.equalsIgnoreCase('master')){
  50. //run all functionality that should run in master
  51. stage ('Deploy to Production') {
  52. echo "This is where your deploy code would go. You can run a script or interact with a plugin for this step!"
  53. }
  54.  
  55. stage('Custom Test Script Execution'){
  56. echo 'This is where you run a custom test script to verify your production environment works'
  57. }
  58.  
  59. stage('Switch Routes') {
  60. echo 'This is where you would run the command/script that would switch your production routes from current Production to new Prod version.'
  61. }
  62. }
  63. }
Add Comment
Please, Sign In to add comment