/
config.yml
112 lines (109 loc) 路 3.49 KB
/
config.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
version: 2
jobs:
lint:
working_directory: ~/reviewdog
docker:
- image: circleci/golang:1.13
steps:
- checkout
- run:
name: System information
command: 'echo "Golang $(go version)"'
- run: 'curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b $(go env GOPATH)/bin'
- run: '( cd linters && go get golang.org/x/lint/golint )'
- run:
command: |-
set +o pipefail
golint ./... | reviewdog -f=golint -name=golint-circleci -reporter=github-pr-review
test:
working_directory: ~/reviewdog
docker:
- image: circleci/golang:1.13
steps:
- checkout
- run: 'go test -v ./...'
release:
docker:
- image: circleci/golang:1.13
steps:
- checkout
- run: curl -sL https://git.io/goreleaser | bash
deploy:
working_directory: ~/reviewdog/doghouse/appengine/
docker:
- image: gcr.io/gcpug-container/appengine-go:1.11-slim
environment:
GAE_DEPLOY_ACCOUNT: review-dog@appspot.gserviceaccount.com
GAE_DEPLOY_PROJECT: review-dog
GAE_KEYRING_NAME: reviewdog-doghouse-deploy
GAE_KEY_NAME: secret-env
steps:
- checkout:
path: ~/reviewdog
- run:
name: System information
command: 'echo "Golang $(go version)"'
- run:
name: gcloud command information
command: 'gcloud version'
- run:
name: Activate Service Account
command: |-
echo $GAE_DEPLOY_KEY_FILE > service_account_key.json
gcloud auth activate-service-account "$GAE_DEPLOY_ACCOUNT" --key-file=service_account_key.json --project "$GAE_DEPLOY_PROJECT"
- run:
name: Decrypt keys
command: |-
gcloud kms decrypt --location=global \
--keyring="$GAE_KEYRING_NAME" \
--key="$GAE_KEY_NAME" \
--ciphertext-file=secret/encrypted-reviewdog.private-key.pem.bin \
--plaintext-file=secret/reviewdog.private-key.pem
gcloud kms decrypt --location=global \
--keyring="$GAE_KEYRING_NAME" \
--key="$GAE_KEY_NAME" \
--ciphertext-file=secret/encrypted-secret.yaml.bin \
--plaintext-file=secret/secret.yaml
- run:
name: Deploy
command: |-
# Remove files which contains multibyte characters to avoid gcloud error...
rm -rf ../../diff/testdata/
gcloud --quiet --project $GAE_DEPLOY_PROJECT app deploy app.yaml
- run:
name: Cleanup
command: |-
rm service_account_key.json
rm secret/reviewdog.private-key.pem
rm secret/secret.yaml
workflows:
version: 2
lint_test_deploy:
jobs:
- lint:
filters: # required since `release` has tag filters AND requires `lint`
tags:
only: /.*/
- test:
filters: # required since `release` has tag filters AND requires `test`
tags:
only: /.*/
- release:
requires:
- lint
- test
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
- deploy:
requires:
- lint
- test
filters:
branches:
only: master
notify:
webhooks:
- url: https://webhooks.gitter.im/e/1285d150756c4cbf4795