forked from google/keytransparency
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
74 lines (70 loc) · 2.85 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
version: ~> 1.0
language: go
go:
- "1.14.x"
dist: bionic
go_import_path: github.com/google/keytransparency
services:
- docker
- mysql
cache:
directories:
- "$HOME/gcloud/"
- "$HOME/gopath/pkg/mod"
env:
global:
- PATH=$PATH:${HOME}/google-cloud-sdk/bin
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
- GO111MODULE=on
jobs:
include:
- name: "lint"
install: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.26.0
script: golangci-lint run --deadline=7m
- name: "coverage"
script:
- go test ./... -v -coverprofile=coverage1.txt
- go test ./impl/integration/ -v -coverprofile=coverage2.txt -coverpkg=./...
after_success: bash <(curl -s https://codecov.io/bash)
- name: "race"
script:
- go test -race ./... -v
- name: "docker-compose test"
install:
- docker swarm init
- docker node ls
script: ./scripts/docker-compose_test.sh
- name: "kubernetes test"
install:
- curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.16.3/bin/linux/amd64/kubectl" && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- curl -s -O -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.5.4/kustomize_v3.5.4_linux_amd64.tar.gz && tar xzf ./kustomize_v3.5.4_linux_amd64.tar.gz && sudo mv kustomize /usr/local/bin/
- go get sigs.k8s.io/[email protected]
- kind create cluster --config deploy/kubernetes/kind-config.yaml
- kubectl cluster-info --context kind-kind
- kubectl version
script: ./scripts/kubernetes_test.sh
- stage: deploy
if: branch = master AND type != pull_request
install:
- curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.16.3/bin/linux/amd64/kubectl" && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- curl -s -O -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.5.4/kustomize_v3.5.4_linux_amd64.tar.gz && tar xzf ./kustomize_v3.5.4_linux_amd64.tar.gz && sudo mv kustomize /usr/local/bin/
- openssl aes-256-cbc -K $encrypted_555d9b2948d2_key -iv $encrypted_555d9b2948d2_iv -in client_secret.json.enc -d | gcloud auth activate-service-account --key-file /dev/stdin
script:
- ./scripts/deploy.sh
- ./scripts/cleanup_images.sh
before_install:
- |
if [ ! -d $HOME/gcloud/google-cloud-sdk ]; then
mkdir -p $HOME/gcloud
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz --directory-prefix=$HOME/gcloud
cd $HOME/gcloud
tar xzf google-cloud-sdk.tar.gz;
./google-cloud-sdk/install.sh -q;
cd $TRAVIS_BUILD_DIR
fi
- source "$HOME/gcloud/google-cloud-sdk/path.bash.inc"
- gcloud -q components update
- gcloud -q version
- wget --version
- docker --version
- docker-compose --version