mini-build.sh 715 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. cd "$(dirname "${0}")"
  3. say="espeak"
  4. umask 0022
  5. export VERSION="$(grep -F 'version = ' version.go | cut -d \" -f 2)"
  6. export GOBIN="$(go env GOPATH)/bin"
  7. "$(go env GOBIN)/go-bindata" -ignore=\\.DS_Store -prefix static static/... tpl/... \
  8. && go fmt \
  9. && go vet \
  10. && go test --short \
  11. && go build -ldflags "-s -w -X main.GitSHA1=$(git rev-parse --short HEAD)" -o ~/Sites/b/shaarligo.cgi \
  12. || { echo "Aua" 1>&2 && exit 1; }
  13. env GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.GitSHA1=$(git rev-parse --short HEAD)" -o "build/shaarligo-${VERSION}-Linux-x86_64.cgi" || { echo "Aua" 1>&2 && exit 1; }
  14. "${say}" "pack mas"
  15. ls -Al ~/Sites/b/shaarligo.cgi
  16. echo "http://$(hostname)/~$(whoami)/b/"