-
Notifications
You must be signed in to change notification settings - Fork 21
/
.travis.yml
67 lines (61 loc) · 2.03 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
language: go
services:
- docker
sudo: required
go:
- 1.11.x
before_install:
- . $HOME/.nvm/nvm.sh
- nvm install 8
- nvm use 8
- npm install -g yarn
stages:
- name: test
- name: staging
if: branch = master AND type = push
- name: release
if: tag IS present
- name: release-helm
if: tag IS present
jobs:
include:
- name: 'Tests'
stage: test
script:
- make validate-commit
- make lint
- make test-frontend
- make test-coverage
- name: 'Integration Tests'
stage: test
script:
- make packages
- ./build/bin/bblfsh-web &
- sleep 5 # give bblfsh-web some time to start
- curl 127.0.0.1:9999 | grep 'Babelfish Web'
- name: 'Release'
stage: release
script:
- make packages
- 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.11.x
- name: 'Deploy to staging'
stage: staging
script:
- make packages
- DOCKER_PUSH_MASTER=true make docker-push
#HELM_RELEASE name is also harcoded in the .helm_staging file in order to use the AntiAffinity Rules.
- HELM_RELEASE=play HELM_CHART=bblfsh-web K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/stable/ --version 1.1.1 --set image.tag=dev-$(git rev-parse --short HEAD) -f .helm_staging.yml" make deploy
- name: 'Deploy to production'
stage: release-helm
script:
#HELM_RELEASE name is also harcoded in the .helm_production file in order to use the AntiAffinity Rules.
- B64_CA_CRT=$B64_CA_CRT_PROD SERVICE_ACCOUNT_TOKEN=$SERVICE_ACCOUNT_TOKEN_PROD CLUSTER_ENDPOINT=$CLUSTER_ENDPOINT_PROD HELM_RELEASE=play HELM_CHART=bblfsh-web K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/stable/ --version 1.1.1 --set image.tag=$TRAVIS_TAG -f .helm_production.yml" make deploy