A team member develops a fantastic feature and pushes a commit to the Lean Instance Repository to GitHub.
Github notifies the team of the new commit via Slack.
Github invokes its service integrations, and either travis-ci.org (Public GitHub Repository) or travis-ci.com (Private GitHub Repository) is notified of the new commit.
Travis, upon being notified of the commit reads the .travis.yml file in the lean repository, which defines how to build and test the instance.
https://github.com/unb-libraries/motty.lib.unb.ca/blob/dev/.travis.yml
Although .travis.yml references many steps, the actual scripts referenced in this file are not stored in each instance. They are tracked and delivered from Cargodock, in the travis directory:
https://github.com/unb-libraries/CargoDock/tree/master/travis
Be aware the Travis does NOT notify slack that the build starts. This is a limitation of travis, and we have logged a feature request here:
Travis builds the lean repository into a Docker image. The build is fully logged:
(https://travis-ci.org/unb-libraries/unbherbarium.lib.unb.ca/builds/302439089)
Once the repository is built into an image, the image is launched as a container, and tests are performed. Several elements of the build are tested:
- Does the repository actually build?
- Once built, does the launched container error when starting up/importing configuration?
- If no errors appear at launch, do the features described by the Behat tests respond as intended?
If any of these tests fail, travis Errors and notifies the team via Slack of the failure.
If the build is successful, however, the image created is pushed to the (AWS Elastic Container Repository)[https://aws.amazon.com/ecr/] repository for the instance.
To conserve resources (read: Money), old builds are removed from ECR. The maximum number of images to keep in the ECR per branch is define by the OLD_IMAGES_TO_KEEP variable in .travis.yml
https://github.com/unb-libraries/emmr.lib.unb.ca/blob/prod/.travis.yml#L24
Once the image has been pushed to the ECR, Travis POSTs a request to Jenkins, triggering a deployment of the newly pushed image.
https://github.com/unb-libraries/CargoDock/blob/master/travis/triggerKubeDeploy.sh
As a final step, travis notifies Slack of the build/test success.

EOM
https://github.com/unb-libraries/CargoDock/blob/master/jenkins/updateKubeDeploymentImage.sh
Again, after container launch, the logs are checked for errors:
- Does the container reach 'Running' status?
- Once 'Running', does the launched container error when starting up/importing configuration?
If errors are detected, the Jenkins build will fail, notifying the team via Slack.
Backstop tests run and pass/fail the Jenkins job.
