Automation tales in CI/CD - Part 3

vaughan mason - 2021-05-15

So we need to merge changes made in a private repo so that the GitHub pages are updated automatically which is a public repo. Let’s unpack what this is, evaluating the options and then deciding on the final solution.

What is CI/CD?

So we are going to use the definitions found here. We are going to unpack the following terms:

Taking into account the above definitions above, we need to understand the differences between the repos that I will be employing:

So what will I be doing

We going to discuss 2 options that I investigated and one that I finally implemented.

Explaining my Continuous Deployment options

It basically boils down to 2 options plus 1, automated (triggered) or scheduled because in the world of computing with the addition of manual those are the only ways you can interact with code (and everything is code). So now that I know that I have 2 options we are going to explore both because seriously the third option is out because it does not meet one of my requirements.

Explaining the CD approaches

So let’s begin by unpacking the 2 approaches and what is required to achieve them, making sure we are aligned to the requirements that were previously decided upon (be it by myself).

No matter the approach the final event is the same. I’ll be explaining it first as it is not affected by each approach.

Final Event

I bundled the final event into a shell script that executed the following. This was a little challenging as the location of the sh file and executing the code was not based on a user profile so multiple variables needed to be configured. It worked out in the end.

Approach 1 - Automated CD

So here are the basics required to achieve an automated CD:

Approach 2 - Scheduled CD

How to Schedule Cron jobs

What did I choice?

I went with the scheduled approach as there were a lot more questions associated with approach 1 (how to capture the url on start up and update the GitHub webhook). The thing to remember is that this is a private website and if I was doing this within an organisation I would make a whole lot of other decisions which would lead to different outcomes.

There is a lot of code, hacks or tweaks, whatever you want to call it, that need to be expanded on. But majority of the fixes and solutions were found on the websites that I have already listed and the approach will depend on the technology choices that you have made.

This page was last updated at 2021-05-15

If you don't agree with the content on this page, please click here