forked from pressly/goose
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
41 lines (38 loc) · 1.26 KB
/
.gitlab-ci.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
stages:
- test
- build
- release
test:unit:
image: gcr.io/help-1272/golang:1.6
stage: test
script:
- mkdir -p /go/src/git.help.com/helpdotcom/goose
- cp -R $CI_PROJECT_DIR/* /go/src/git.help.com/helpdotcom/goose
- cd /go/src/git.help.com/helpdotcom/goose
- make clean
- make test
test:integration:
image: gcr.io/help-1272/node:release
stage: test
script:
- touch ~/.npmrc
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- npm install -g @helpdotcom/docker-runner
- docker login -u="_json_key" -p="$DOCKER_PASSWORD" gcr.io
- docker-runner -f compose/docker-compose.yml -e --no-pull
deploy_to_google_cloud:
image: gcr.io/help-1272/golang:1.6
stage: release
script:
- mkdir -p /go/src/git.help.com/goose
- cp -R $CI_PROJECT_DIR/* /go/src/git.help.com/goose
- cd /go/src/git.help.com/goose
- make clean
- make
- touch ~/google_cloud_storage_key.json
- echo ${GOOGLE_CLOUD_STORAGE_PASSWORD} > ~/google_cloud_storage_key.json
- gcloud auth activate-service-account --key-file ~/google_cloud_storage_key.json
- gsutil cp /go/src/git.help.com/goose/cmd/goose/goose gs://helpdotcom-binaries
- gsutil acl ch -u AllUsers:R gs://helpdotcom-binaries/goose
only:
- master