forked from blackducksoftware/synopsysctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
75 lines (59 loc) · 3.55 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
# use the latest ubuntu environment (18.04) available on travis
dist: xenial
language: go
# Only the last two Go releases are supported by the Go team with security
# updates. Any versions older than that should be considered deprecated.
# Don't bother testing with them. tip builds your code with the latest
# development version of Go. This can warn you that your code will break
# in the next version of Go. Don't worry! Later we declare that test runs
# are allowed to fail on Go tip.
go:
- "1.13"
services:
- docker
cache:
directories:
- $GOPATH/pkg/mod
# Skip the install step. Don't `go get` dependencies. Only build with the
# code in vendor/
install: true
# Only clone the most recent commit.
git:
depth: 1
before_install:
- export GOPROXY=https://proxy.golang.org
# [TODO (ybhutwala): replace scripts with either golangci-lint or use go fmt and go vet]
# - go install github.com/golangci/golangci-lint/cmd/golangci-lint
- hack/verify-gofmt.sh
- hack/verify-golint.sh
- hack/verify-govet.sh
# Download and install KinD
# - go get sigs.k8s.io/kind@v0.5.1
# It's possible to download and install KinD using curl, similar as for kubectl
# This is useful in cases when Go toolchain isn't available or you prefer running stable version
# Binaries for KinD are available on GitHub Releases: https://github.com/kubernetes-sigs/kind/releases
# - curl -Lo kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.5.1/kind-$(uname)-amd64" && chmod +x kind && sudo mv kind /usr/local/bin/
# Download and install kubectl
# - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download and install kubeval
# - wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz && tar xf kubeval-linux-amd64.tar.gz && sudo mv kubeval /usr/local/bin/
# set up env variables for polaris
# - pwd
# - touch gcp_service_acount_path_file.json
# - touch covery_license_path_file.xml
# - export NAMESPACE="onprem" && export POLARIS_VERSION="2019.11" && export GCP_SERVICE_ACCOUNT_PATH="/home/travis/gopath/src/github.com/blackducksoftware/synopsysctl/gcp_service_acount_path_file.json" && export POLARIS_LICENSE_PATH="/home/travis/gopath/src/github.com/blackducksoftware/synopsysctl/hack/polaris_platform_license_path.json" && export COVERITY_LICENSE_PATH="/home/travis/gopath/src/github.com/blackducksoftware/synopsysctl/covery_license_path_file.xml"
# build synopsysctl and move it into path
- cd cmd/synopsysctl && go build -v .
- sudo mv /home/travis/gopath/src/github.com/blackducksoftware/synopsysctl/cmd/synopsysctl/synopsysctl /usr/local/bin/
- which -a synopsysctl
jobs:
include:
- stage: build
script:
# - golangci-lint run
- cd /home/travis/gopath/src/github.com/blackducksoftware/synopsysctl/; go build -v ./cmd/... ./pkg/... && go test -v -race ./cmd/... ./pkg/...
# default stage name "test", can only 5 in parallel
# - script: /home/travis/gopath/src/github.com/blackducksoftware/synopsysctl/hack/test_synopsysctl_native.sh
# - script: /home/travis/gopath/src/github.com/blackducksoftware/synopsysctl/hack/create_k8s_cluster_and_run_synopsysctl.sh kindest/node:v1.16.2 kind-v1.16.2
# - script: /home/travis/gopath/src/github.com/blackducksoftware/synopsysctl/hack/create_k8s_cluster_and_run_synopsysctl.sh kindest/node:v1.15.3 kind-v1.15.3
# [TODO (ybhutwala)]: integrate kubeval (also conftest)