Run commands in Make on wercker

This commit is contained in:
Iwasaki Yudai 2015-10-12 11:57:14 +09:00
parent c8fb306521
commit a9d26bec2c
4 changed files with 48 additions and 19 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
gotty gotty
bindata bindata
builds

2
Godeps/Godeps.json generated
View File

@ -1,6 +1,6 @@
{ {
"ImportPath": "github.com/yudai/gotty", "ImportPath": "github.com/yudai/gotty",
"GoVersion": "go1.5", "GoVersion": "go1.5.1",
"Deps": [ "Deps": [
{ {
"ImportPath": "github.com/braintree/manners", "ImportPath": "github.com/braintree/manners",

View File

@ -1,3 +1,5 @@
OUTPUT_DIR = ./builds
gotty: app/resource.go main.go app/*.go gotty: app/resource.go main.go app/*.go
go build go build
@ -28,3 +30,24 @@ bindata/static/js/hterm.js: bindata/static/js libapps/hterm/js/*.js
bindata/static/js/gotty.js: bindata/static/js resources/gotty.js bindata/static/js/gotty.js: bindata/static/js resources/gotty.js
cp resources/gotty.js bindata/static/js/gotty.js cp resources/gotty.js bindata/static/js/gotty.js
tools:
go get github.com/tools/godep
go get github.com/mitchellh/gox
go get github.com/tcnksm/ghr
deps:
godep restore
test:
if [ `go fmt ./... | wc -l` -gt 0 ]; then echo "go fmt error"; exit 1; fi
cross_compile:
GOARM=5 gox -os="darwin linux freebsd netbsd openbsd" -arch="386 amd64 arm" -output "${OUTPUT_DIR}/pkg/{{.OS}}_{{.Arch}}/{{.Dir}}"
targz:
mkdir -p ${OUTPUT_DIR}/dist
cd ${OUTPUT_DIR}/pkg/; for osarch in *; do (cd $$osarch; tar zcvf ../../dist/gotty_$$osarch.tar.gz ./*); done;
release:
ghr --delete --prerelease -u yudai -r gotty pre-release ${OUTPUT_DIR}/dist

View File

@ -1,27 +1,32 @@
box: tcnksm/gox box: golang:1.5.1
build: build:
steps: steps:
- setup-go-workspace - setup-go-workspace
- script: - script:
name: go get name: tools
code: | code: make tools
go get github.com/tools/godep
godep restore
- script: - script:
name: check format name: deps
code: | code: make deps
if [ `go fmt ./... | wc -l` -gt 0 ]; then echo "go fmt error"; exit 1; fi - script:
- tcnksm/gox: name: test
os: "darwin linux freebsd netbsd openbsd" code: make test
arch: "386 amd64 arm" - script:
- yudai/targz: name: cross compile
input: $WERCKER_OUTPUT_DIR/pkg code: make cross_compile OUTPUT_DIR=$WERCKER_OUTPUT_DIR
output: $WERCKER_OUTPUT_DIR/dist - script:
name: targz
code: make targz OUTPUT_DIR=$WERCKER_OUTPUT_DIR
- script:
name: store Makefile
code: cp Makefile $WERCKER_OUTPUT_DIR/
deploy: deploy:
steps: steps:
- tcnksm/ghr: - script:
token: $GITHUB_TOKEN name: tools
input: dist code: make tools
replace: true - script:
name: release
code: make release OUTPUT_DIR=.