Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #12 from taskcluster/fix-gimme
Browse files Browse the repository at this point in the history
  • Loading branch information
walac authored Aug 1, 2016
2 parents 4b6c3c4 + d509e48 commit 4645dcf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
28 changes: 15 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@ go:
- 1.5

env:
- "GIMME_OS=linux GIMME_ARCH=amd64"
- "GIMME_OS=darwin GIMME_ARCH=amd64"
- "GIMME_OS=windows GIMME_ARCH=amd64"
- "GIMME_OS=windows GIMME_ARCH=386"
- "MY_GOOS=linux MY_GOARCH=amd64"
- "MY_GOOS=darwin MY_GOARCH=amd64"
- "MY_GOOS=windows MY_GOARCH=amd64"
- "MY_GOOS=windows MY_GOARCH=386"

# workaround for travis-ci/gimme#25 to pick up latest version of gimme and run again
before_install:
- curl -o gimme -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
- chmod u+x gimme
- unset GOROOT GOTOOLDIR
- eval "$(./gimme 1.5)"
- go version
- go env
# workaround for travis-ci/gimme#42
- curl -o go.tar.gz -sL https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz
- tar -C $HOME -xf go.tar.gz
- rm go.tar.gz
- export GOROOT="${HOME}/go"
- export PATH="${GOROOT}/bin:${PATH}"
- export GOOS="${MY_GOOS}"
- export GOARCH="${MY_GOARCH}"
# end of workaround ###

install:
- go get -d -t ./...
- "if test $GIMME_OS.$GIMME_ARCH = linux.amd64; then npm install; fi"
- "if test $GOOS.$GOARCH = linux.amd64; then npm install; fi"

script:
- go install -v ./...
- "if test $GIMME_OS.$GIMME_ARCH = linux.amd64; then npm test; fi"
- "if test $GOOS.$GOARCH = linux.amd64; then npm test; fi"

notifications:
irc:
Expand Down
8 changes: 4 additions & 4 deletions .travis_rename_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# set an environment variable for its location that we can use in .travis.yml for
# publishing back to github.

# all cross-compiled binaries are in subdirectories: ${GOPATH}/bin/${GIMME_OS}_${GIMME_ARCH}/
# all cross-compiled binaries are in subdirectories: ${GOPATH}/bin/${GOOS}_${GOARCH}/
# linux 64 bit, not cross-compiled, breaks this rule and is in ${GOPATH}/bin
# therefore move it to match the convention of the others, to simplify subsequent steps
# note: we don't know what we built, so only move it if we happen to be linux amd64 travis job
Expand All @@ -16,10 +16,10 @@ fi

# linux, darwin:
FILE_EXT=""
[ "${GIMME_OS}" == "windows" ] && FILE_EXT=".exe"
[ "${GOOS}" == "windows" ] && FILE_EXT=".exe"

# let's rename the release file because it has a 1:1 mapping with what it is called on
# github releases, and therefore the name for each platform needs to be unique so that
# they don't overwrite each other. Set a variable that can be used in .travis.yml
export RELEASE_FILE="${TRAVIS_BUILD_DIR}/livelog-${GIMME_OS}-${GIMME_ARCH}${FILE_EXT}"
mv "${GOPATH}/bin/${GIMME_OS}_${GIMME_ARCH}/livelog${FILE_EXT}" "${RELEASE_FILE}"
export RELEASE_FILE="${TRAVIS_BUILD_DIR}/livelog-${GOOS}-${GOARCH}${FILE_EXT}"
mv "${GOPATH}/bin/${GOOS}_${GOARCH}/livelog${FILE_EXT}" "${RELEASE_FILE}"

0 comments on commit 4645dcf

Please sign in to comment.