Travis is leveraged to build and test the instance before deploying to environments. Our instances build and testing on travisci.org, however they depend heavily on CargoDock to dictate the build and test methods, and each repository contains only a stub .travis.yml file:
services:
- docker
php:
- '7.1'
cache:
directories:
- $HOME/.composer/cache
git:
depth: 1
env:
global:
- SERVICE_NAME=unbherbarium.lib.unb.ca
- AMAZON_ECR_REGION=us-east-1
- DEPLOY_BRANCHES=dev,prod
- DEPLOYMENT_FINISHED_MARKER=99_report_as_complete
- DOCKER_UPSTREAM_IMAGE=unblibraries/drupal:alpine-nginx-php7-8.x-composer
- OLD_IMAGES_TO_KEEP=2
- SERVICE_DEPLOY_PORT=80
- SERVICE_TEST_UP_PATH=/user
before_install:
- git clone git://github.com/unb-libraries/CargoDock.git CargoDock
- CargoDock/travis/installDockerCompose.sh
- CargoDock/aws/installAuthAws.sh
- cp docker-compose.yml.travis docker-compose.yml
- CargoDock/travis/setDockerComposeEnv.sh
before_script:
- CargoDock/travis/buildInstanceTheme.sh
- CargoDock/travis/buildInstanceForTesting.sh
- CargoDock/travis/waitForDeploy.sh
- CargoDock/travis/checkStartupForErrors.sh
script:
- CargoDock/travis/testInstance.sh
after_success:
- CargoDock/travis/buildImagePushToRepo.sh
- CargoDock/travis/cleanupOldImages.sh
- CargoDock/travis/triggerKubeDeploy.sh
containing some environment variables and boilerplate scripts. A successful Travis build log can be viewed here.