Skip to content

Commit

Permalink
Add Travis CI Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonstevens committed Jul 8, 2019
1 parent a568021 commit 83f529e
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 11 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: go
go:
- "1.12.x"
env:
global:
GOFLAGS=-mod=vendor
install:
- go get github.com/mitchellh/gox
script:
- make test
- make vet
- make bin VERSION=$TRAVIS_TAG
deploy:
provider: releases
api_key:
secure: "ud9Gao7CnnTQZ1j8vhUlQ0BeNdrFMUhEhfe6b72OQA7Jqc8xvNYFyzDmdkHU8efWUD4I+pP2vpOwULD7gHgHB+P5pZJVzaNdd+eaMpdtStYn/TjNe3e9NfDm2HEBjWWjxfWQTzMELYTJP7RiKHu+TsrVvMLX1/kkTIAvZ38VfAdyV8r6cvnOqGwWSHUuJLk76pPf54RsFDjwXjD4NS6k2NF8Ic0JgzblUxJD1r6fwRPqB7cp1CALi3YNNy3Ab416TjYF3Si285omvA8pr+G7J8k4M7a6WT7PncpMSKt7UEx1bc4B4doytD38YbDHNCi+kAvojG5/oYeQx+swY6Di6D2z2qiaXGGzwXkFEqd6sL1yuMS+h1bvgxdeqUHnYlM0Gg3kGZqby00+McE4KWpPFYlyMBPvf/TZcbeKd1EXk6SDdLf+C88MJYP1C8vM+vArqfnoK56nAY5jkqIfzwHTCzMnlLmOMgTQ1M/9z9EgT+HI9cm3C+A14TnK/Ca8iDFAYQapUStOaoepFPszJzdKOK/RrpSYjE1ZIw7roKzed8DtZtMY4QMglycs59kSfTw/rCMTNVjWE9gsFLQYUvX0re+85z8t6M7JkJKXICqKWiaMUaPdpcYKcoSeP5ueFiRq9i5iv5xaEf4mq2v9vKSwF1oPSbKUr0C66o04Jl3A8uw="
file: pkg/terraform-provider-cloudhealth_*
file_glob: true
skip_cleanup: true
on:
tags: true
matrix:
fast_finish: true
allow_failures:
- go: tip
9 changes: 6 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ default: build
build: fmtcheck
go install

bin: fmtcheck
@sh -c "'$(CURDIR)/scripts/build.sh'"

test: fmtcheck
go test -i $(TEST) || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) -v -timeout=30s -parallel=4
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

testacc: fmtcheck
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
Expand All @@ -33,6 +36,6 @@ errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"

vendor-status:
@dep status
@govendor status

.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status
.PHONY: build bin test testacc vet fmt fmtcheck errcheck vendor-status
4 changes: 0 additions & 4 deletions examples/aws-account/versions.tf

This file was deleted.

4 changes: 0 additions & 4 deletions examples/perspective/versions.tf

This file was deleted.

22 changes: 22 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

echo "==> Building..."

if [[ -v VERSION ]]; then
OUTPUT="pkg/{{.OS}}_{{.Arch}}/{{.Dir}}_${VERSION}"
else
OUTPUT="pkg/{{.OS}}_{{.Arch}}/{{.Dir}}"
fi
gox -os "freebsd darwin linux windows" -arch "386 amd64" -output "${OUTPUT}"

if [[ -v VERSION ]]; then
echo "==> Packaging"
PACKAGE="${PWD##*/}"
for PLATFORM in $(find ./pkg -mindepth 1 -maxdepth 1 -type d); do
OSARCH=$(basename ${PLATFORM})
echo "--> ${OSARCH}"
pushd $PLATFORM >/dev/null 2>&1
zip ../${PACKAGE}_${OSARCH}.zip ./*
popd >/dev/null 2>&1
done
fi

0 comments on commit 83f529e

Please sign in to comment.