-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy path.travis.yml
57 lines (53 loc) · 1.83 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
language: go
go:
- 1.9
before_install:
- . $HOME/.nvm/nvm.sh
- nvm install 8
- nvm use 8
- npm install -g yarn
stages:
- name: test-linters-build
- name: staging
if: branch = staging AND type = push
- name: release
if: tag IS present
- name: release-helm
if: tag IS present
jobs:
include:
- name: 'Tests and linters'
stage: test-linters-build
script:
- make lint-frontend
- make test-frontend
- make lint-backend
- make test
- make validate-commit
- name: 'Build'
stage: test-linters-build
script:
- make build-app
- name: 'Deploy to staging'
stage: staging
script:
# Do not allow for subsequents script steps to run in case previous one fails
- make build-app && VERSION=commit-${TRAVIS_COMMIT:0:7} make docker-push && HELM_RELEASE=code-annotation HELM_CHART=code-annotation K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/infra/ --version 0.1.0 --set image.tag=commit-${TRAVIS_COMMIT:0:7} -f .helm-staging.yml" make deploy
- name: 'Release'
stage: release
script:
- make build-app
- DOCKER_PUSH_LATEST=true make docker-push
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: build/*.tar.gz
skip_cleanup: true
on:
tags: true
go: 1.9.x
- name: 'Deploy to production'
stage: release-helm
script:
- B64_CA_CRT=$PRODUCTION_B64_CA_CRT SERVICE_ACCOUNT_TOKEN=$PRODUCTION_SERVICE_ACCOUNT_TOKEN CLUSTER_ENDPOINT=$PRODUCTION_CLUSTER_ENDPOINT HELM_RELEASE=code-annotation HELM_CHART=code-annotation K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/infra/ --version 0.1.0 --set image.tag=$TRAVIS_TAG -f .helm-production.yml" make deploy