-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
60 lines (55 loc) · 1.93 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
language: go
go:
- 1.12.x
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
services:
- docker
- postgresql
env:
- GO111MODULE=on LINT_VER=v1.17.1 KIND_VER=v0.3.0
jobs:
include:
- stage: lint
install: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin $LINT_VER
script: make lint
- stage: unit and integration tests
before_script:
- psql -c "CREATE DATABASE papi_db;" -U postgres
- psql -c "CREATE USER papi_user WITH PASSWORD 'p4p1_p455';" -U postgres
script:
- make test.unit
- make test.integration
- stage: build and push docker test image
before_script: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
script:
- make docker.build
- make docker.push
- stage: e2e tests (k8s)
install:
- curl -Lo $HOME/bin/kind https://github.com/kubernetes-sigs/kind/releases/download/$KIND_VER/kind-linux-amd64
- chmod +x $HOME/bin/kind
- kind version
- curl -Lo $HOME/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
- chmod +x $HOME/bin/kubectl
- kubectl version --client --short
script: make test.e2e.k8s
- stage: e2e tests (AWS)
if: branch = master
script:
- make build
- make terraform.chkfmt
- make terraform.init
- make terraform.keygen
- make terraform.validate
- make terraform.apply
- make test.e2e
- make terraform.destroy
- stage: push to Docker Hub
if: tag IS present
before_script: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
script:
- docker build -t $DOCKER_REPO:$TRAVIS_TAG .
- docker push $DOCKER_REPO