Getting ready

For this recipe, we are going to be using the Jenkins CI/CD system as our build and deployment tool, so we will need to install this first. We can head over to https://jenkins.io/ to download the appropriate binary for our system. Once we have the download, run the installer.

Jenkins runs in the background as a daemon process. To achieve this, the installer creates a jenkins user account. This account is very restricted in what it can do, which is great for security on a production build system; however, we'll be loosening the restrictions for local development purposes.

We'll configure jenkins to have sudo powers. Let's run the following command:

$ sudo visudo 

This will open up the sudoers file in the vi editor. Add the following line to the end of the file:

jenkins ALL=(ALL) NOPASSWD:ALL 
Sudoers
We have used very loose permissions for the Jenkins user. There are other more secure methods that can be used to allow jenkins to effectively run builds. We have used this method as it allows us to focus on build configuration and not security.

We also need to update the PATH environment variable for the Jenkins user. To do this, run the following:

$ sudo su jenkins
$ cd ~
$ echo export PATH="/usr/local/bin:$PATH" > .bashrc

This recipe uses the micro folder as we left it in the previous recipe, Deploying a Container to Kubernetes.

We'll be using the git version control tool in this recipe, so we will need to have that installed on our system.

We'll also need a GitHub account. If we don't have a GitHub account, we can navigate to http://github.com and create one.

Additionally, we need to create a GitHub repository called micro (see https://help.github.com/articles/create-a-repo/ for help on this). We'll be adding code to our GitHub repository throughout.

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

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