Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you manage multiple releases in multiple environments in continuous integration/delivery?

I am trying to wrap my head around this. Most CI/CD examples/projects have a single master that is always released, and have some variant of, e.g. git-flow, to have a develop branch. Once tagged, it goes to master.

Either way, master is always released to production.

But in the real world as I see it, there are human gates for release to production and other environments. What mechanism do you use to manage the deployment of different versions?

For example:

  • v1.5 is the current production release
  • v1.6 has passed all tests, artifacts are ready, it is tagged as valid, but business decides to deploy it only to staging, awaiting an opportune moment to deploy
  • v1.5 is deployed to a demo environment
  • v2.0 has also passed all tests, but is in UAT, subject to the customer being happy, as it is a major release

There could be many more such environments - production, staging, UAT, demo, demo2, etc.

What mechanism do you use to handle the tagging of a particular version for a particular environment, and the actual deployment thereof?

like image 282
deitch Avatar asked Jul 28 '14 14:07

deitch


People also ask

How a software release is performed in an agile continuous delivery environment?

Continuous delivery automates the entire software release process. Every revision that is committed triggers an automated flow that builds, tests, and then stages the update. The final decision to deploy to a live production environment is triggered by the developer.

What is the frequency of releases in an agile continuous delivery environment?

You would have to adopt continuous deployment to do that. So, if you're doing continuous delivery, you have the option of releasing as frequently as you like—every day, every month or even every hour.

What is the purpose of using multiple environments?

Using multiple environments ensures that your software is rigorously tested before it is deployed and made available to users. An example setup could have development, staging and production environments: Development: The development environment would be the first line of defense against bugs.


1 Answers

Although there a probably a few ways to do it, I use the build pipeline plugin https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin Along with the copy artifacts plugin https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin

With these, you can create individual jobs for each piece of your environment, and link them altogether. So as in your example, the pipeline would look like:

Build -> Test and Deploy to UAT (2.0) -> deploy to staging(1.6) -> demo(1.5) -> prod (1.5)

Each piece represents a different build in jenkins. The idea behind continuous integration is you create the binaries once, and you carry it down the pipeline, only changing configuration pieces along the way. In a build job, the artifacts are created and then archived. In any jobs after, the artifact is picked up from the upstream job, some stuff is done, and then it get's re-archived for the next downstream job. So the deploy to staging would go to the Test and Deploy to Uat job to get its binary. The entire concept of Continuous Delivery boils down to the the build pipeline. http://en.wikipedia.org/wiki/Continuous_delivery (and yes I did just cite wikipedia).

As for tagging individual binaries for specific environments, that is by definition, not continuous integration. A binary is suppose to be created in a way that it can easily be propagated from one environment to the next. So unfortunately, individual builds for specific environments can never be continuous delivery. You can use jenkins as a CI server all you want, but if your process does not match, you will never achieve true continuous integration.

Braching, merging and checkins always seems to be a touchy subject when it comes to Continuous Integration, so I won't go into it much. But a lot of people share the idea that : "If different members of the team are working on separate branches, then by definition, they not participating in continuous integration process." http://eugenedvorkin.com/continuous-integration-strategies-for-branching-and-merging/

EDIT
For Flagging specific builds, it sounds like your looking to take use of this feature : https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint ... Which gets the job done effectively, giving you the entire life of any individual artifact. A bit more complex solution would be artifactory, which is essentially artifact source control.

I explained the concept of the deployment process above, and without information on your specific environment it is hard to go much further. But for me, for java applications deployed to tomcat containers, the deploy plugin works great https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin

You shouldn't have to worry about selection of which artifact to deploy. The pipeline should be setup to always deploy the latest artifact that was archived in its corresponding upstream job.

like image 135
Cole9350 Avatar answered Oct 08 '22 04:10

Cole9350