forked from haydenwoodhead/burner.kiwi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
92 lines (84 loc) · 2.69 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
language: go
go:
- "1.12"
# skip install to grab dependencies
install: true
env:
- GO111MODULE=on
# grab dynamodb local, gometalinter, minify and packr
before_script:
- go mod download
- go install github.com/golangci/golangci-lint/cmd/golangci-lint
- go install github.com/tdewolff/minify/cmd/minify
- go install github.com/gobuffalo/packr/packr
- go install golang.org/x/tools/cmd/cover
- go install github.com/mattn/goveralls
script:
- make lint
- make test
- go test -covermode=count -coverprofile=profile.cov ./...
# remove testsuite.go coverage results from profile.cov -- seen as coveralls doesn't have a convenient way to do it
- sed -i '/testsuite.go/d' ./profile.cov
- goveralls -service=travis-ci -coverprofile=profile.cov || echo "Push to coveralls failed"
cache:
directories:
- $GOPATH/pkg/mod
after_success:
- make build
- make prepare-aws
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
deploy:
# Deploy to ap-southeast-2 cloudformation bucket
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
bucket: burner-kiwi-ap-southeast-2
region: ap-southeast-2
local_dir: build/cloudformation
# Deploy to eu-west-1 cloudformation bucket
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
bucket: burner-kiwi-eu-west-1
region: eu-west-1
local_dir: build/cloudformation
# Deploy to us-east-1 cloudformation bucket
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
bucket: burner-kiwi-us-east-1
region: us-east-1
local_dir: build/cloudformation
# Deploy static assets
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
bucket: static.burner.kiwi
region: ap-southeast-2
local_dir: build/static
# Deploy about.burner.kiwi assets
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
bucket: about.burner.kiwi
region: ap-southeast-2
local_dir: about.burner.kiwi
# Deploy to lambda removed -- due to misuse
# Deploy to dev specific branch
# Deploy static assets to dev s3
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
bucket: dev-static.burner.kiwi
region: ap-southeast-2
local_dir: build/static
on:
branch: dev
- provider: script
script: TAG=release-$(git rev-parse --short HEAD) make image-and-push && TAG=latest make image-and-push