forked from newrelic/sidecar
-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
53 lines (42 loc) · 2.29 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
os: linux
language: go
go:
- 1.18.x
services:
- docker
env:
- GO111MODULE=on
before_install:
- nvm install node
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.1
script:
- go mod tidy && if [ ! -z "$( git status --porcelain go.mod go.sum )" ]; then exit 1; fi
- golangci-lint run
- go test -v --timeout 30s ./... && (CGO_ENABLED=0 GOOS=linux go build -ldflags '-d')
- if [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "${TRAVIS_GO_VERSION}" == "${PRODUCTION_GO_VERSION}"* ]]; then
echo "Building container gonitro/sidecar:${TRAVIS_COMMIT::7}" &&
cd ui && npm install && cd .. &&
docker build -f docker/Dockerfile -t sidecar . &&
docker tag sidecar gonitro/sidecar:${TRAVIS_COMMIT::7} &&
docker tag sidecar gonitro/sidecar:latest;
fi
after_success:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- echo "Building on Go version ${TRAVIS_GO_VERSION} for branch ${TRAVIS_BRANCH}"
- if [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "${TRAVIS_GO_VERSION}" == "${PRODUCTION_GO_VERSION}"* ]]; then
echo "Pushing container gonitro/sidecar:${TRAVIS_COMMIT::7}" &&
docker push gonitro/sidecar:${TRAVIS_COMMIT::7};
fi
- if [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "${TRAVIS_GO_VERSION}" == "${PRODUCTION_GO_VERSION}"* ]] && [ -z "${NO_PUSH_LATEST}" ]; then
docker push gonitro/sidecar:latest;
fi
deploy:
provider: releases
api_key:
secure: "LurQmR3FD+tWZ/x+EN/jLVcaqojpaeK5ALyuv1iTgmjkvF0z2qMuMU1gOivRNDMxfBVSlJFe14B1D03VizlKhm+Ee2ZBIkri32APVM/0bum2y9yQvHHQuRiXzuWu+ZgPNlse5/lMIIdMqe2yzRkLeXvdpytSwcJ8OMWW9KHXWdh4KgWS49L36ce8cpGHAj+lf7fZ7V9VVZKK56ZzZZ/ZaTh55RBkMTo5/uKDehSFZ9m9q6D9l5NjVe3tnUyYVLYhDkVEWxdu+40h56mWVPoAq2Wl9jFbZ5fdi9Q+OA7UsAevqleGqktBLZgc/xZ47RpwPEVRrPA2QvRJm4KcXhZsZS6aOqpWNwGYWXOQJ95uj7KIrT6xwZV7qCj7aKtge0YdkG/CIQn1NvJ7zriFjbr6YhkvMFE3ZzDjLpzZiNsdRYuNC9xNJXD8LTnEa6ih/KjEQdn8DGdgbJaNZGgH0KCJ0P4LkTbdCUfvJTPV4+pJBHDhUJAYNvqBUHgJ9VCmg72vUtSUibeJoqYOD3RwytEcMsXGPKT8FeI7XZ/a7khGPXSVdombyT9M2IPjCwBhnQJSb6NfCyy4aTkvgwXm218h2Rg5ESBQRADf3LL4p6l/S2COv34Jb72GLYTUU1QXoDZ2Ft5rueYYctuH8fBfWSbWIMi9xNznJctUauKcVGsJ3V4="
file: sidecar
skip_cleanup: true
on:
repo: Nitro/sidecar
tags: true
condition: ${TRAVIS_GO_VERSION} == ${PRODUCTION_GO_VERSION}*