The steps explained

Our example, okeydokey, is a web service that always echoes OK to every request, and the code as well as the files for deployment are committed in our repository over in GitHub: https://github.com/DevOps-with-Kubernetes/okeydokey.

Before configuring our builds on Travis CI, let's create an image repository in Docker Hub first for later use. After signing in to Docker Hub, press the huge Create Repository button at the top right, and then follow the steps onscreen to create one. The image repository of okeydokey is at devopswithkubernetes/okeydokey (https://hub.docker.com/r/devopswithkubernetes/okeydokey/).

Connecting Travis CI with a GitHub repository is quite simple; all we need to do is authorize Travis CI to access our GitHub repositories and enable it to build the repository in the settings page (https://travis-ci.com/account/repositories). Another thing we'll need is a GitHub access token or a deploy key that has write permission to our repository. This will be put on the Travis CI so that the CI script can update the built image back into the config branch. Please refer to the GitHub official documentation (https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys) to obtain a deploy key.

The definition of a job in Travis CI is configured in a file, .travis.yml, placed under the same repository. The definition is a YAML format template consisting of blocks of shell scripts that tell us what Travis CI should do during a build.

The full Travis CI document can be found here: https://docs.travis-ci.com/user/tutorial/.

You can find explanations for the blocks of our .travis.yml file at the following URL: https://github.com/DevOps-with-Kubernetes/okeydokey/blob/master/.travis.yml.

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

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