-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
executable file
·45 lines (45 loc) · 1.23 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
sudo: required
conditions: v1
language: go
services:
- docker
- mongodb
go:
- 1.10.x
env:
- DEBUG=1 TESTING=1
before_script:
- |
mongo ss --eval 'db.createUser({
user:"root",
pwd:"root",
roles:["readWrite"]
});'
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
jobs:
include:
# run unit tests
- stage: test
name: tests
script:
- go test -v -race ./server
# deploy only if on one of the main branches
# - master is the latest public/live/production version
# - staging is the next stable public/live/production version
# - develop is the rolling development release version
- stage: deploy-branch
name: deploy-branch
if: branch IN (master, staging, develop)
script:
- make static
- docker build -t temp .
- docker tag temp "southclaws/tw-warehouse:$TRAVIS_BRANCH"
- docker push "southclaws/tw-warehouse:$TRAVIS_BRANCH"
- stage: deploy-tag
name: deploy-tag
if: tag IS present
script:
- make static
- docker build -t temp .
- docker tag temp "southclaws/tw-warehouse:$TRAVIS_TAG"
- docker push "southclaws/tw-warehouse:$TRAVIS_TAG"