-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
72 lines (61 loc) · 1.71 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
language: bash
services:
- docker
addons:
apt:
packages:
- docker-ce
cache:
directories:
- $TRAVIS_BUILD_DIR/node_modules
env:
- DOCKER_COMPOSE_VERSION=1.23.2
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
- |
docker run \
-v $PWD:/app \
-w /app \
node:11-alpine \
yarn
- |
docker run \
-v $PWD:/app \
-w /app \
node:11-alpine \
yarn build
script:
- docker-compose -f docker-compose.yaml -p stemn-slackbot up -d
- docker ps
# Run the tests
- |
docker run \
-v $PWD:/app \
-w /app \
--env SLACK_BOT_ID=$SLACK_BOT_ID \
--env SLACK_BOT_TOKEN=$SLACK_BOT_TOKEN \
--env SLACK_USER_ID=$SLACK_USER_ID \
--env SLACK_USER_TOKEN=$SLACK_USER_TOKEN \
--env SLACK_PRIVATE_CHANNEL=$SLACK_PRIVATE_CHANNEL \
--env SLACK_PUBLIC_CHANNEL=$SLACK_PUBLIC_CHANNEL \
--env SLACK_PUBLIC_CHANNEL_FILE_ID=$SLACK_PUBLIC_CHANNEL_FILE_ID \
--env STEMN_SLACK_BOT_SERVER_HOST=http://api \
--env STEMN_SLACK_BOT_SERVER_PORT=3000 \
--env STEMN_SLACK_SIGNING_SECRET=$STEMN_SLACK_SIGNING_SECRET \
--name test \
--network stemn-slackbot_slack-backend \
node:11-alpine \
yarn test --maxWorkers=4 --coverage
# Upload test coverage
- |
docker run \
-v $PWD:/app \
-w /app \
--env CODECOV_TOKEN=$CODECOV_TOKEN \
--name test-coverage \
--network stemn-slackbot_slack-backend \
tomnlittle/node-jest:1.0 \
yarn codecov