forked from puppetlabs-toy-chest/wash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (54 loc) · 2.5 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
language: go
go: stable
cache:
directories:
- $GOPATH/pkg/mod
services:
- docker
env:
global:
- PROJECT_NAME=wash
- WASH_DISABLE_ANALYTICS=true
- HUGO_VERSION=0.57.1
- GOLANGCI_LINT_VERSION=v1.19.1
jobs:
include:
- name: Test Go stable
- name: Test Docker plugin
before_script:
- go install
- docker pull busybox
- docker-compose -f examples/swarm/docker-compose.yml up -d
script:
- wash validate docker
- name: Lint with golangci-lint
before_script:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VERSION
script: GOGC=20 golangci-lint run -v --concurrency 1 --deadline 3m # https://github.com/golangci/golangci-lint/issues/337#issuecomment-510136513
- name: Test that website builds
install: curl -sfL https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz | tar -xzC $(go env GOPATH)/bin
script: hugo -s website
- stage: deploy
name: Deploy to GitHub Releases
if: tag IS present
env: LINKFLAGS="-w -s -X github.com/puppetlabs/wash/cmd/version.BuildVersion=${TRAVIS_TAG}" CGO_ENABLED=0
script:
- GOOS=darwin GOARCH=amd64 go build -ldflags="$LINKFLAGS"
- tar czf ${PROJECT_NAME}-${TRAVIS_TAG}-x86_64-apple-darwin.tgz wash
- GOOS=linux GOARCH=amd64 go build -ldflags="$LINKFLAGS"
- tar czf ${PROJECT_NAME}-${TRAVIS_TAG}-x86_64-unknown-linux.tgz wash
deploy:
provider: releases
api_key:
secure: PVefYvPRdpOtWvvZEG9wxv2HxjBUQ1/t1XsXQFOuF30/YzjY4EHaYBH/RXtFzuiCqpyk5GA1dWVUSE356Aka2Y3JlqImv1d0n+prrG2fEJBEtaDlR7Q6DeIiONPsCMxWyJ22r+bBz3C1Qq+QwSLzFuTN1XKIQTFdzIaqnIO7rthPNZNSfMmreed6SXfFmnsIcA+7TG+k4iDYz8COSDrYdjaiHnejvHlUiXh9Rfa3LzTdC4rxtOKofbUa9Qei08mSaSuRGD0U0vymOfFKf/QjNuwFmGSbdIH+1KmCOD9MV/47l6xZMDHDL4mLabsDB9ipf9LFAWmN9pQ/a5UoPyh4IXgaP7NeS3ISNlbKSCx7S70In8/whQv7jB8a5dNuo8HtKx0wzdQ9pKDBDt/N3h1YYJhGR2UF4JJd1CkBytRgIKzjZ5D7Ky+j23Vr6/+lvCRL0CN3RvvBP91/rfyO61eW4FGo+J/Es2u5+HPjVST4S4ntZnTDA6I2K1js8AbG1ofalivpcth4i+2zoKANXEjlXgUUI63gypBvyKGgHHouQTzKuyeIPBzlhYCIrQVhN5QG2+Lc9w7A2KqeRm0vxQ9elEKO1i5bSzSxYUXLMVSPkted0+gSPRRp4i67wOUO+1V9cLubbXm8PG1E1DhpiOQnxQb2DnaaVlL1mr3XQVDl6BY=
file_glob: true
file: ${PROJECT_NAME}-${TRAVIS_TAG}-*.tgz
skip_cleanup: true
on:
repo: puppetlabs/wash
tags: true
# TODO: Re-enable this step once we've got the container
# experience fleshed out.
# - name: Build Docker container
# install: skip
# script: docker build .