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

Commit 5566ccc

Browse files
authored
Merge pull request #23 from taskcluster/fix-gimme
Fix for travis-ci/gimme#42
2 parents 100c711 + a973fdd commit 5566ccc

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

.travis.yml

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
language: go
22
sudo: false
33
go:
4-
- 1.5
4+
- 1.5
55
env:
6-
- "GIMME_OS=linux GIMME_ARCH=amd64"
7-
- "GIMME_OS=darwin GIMME_ARCH=amd64"
8-
- "GIMME_OS=windows GIMME_ARCH=amd64"
9-
- "GIMME_OS=windows GIMME_ARCH=386"
6+
- "MY_GOOS=linux MY_GOARCH=amd64"
7+
- "MY_GOOS=darwin MY_GOARCH=amd64"
8+
- "MY_GOOS=windows MY_GOARCH=amd64"
9+
- "MY_GOOS=windows MY_GOARCH=386"
1010
before_install:
11-
# workaround for travis-ci/gimme#25 to pick up latest version of gimme and run again
12-
- curl -o gimme -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
13-
- chmod u+x gimme
14-
- unset GOROOT GOTOOLDIR
15-
- eval "$(./gimme 1.5)"
16-
- go version
17-
- go env
11+
# workaround for travis-ci/gimme#42
12+
- curl -o go.tar.gz -sL https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz
13+
- tar -C $HOME -xf go.tar.gz
14+
- rm go.tar.gz
15+
- export GOROOT="${HOME}/go"
16+
- export PATH="${GOROOT}/bin:${PATH}"
17+
- export GOOS="${MY_GOOS}"
18+
- export GOARCH="${MY_GOARCH}"
1819
# end of workaround ###
19-
- go get github.com/axw/gocov/gocov
20-
- go get github.com/mattn/goveralls
21-
- go get golang.org/x/tools/cmd/cover
22-
- go get github.com/pierrre/gotestcover
20+
- go get github.com/axw/gocov/gocov
21+
- go get github.com/mattn/goveralls
22+
- go get golang.org/x/tools/cmd/cover
23+
- go get github.com/pierrre/gotestcover
2324
script:
2425
# need to test without gotestcover since error code is not reliable for gotestcover
25-
- "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || go test -v ./..."
26+
- "test $GOOS.$GOARCH != linux.amd64 || go test -v ./..."
2627
after_script:
2728
# using gotestcover means tests get run again, but need to do this since exit code of gotestcover is unreliable
28-
- "if test $GIMME_OS.$GIMME_ARCH = linux.amd64; ${GOPATH}/bin/gotestcover -v -coverprofile=coverage.report ./...; go tool cover -func=coverage.report; ${HOME}/gopath/bin/goveralls -coverprofile=coverage.report -service=travis-ci; fi"
29+
- "if test $GOOS.$GOARCH = linux.amd64; ${GOPATH}/bin/gotestcover -v -coverprofile=coverage.report ./...; go tool cover -func=coverage.report; ${HOME}/gopath/bin/goveralls -coverprofile=coverage.report -service=travis-ci; fi"
2930
notifications:
3031
irc:
3132
channels:

.travis_rename_releases.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# set an environment variable for its location that we can use in .travis.yml for
66
# publishing back to github.
77

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

1717
# linux, darwin:
1818
FILE_EXT=""
19-
[ "${GIMME_OS}" == "windows" ] && FILE_EXT=".exe"
19+
[ "${GOOS}" == "windows" ] && FILE_EXT=".exe"
2020

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

0 commit comments

Comments
 (0)