-
Notifications
You must be signed in to change notification settings - Fork 50
/
.travis.yml
76 lines (52 loc) · 3.09 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
69
70
71
72
73
74
75
76
# Uses Ubuntu 'trusty' distribution
sudo: required
services:
- docker
env:
- DOCKER_COMPOSE_VERSION=1.13.0
language: ruby
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
- docker-compose version
- echo "slug" $TRAVIS_REPO_SLUG
- echo "branch" $TRAVIS_BRANCH
- echo "pr slug" $TRAVIS_PULL_REQUEST_SLUG
- echo "pr branch" $TRAVIS_PULL_REQUEST_BRANCH
- echo "event" $TRAVIS_EVENT_TYPE
- BE_REPO=voteamerica/backend
# if need to change tests on backend, specify repo to use
# - BE_REPO=jkbits1/backend
- BE_BRANCH=master
# if need to change tests on backend, specify branch to use
# - BE_BRANCH=docker-test
- echo BE REPO $BE_REPO
- echo BE BRANCH $BE_BRANCH
- echo install
- pwd
# - git clone --single-branch --branch master https://github.com/voteamerica/backend $HOME/build/voteamerica/be
- git clone --single-branch --branch $BE_BRANCH https://github.com/$BE_REPO $HOME/build/voteamerica/be
- ls $HOME/build/voteamerica/be
before_script:
- echo before
- ls $HOME/build/voteamerica/be
- ls $HOME/build/voteamerica/be/docker
- pwd
- cd $HOME/build/voteamerica/be/docker
- $HOME/build/voteamerica/be/docker/specific-machine-test-travis-fe.sh cp-front-end R $TRAVIS_REPO_SLUG $TRAVIS_BRANCH $TRAVIS_EVENT_TYPE $TRAVIS_PULL_REQUEST_SLUG $TRAVIS_PULL_REQUEST_BRANCH
# these commands create specific machines for test runner, node app and db
# if working on a dev branch of the backend, uncomment the relevant machines and
# set the repo/branch that contains the backend dev code
- $HOME/build/voteamerica/be/docker/specific-machine-test-travis-fe.sh cp-test-runner R $BE_REPO $BE_BRANCH
- $HOME/build/voteamerica/be/docker/specific-machine-test-travis-fe.sh cp-nodejs R $BE_REPO $BE_BRANCH
- $HOME/build/voteamerica/be/docker/specific-machine-test-travis-fe.sh cp-pg-server R $BE_REPO $BE_BRANCH
# - docker-compose -f $HOME/build/voteamerica/be/docker/compose/full-stack-test/docker-compose-test.yml build --build-arg REPO=https://github.com/jkbits1/backend --build-arg BRANCH_NAME=docker-test --build-arg CACHEBUST=$(date +%s) cp-test-runner
# - docker-compose -f $HOME/build/voteamerica/be/docker/compose/full-stack-test/docker-compose-test.yml build --build-arg REPO=https://github.com/jkbits1/backend --build-arg BRANCH_NAME=docker-test --build-arg CACHEBUST=$(date +%s) cp-nodejs
# - docker-compose -f $HOME/build/voteamerica/be/docker/compose/full-stack-test/docker-compose-test.yml build --build-arg REPO=https://github.com/jkbits1/backend --build-arg BRANCH_NAME=docker-test --build-arg CACHEBUST=$(date +%s) cp-pg-server
- docker-compose -f $HOME/build/voteamerica/be/docker/compose/full-stack-test/docker-compose-test.yml up -d
script:
- travis_retry $HOME/build/voteamerica/be/docker/compose-tests.sh full-tests
after_script:
- docker-compose -f $HOME/build/voteamerica/be/docker/compose/full-stack-test/docker-compose-test.yml down