-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
72 lines (59 loc) · 1.5 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
dist: xenial
language: go
go:
- 1.12.x
stages:
- lint_test_package
env:
global:
- GO111MODULE=on
- DB_HOST="localhost"
- DB_PORT="5432"
- DB_USER="postgres"
- DB_PASS=""
- DB_NAME="hospital"
- PORT=8080
- HOST_ADDRESS="localhost"
- HOST_PROTOCOL="http"
- DB_MAX_OPEN_CONN="5"
- DB_MAX_IDLE_CONN="5"
- REQUEST_TIMEOUT_SECONDS="30"
- QUERY_INTERVAL_SECONDS="5"
- SLACK_URL="<slack_url>"
- APPLICATION_ID="haproxy12"
- POLLING_WAIT_SECONDS="5"
- MAX_EXPONENTIAL_WAIT="1000"
- DOCKER_ORG="gojekfarm"
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
- docker
jobs:
include:
- stage: lint_test_package
before_script:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint
script:
- golangci-lint run
- stage: lint_test_package
services:
- postgresql
addons:
postgresql: "10"
before_script:
- psql -c "create database ${DB_NAME};" -U ${DB_USER}
- go build
- ./hospital migrate
script:
- go test -v -race ./...
- stage: lint_test_package
services:
- docker
before-script:
- gzip -dc docker/busybox.tar.gz | docker load
script:
- commit=$(git rev-parse HEAD)
- docker build -t $DOCKER_ORG/hospital:$commit .
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push $DOCKER_ORG/hospital:$commit