Skip to content

Instantly share code, notes, and snippets.

@saml
Created April 5, 2016 17:17
Show Gist options
  • Save saml/dc2705e7b1c14d81675ee69457cc1cd4 to your computer and use it in GitHub Desktop.
Save saml/dc2705e7b1c14d81675ee69457cc1cd4 to your computer and use it in GitHub Desktop.
#!/bin/bash
version="${VERSION:-$(git describe --tags --abbrev=0)}"
revision="${REVISION:-$(git rev-parse HEAD)}"
builddate="$(date)"
wgo restore &&
wgo test ./ &&
wgo build -ldflags "-X \"main.appVersion=$version\" -X \"main.appRevision=$revision\" -X \"main.appBuildDate=$builddate\""
machine:
environment:
IMPORT_PATH: "github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
checkout:
post:
- mkdir -p "${GOPATH%%:*}/src/$IMPORT_PATH"
- rsync -avz --delete ./ "${GOPATH%%:*}/src/$IMPORT_PATH/"
dependencies:
override:
- go get -v github.com/skelterjohn/wgo
test:
override:
- ./build.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment