forked from MapStory/mapstory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
109 lines (95 loc) · 3.75 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
branches:
only:
- master
- lab
sudo: required
dist: trusty
group: edge
services:
- docker
language: python
python:
- "2.7"
env:
global:
- DOCKER_COMPOSE_VERSION=1.21.1
- secure: "IMm6jAeLGJ1Vo3L81JIEh2/Z2jIARYFBviQ5cxTTH88ndN2Oj03rPDjvkP44YZwZT7Gd768Ve1PuEgq5oVmqd+oZF7hUEh08LalUV9aOkIRFEc8SjuUJVFhFzUGovqDr+Kg+Y7OqDODhZjvORqnNpOkWNUUnR26MsRY/x9vNO50="
- secure: "FJobmS7HNb2L95ZN0s81r/MpmM5kizgyoG6bUpgIaYhQMweJgLPinHOWB+54VAr7jkdDjN5b+4hHa1pcWNSWGLDgxMZxj9pPej7Aiq0wvFMlbzai3W+/FcNENHjd3sBTLNpWiBrpQNyUXP2/+2QWPMqCbUfiS90AkA5Du198pjE="
addons:
hostname: docker
hosts:
- docker
# For SauceLabs (DO NOT REMOVE)
sauce_connect:
tunnel_domains: docker
before_install:
- echo "Travis PR repo $TRAVIS_PULL_REQUEST_SLUG";
echo "Travis PR branch $TRAVIS_PULL_REQUEST_BRANCH";
echo "Travis target repo $TRAVIS_REPO_SLUG";
echo "Travis target branch $TRAVIS_BRANCH";
echo "Travis build number $TRAVIS_BUILD_NUMBER";
echo "Travis commit $TRAVIS_COMMIT";
- if [ -z "$SAUCE_ACCESS_KEY" ]; then echo "Sauce is not available"; else echo "Sauce is available."; fi
# Install Docker Engine
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- docker --version
# Install Docker Compose
- sudo rm /usr/local/bin/docker-compose
- sudo curl -L "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- docker-compose --version
- DCO="docker-compose -f docker-compose.yml -f docker/docker-compose.travis.yml"
# Install test tools
- pip install coveralls
- npm install -g codeceptjs-protractor protractor
- npm link protractor selenium-webdriver
- npm install pix-diff
# Ensure a clean environment
- $DCO kill
- $DCO rm -f
- docker volume list -q | xargs --no-run-if-empty docker volume rm -f
- mkdir -p cover
- chmod a+rwx cover
install:
- $DCO build
- $DCO up -d postgres elasticsearch rabbitmq
- $DCO up pgadmin
- if [ ! -z "$SAUCE_ACCESS_KEY" ]; then npm install -g protractor pix-diff; fi
- sudo cp scripts/accept.sh /usr/local/bin/accept
script:
- $DCO up django_volumes
- $DCO up -d nginx
- $DCO up django_volumes
# Wait for django container to come up
- while [[ "$(curl -skL -o /dev/null -w ''%{http_code}'' docker)" != "200" ]]; do (echo "Waiting for webserver ($(curl -skL -o /dev/null -w ''%{http_code}'' docker))"; sleep 5); done
- $DCO up django_volumes
- $DCO kill django
- $DCO run -e TRAVIS=$TRAVIS -e TRAVIS_BRANCH=$TRAVIS_BRANCH -e TRAVIS_JOB_ID=$TRAVIS_JOB_ID django --test
### Commenting out everything below because currently the e2e tests are not being run.
#- $DCO up -d django
# Use the docker selenium setup if running on a fork's PR because Sauce credentials aren't available
#- if [ -z "$SAUCE_ACCESS_KEY" ]; then $DCO up -d selenium; fi
# Wait for django container to come up
#- while [[ "$(curl -skL -o /dev/null -w ''%{http_code}'' docker)" != "200" ]]; do (echo "Waiting for webserver ($(curl -skL -o /dev/null -w ''%{http_code}'' docker))"; sleep 5); done
#- if [ -z "$SAUCE_ACCESS_KEY" ]; then
# echo "Sauce is not available";
# $DCO up protractor;
# else
# echo "Sauce is available";
# pushd mapstory/tests;
# SOURCE_HOME=/home/travis/build/MapStory/mapstory ./runAllTests.sh;
# popd;
# fi
#- echo "tests are done"
### Currently quay.io is pulling the repos automatically
# after_success:
# - if [ "$TRAVIS_BRANCH" == "master" ]; then
# docker login -u="$QUAY_USERNAME" -p="$QUAY_PASSWORD" quay.io;
# $DCO push;
# fi
after_script:
- $DCO kill
- $DCO rm -f
notifications:
slack: mapstory:E2W57xKNNOKDDqRmtQHNUlBK