Creating a Jenkins job that upgrades the whole production environment

Before we upgrade the production environment, we'll create one more release of go-demo-5 so that we have something new to deploy.

 1  open
"http://$JENKINS_ADDR/blue/organizations/jenkins/go-demo-5/branches"

We opened the branches screen of the go-demo-5 job.

Please click the play button from the right side of the master row and wait until the new build is finished.

Lo and behold! Our build failed! If you explore the job in detail, you will know why it's broken.

You'll see Did you forget to increment the Chart version? message.

Figure 8-3: go-demo-5 failed build

Our job does not allow us to push a commit to the master branch without bumping the version of the go-demo-5 chart. That way, we guarantee that every production-ready release is versioned correctly. Let's fix that.

 1  cd ../go-demo-5

Please open helm/go-demo-5/Chart.yaml in your favorite editor and increment the version. If, for example, the current version is 0.0.1, change it to 0.0.2, if it's 0.0.2, change it to 0.0.3, and so on. You get the point. Just increase it.

Next, we'll push the change to the master branch.

 1  git add .
2 3 git commit -m "Version bump"
4 5 git push

Usually, you'd push the change to a branch, make a pull request, and let someone review it. Such a pull request would execute a Jenkins build that would give the reviewer the information about the quality of the changes. If the build was successful and the review did not reveal any deficiencies, we would merge the pull request.

We skipped all that, and we pushed the changes directly to the master branch only to speed things up.

Now let's go back to Jenkins and run another build.

 1  open
"http://$JENKINS_ADDR/blue/organizations/jenkins/go-demo-5/branches"

Please click the play button from the right side of the master row and wait until the new build is finished. This time, it should be successful, and we'll have a new go-demo-5 release waiting to be deployed to the production environment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.187.103