Tried to cache travis build docker

canary
WolverinDEV 2018-11-06 18:18:53 +01:00
parent 4ba97f30ca
commit c6a54d8896
1 changed files with 17 additions and 2 deletions

View File

@ -1,6 +1,21 @@
sudo: true
dist: trusty
cache:
bundler: true
directories:
- $HOME/docker
before_cache:
# Save tagged docker images
- >
mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}'
| xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
before_install:
# Load cached docker images
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
jobs:
include:
- stage: build teaweb
@ -9,9 +24,9 @@ jobs:
- docker images
- docker pull $DOCKER_USERNAME/teaweb:build
- docker images
- docker run --rm $DOCKER_USERNAME/teaweb /bin/bash -c /root/build_teaweb.sh "travis" "travis" "travis" "travis"
- docker run --rm $DOCKER_USERNAME/teaweb /bin/bash -c /root/build_teaweb.sh travis
if: branch = master
- stage: test teaweb
- stage: test teaweb build
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker images