-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
.travis.yml
134 lines (118 loc) · 4.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
dist: trusty
sudo: false
# We do not test pushes to branches, since they are redundant with the pull_request build
# for each branch. Take that, Big CI!
branches:
only:
- master
stages:
- name: test
- name: docker-deploy
if: branch = master AND type != pull_request
jobs:
include:
# Compile the application and run tests.
- stage: test
language: rust
rust: stable
cache: cargo
script:
- (cd proxy && cargo test --locked --no-default-features)
- language: go
# Quote the version number to avoid parsing issues like
# https://github.com/travis-ci/gimme/issues/132.
go: "1.10.1"
go_import_path: github.com/runconduit/conduit
cache:
directories:
- vendor
install:
- ./bin/dep ensure -vendor-only -v
- ./bin/dep status -v
script:
# TODO decide whether protoc should be committed or not. If so, we shouldn't do
# this or we should error if it dirties the repo.
- ./bin/protoc-go.sh
- go test -race -v ./...
- go vet ./...
- language: node_js
node_js:
- "8"
cache:
directories:
- web/app/node_modules
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2
- export PATH="$HOME/.yarn/bin:$PATH"
install:
- cd web/app && yarn && yarn webpack
script:
- yarn karma start --single-run --reporters dots
- language: generic
script:
- |
(
. bin/_tag.sh
for f in $( grep -lR --include=Dockerfile\* go-deps: . ) ; do
validate_go_deps_tag $f
done
)
# Push container images to Google Container Registry.
- stage: docker-deploy
language: generic
services:
- docker
cache:
directories:
- "$HOME/google-cloud-sdk/"
before_install:
- docker version
- |
# Install gcloud and kubectl.
dir="${CLOUDSDK_INSTALL_DIR:-${HOME}}/google-cloud-sdk"
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
if [ -d "$dir/bin" ]; then
. "$dir/path.bash.inc"
gcloud components update
else
rm -rf "$dir"
curl https://sdk.cloud.google.com | bash
. "$dir/path.bash.inc"
fi
gcloud components install kubectl
- |
# Configure gcloud with a service account.
openssl aes-256-cbc -K $encrypted_6af64675f81c_key -iv $encrypted_6af64675f81c_iv -in .gcp.json.enc -out .gcp.json -d
gcloud auth activate-service-account --key-file .gcp.json
gcloud config set core/project "$GCP_PROJECT"
gcloud config set compute/zone "$GCP_ZONE"
gcloud config set container/cluster "$GKE_CLUSTER"
- |
# Get a kubernetes context.
(. bin/_gcp.sh ; get_k8s_ctx "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER")
- gcloud version
- kubectl version --short
before_script:
- gcloud docker --authorize-only
- bin/docker-pull-deps
# Pulling master helps with docker build cache, but may fail if we're
# adding a new image to the mix.
- bin/docker-pull master || echo "docker pull failed" >&2
- |
export CONDUIT_TAG=$(. bin/_tag.sh ; clean_head_root_tag)
echo "CONDUIT_TAG=${CONDUIT_TAG}"
- export BUILD_DEBUG=1 DOCKER_TRACE=1
script:
# We re-run the tests here in *release* (--release) mode since the
# `test` stage only runs them in *debug* mode.
- bin/docker-build
after_success:
- bin/docker-push-deps
- bin/docker-push $CONDUIT_TAG
- bin/docker-retag-all $CONDUIT_TAG master && bin/docker-push master
- target/cli/linux/conduit install --conduit-version=$CONDUIT_TAG |tee conduit.yml
- kubectl -n conduit apply -f conduit.yml --prune --selector='conduit.io/control-plane-component'
notifications:
email:
on_success: never