forked from Azure/packer-azure
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
43 lines (36 loc) · 1.56 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
sudo: false
language: go
go:
- 1.5
- 1.6
env:
- GO15VENDOREXPERIMENT=1
before_install:
- go get github.com/axw/gocov/gocov
- go get github.com/matm/gocov-html
script:
- test -z "$(go fmt ./packer/... | tee /dev/stderr)"
- go build -v ./packer/...
- test -z "$(go vet ./packer/... | tee /dev/stderr)"
- gocov test ./packer/... > coverage.json
- if [[ "x$COVERAGE_HTML_URL" != "x" ]]; then gocov-html coverage.json > coverage.html; fi
- if [[ "x$COVERAGE_HTML_URL" != "x" ]]; then ruby ./coverage.rb; fi
- if [[ "x$COVERAGE_HTML_URL" != "x" ]]; then curl $COVERAGE_HTML_URL --upload-file coverage.html -H "x-ms-blob-type:BlockBlob" -H "Content-Type:text/html"; fi
- if [[ "x$COVERAGE_SVG_URL" != "x" ]]; then curl $COVERAGE_SVG_URL --upload-file coverage.svg -H "x-ms-blob-type:BlockBlob" -H "Content-Type:image/svg+xml"; fi
before_deploy:
- go get github.com/mitchellh/gox
- gox -os="windows linux darwin" -arch="amd64" -build-toolchain
- gox -arch="amd64" -os="windows linux darwin" -output "dist/{{.OS}}-{{.Arch}}/{{.Dir}}" ./packer/...
- zip -j packer-azure-windows-amd64-${TRAVIS_TAG}.zip ./dist/windows-amd64/*
- tar -cvzf packer-azure-linux-amd64-${TRAVIS_TAG}.tar.gz -C dist/linux-amd64/ .
- tar -cvzf packer-azure-darwin-amd64-${TRAVIS_TAG}.tar.gz -C dist/darwin-amd64/ .
deploy:
provider: releases
api_key: ${GITHUB_TOKEN}
file:
- packer-azure-windows-amd64-${TRAVIS_TAG}.zip
- packer-azure-linux-amd64-${TRAVIS_TAG}.tar.gz
- packer-azure-darwin-amd64-${TRAVIS_TAG}.tar.gz
on:
tags: true
go: 1.5