title: How to have 2 path jenkins pipeline for Blue/Green Deployment Strategy
body: <p>I have a Jenkinsfile having a path in this order (assuming Green envs are binded to production only):</p>
  
  <p>Build-->Deploy-to-QA-->Deploy-To-Preprod-->Deploy-To-BLUE-Production-->Bind to Blue envs to Load Balancer--> Unbind Green Env-->Deploy to Green--> Bind Green--> Unbind Blue</p>
  
  <p>This order seems to be good if we are being too optimistic,because in some cases, there might be a problem with green env, and admin user can bind the blue envs manually, or both can be binded together to the production.</p>
  
  <p>Therefore, I have written a script which makes an API call to the LB and gets the binded service group.</p>
  
  <p>But I could not figure out how to redirect the pipeline by getting the result of api.</p>
  
  <p>If endpoint returns blue is binded, it should start deploying from green,
  if endpoint returns green is binded info, it should start deploying from blue env in my case.</p>
  
  <p>But as far as I see, I cannot wrap the stages within a function in Jenkinsfile.</p>