1

I want to build a kind of Blue-Green Deployment using Jenkins' Pipeline. It should call separate jobs to fulfill the whole process. Assuming I got two servers available for a loadbalancer: web1 and web2. My idea is to implement following steps:

  1. checkout from SVN
  2. build project
  3. run Unit-Tests
  4. deploy project to web2
  5. run Selenium-Tests on web2
  6. add web2 to the loadbalancer
  7. remove web1 from the loadbalancer
  8. deploy project to web1
  9. remove web2 from the loadbalancer
  10. add web1 to the loadbalancer

This workflow allows to use the secondary server as pure testing machine, while ensuring the availability of the project.

However, while the deployment should run only once per day due to technical reasons, I want at least the unit test job run for every commit, so that my colleagues will immediately get feedback and reports (Continuous Integration).

The Deploy-Jobs should also be build manually with specific development-servers as parameter.

Needless to say, the jobs are dependent on each other, e.g.:

  • Build depends on Checkout
  • Unit-Tests depend on Build

Step 4 and step 8 should be the same jobs, as well as step 6 and 10, and 7 and 9, all controlled via parameters.

How can I achieve this scenario?

Thanks in advance for your help!

StephenKing
  • 36,187
  • 11
  • 83
  • 112
Jazzschmidt
  • 989
  • 12
  • 27

0 Answers0