This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from suzuki-shunsuke/build/fix-goreleaser
build: use gox and ghr instead of goreleaser
- Loading branch information
Showing
16 changed files
with
80 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cd `dirname $0`/.. || exit 1 | ||
echo "pwd: $PWD" || exit 1 | ||
|
||
source script/decho.sh || exit 1 | ||
|
||
decho gox -output="dist/${TAG}/graylog-mock-server_${TAG}_{{.OS}}_{{.Arch}}" -osarch="darwin/amd64 linux/amd64 windows/amd64" ./mockserver/exec || exit 1 | ||
decho gox -output="dist/${TAG}/terraform-provider-graylog_${TAG}_{{.OS}}_{{.Arch}}" -osarch="darwin/amd64 linux/amd64 windows/amd64" ./terraform || exit 1 | ||
ls dist/${TAG} | xargs -I {} gzip dist/${TAG}/{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
#!/usr/bin/env bash | ||
# https://github.com/codecov/example-go#caveat-multiple-files | ||
|
||
echo "" > coverage.txt | ||
cd `dirname $0`/.. || exit 1 | ||
echo "pwd: $PWD" || exit 1 | ||
|
||
source script/decho.sh || exit 1 | ||
|
||
echo "" > coverage.txt || exit 1 | ||
# ignore testutil from test coverage | ||
go test ./testutil | ||
decho go test ./testutil || exit 1 | ||
for d in $(go list ./... | grep -v vendor | grep -v terraform | grep -v testutil); do | ||
go test -race -coverprofile=profile.out -covermode=atomic $d | ||
decho go test -race -coverprofile=profile.out -covermode=atomic $d || exit 1 | ||
if [ -f profile.out ]; then | ||
cat profile.out >> coverage.txt | ||
rm profile.out | ||
cat profile.out >> coverage.txt || exit 1 | ||
rm profile.out || exit 1 | ||
fi | ||
done | ||
|
||
go test -v -race -coverprofile=profile.out -covermode=atomic ./terraform/... | ||
decho go test -v -race -coverprofile=profile.out -covermode=atomic ./terraform/... || exit 1 | ||
if [ -f profile.out ]; then | ||
cat profile.out >> coverage.txt | ||
rm profile.out | ||
cat profile.out >> coverage.txt || exit 1 | ||
rm profile.out || exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
mkdir -p coverage/$1 | ||
go test ./$1 -coverprofile=coverage/$1/coverage.txt -covermode=atomic | ||
go tool cover -html=coverage/$1/coverage.txt | ||
cd `dirname $0`/.. || exit 1 | ||
echo "pwd: $PWD" || exit 1 | ||
|
||
source script/decho.sh || exit 1 | ||
|
||
decho mkdir -p coverage/$1 || exit 1 | ||
decho go test ./$1 -coverprofile=coverage/$1/coverage.txt -covermode=atomic || exit 1 | ||
decho go tool cover -html=coverage/$1/coverage.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
decho() { | ||
echo "+ $@" | ||
eval $@ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
npm run metalint || exit 1 | ||
npm run golint || exit 1 | ||
cd `dirname $0`/.. || exit 1 | ||
echo "pwd: $PWD" || exit 1 | ||
|
||
source script/decho.sh || exit 1 | ||
|
||
decho npm run metalint || exit 1 | ||
decho npm run golint || exit 1 | ||
echo "+ staticcheck (failure is ignored)" | ||
staticcheck ./... || echo "staticcheck failure is ignored" | ||
decho staticcheck ./... || echo "staticcheck failure is ignored" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
set -e | ||
cd `dirname $0`/.. || exit 1 | ||
echo "pwd: $PWD" || exit 1 | ||
|
||
decho() { | ||
echo "+ $@" | ||
eval $@ | ||
} | ||
source script/decho.sh || exit 1 | ||
|
||
# gofmt | ||
echo "! git ls-files | grep \"\\.go$\" | xargs gofmt -s -d | grep '^'" | ||
! git ls-files | grep "\.go$" | xargs gofmt -s -d | grep '^' | ||
echo "! git ls-files | grep \"\\.go$\" | xargs gofmt -s -d | grep '^'" || exit 1 | ||
! git ls-files | grep "\.go$" | xargs gofmt -s -d | grep '^' || exit 1 | ||
# go vet | ||
decho go vet $(go list ./... | grep -v /vendor/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if [ -n "$TRAVIS_TAG" ]; then | ||
cd `dirname $0`/.. || exit 1 | ||
echo "pwd: $PWD" || exit 1 | ||
|
||
bash script/build.sh | ||
bash script/upload.sh | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cd `dirname $0`/.. || exit 1 | ||
echo "pwd: $PWD" || exit 1 | ||
|
||
source script/decho.sh || exit 1 | ||
|
||
decho ghr -u suzuki-shunsuke ${TAG} dist/${TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters