Skip to content

Commit

Permalink
cache CI docker image layers on quay.io
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Nov 21, 2019
1 parent 29d8942 commit 542111e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,40 @@ services:
- docker

env:
- CI_TARGET=unit_tests
- CI_TARGET=integration_tests
- CI_TARGET=ci_housekeeping
- CI_TARGET=skylab_bulk_rna
global:
- DOCKER_TAG=quay.io/mlin/miniwdl_ci:latest
- secure: "nxHBaRAUj641OAFDBYGp+VZ5U7txbm8BLanBCQE0SuulFCTz1mYf8+vEHPkhkm0hcQrghnvB27NT/1EwXJQcJTwX/+HF8ealhgogvJKcgiLNLGVLIK2DF/D2hYjbOFAX9yV4hMX6EFNwEVBiH+8OfI5JxXNPzAnDFJpyEHENe8LDEP4IpmGsjgcY8569zDJjT91Rc43YOKMiQDZFWqdN75CQDwP8EOhR7AKOt8kzpuNCR5Ovh1qEfXbvmdK2qnyUAo9ODJD4QF4Zps+HTs8GfTpn9Z6l1J4Nv2ACYEeB8ZTwy/0EBvzuM9QSHvlgCe9EjKoXQWV9qPQ3M1FBYs4dSDLiB2ILatRBbGxPP1QUP+uSFpmvxiWaAuUd6SgANVL880s8aCa5M+3gQ4QoxabcX9vyvdbWd69fJFXbv4XSwtTYrqTxwjhaeQ/oFhSgQISIs09IMDVqqSwTAJ/5hKMnJRdpemQIOEuKC3bvP/CoawxK4v5scGhYoa5tlYijQumQJj71/YgqAXCm3Si8283fBxbxZwch+JRNSWq/msaco6OMqi8dfgA2M/C3ovuFKeat0kdWFUwfzhmd1yUYyE+eorotrV+lb+rXwY7tLRV4BySNvixjOcfUQqKagnbyUHFNKti/obfywAS1xHRAfiNEbKJDGjZdDRjBmTld9DYhwrc="
comment: QUAY_PASSWORD
jobs:
- CI_TARGET=ci_unit_tests
- CI_TARGET=integration_tests
- CI_TARGET=ci_housekeeping
- CI_TARGET=skylab_bulk_rna

# Pull docker image layers from the last successful build, in hopes we might reuse the package
# installation steps
before_script:
- docker pull $DOCKER_TAG || true

script:
- |
set -exo pipefail
make docker
docker build -t $DOCKER_TAG --cache-from $DOCKER_TAG .
docker run --env TRAVIS_JOB_ID=${TRAVIS_JOB_ID} --env TRAVIS_BRANCH=${TRAVIS_BRANCH} \
--group-add $(stat -c %g /var/run/docker.sock) -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp \
miniwdl bash -c "make $CI_TARGET && coveralls"
$DOCKER_TAG make $CI_TARGET
jobs:
include:
# Push layers back to the registry for the next build(s) to use. From time to time, one should
# delete the 'latest' tag via the quay.io website to trigger a refresh.
- env: CI_TARGET=ci_housekeeping
after_success: |
if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
set +x
echo "$QUAY_PASSWORD" | docker login -u mlin+miniwdl_ci --password-stdin quay.io
docker push $DOCKER_TAG
fi
allow_failures:
- env: CI_TARGET=skylab_bulk_rna
fast_finish: true
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ skylab_bulk_rna:

ci_housekeeping: sopretty check_check check doc

ci_unit_tests: unit_tests
coveralls

check:
pyre \
--search-path stubs \
Expand Down

0 comments on commit 542111e

Please sign in to comment.