forked from Regaez/grav-plugin-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
44 lines (35 loc) · 1.17 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
sudo: required
language: php
services:
- docker
env:
- DOCKER_COMPOSE_VERSION=1.23.1
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
# Load cached docker images
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
- docker build --cache-from grav-api-dev -t grav-api-dev:latest .
install:
- composer install
script:
- composer start
- docker-compose exec grav chown -R www-data:www-data .
- composer test:bootstrap
- composer test
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'
cache:
bundler: true
directories:
- "$HOME/.composer/cache"
- $HOME/docker
addons:
apt:
packages:
- docker-ce