forked from cerner/terra-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (68 loc) · 2.99 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
language: generic
sudo: required
services:
- docker
branches:
only:
- master
cache:
directories:
- $HOME/docker
env:
global:
- DOCKER_IMAGE='cerner/terra-toolkit'
- TAG="${TRAVIS_PULL_REQUEST_SHA:=latest}"
before_install:
- sudo chown -R travis:travis $HOME/docker
# Load cached docker images
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
before_cache:
- sudo chown -R travis:travis $HOME/docker
- if [ $TRAVIS_TEST_RESULT == 1 ]; then rm -f $HOME/docker/*.tar.gz; fi
jobs:
include:
- stage: release terra-node
script:
- echo "$DOCKER_PASSWORD" | docker login -u "ryanthemanuel" --password-stdin
- travis_wait docker build -t cerner/terra-node -f ./docker/terra-node/Dockerfile ./docker/terra-node/
- travis_wait docker build -t cerner/terra-node-base:latest -f ./docker/terra-node-base/Dockerfile ./docker/terra-node-base/
- travis_wait docker build -t cerner/terra-node-ci:latest -f ./docker/terra-node-ci/Dockerfile ./docker/terra-node-ci/
- travis_wait docker build -t cerner/terra-node-dev:latest -f ./docker/terra-node-dev/Dockerfile ./docker/terra-node-dev/
- travis_wait docker push cerner/terra-node
- travis_wait docker push cerner/terra-node-base:latest
- travis_wait docker tag cerner/terra-node-base:latest cerner/terra-node-base:1
- travis_wait docker push cerner/terra-node-base:1
- travis_wait docker push cerner/terra-node-ci:latest
- travis_wait docker tag cerner/terra-node-ci:latest cerner/terra-node-ci:1
- travis_wait docker push cerner/terra-node-ci:1
- travis_wait docker push cerner/terra-node-dev:latest
- travis_wait docker tag cerner/terra-node-dev:latest cerner/terra-node-dev:1
- travis_wait docker push cerner/terra-node-dev:1
- stage: build
before_install: true
script:
- sudo chown -R travis:travis $HOME/docker
- 'rm -f $HOME/docker/*.tar.gz'
- travis_wait docker-compose build test-ci
- travis_wait docker-compose --verbose pull standalone-chrome
- >
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'
- stage: lint jest
script:
- "travis_wait docker-compose run -e HAS_JOSH_K_SEAL_OF_APPROVAL=$HAS_JOSH_K_SEAL_OF_APPROVAL -e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST -e TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG test-ci sh -c 'npm run lint && npm run jest'"
- stage: test
script:
- "travis_wait docker-compose run test-ci npm run wdio"
- stage: clean up cache
before_install: true
script:
- sudo chown -R travis:travis $HOME/docker
- 'rm -f $HOME/docker/*.tar.gz'
stages:
- name: release terra-node
if: type != pull_request
- build
- lint jest
- test
- clean up cache