forked from palantir/go-java-launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
52 lines (48 loc) · 2.2 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
machine:
environment:
GODIST: "go1.7.6.linux-amd64.tar.gz"
GOPATH: "$HOME/.go_workspace"
IMPORT_PATH: "github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
GO_PROJECT_SRC_PATH: "$GOPATH/src/$IMPORT_PATH"
post:
- mkdir -p download
- test -e "download/$GODIST" || wget -O "download/$GODIST" "https://storage.googleapis.com/golang/$GODIST"
# create custom Go distribution with packages built for darwin-amd64 if it is not present
- |
if [ ! -e "download/$GODIST-custom.tgz" ]; then
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "download/$GODIST" && \
sudo env GOOS=linux GOARCH=amd64 /usr/local/go/bin/go install std && \
sudo env GOOS=darwin GOARCH=amd64 /usr/local/go/bin/go install std && \
tar -C /usr/local -czf "download/$GODIST-custom.tgz" go
fi
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf "download/$GODIST-custom.tgz"
checkout:
post:
# ensure all tags are fetched and up-to-date
- git tag -l | xargs git tag -d && git fetch -t
dependencies:
override:
- mkdir -p "$GOPATH/src/$IMPORT_PATH"
- rsync -az --delete ./ "$GOPATH/src/$IMPORT_PATH/"
- cd "$GO_PROJECT_SRC_PATH" && ./godelw version
cache_directories:
- ~/.godel
- ~/download
test:
pre:
- go version
override:
- cd "$GO_PROJECT_SRC_PATH" && go install $(./godelw packages)
- mkdir -p "$CIRCLE_TEST_REPORTS/$CIRCLE_PROJECT_REPONAME"
- cd "$GO_PROJECT_SRC_PATH" && ./godelw verify --apply=false --junit-output="$CIRCLE_TEST_REPORTS/$CIRCLE_PROJECT_REPONAME/$CIRCLE_PROJECT_REPONAME-tests.xml"
- mkdir -p "$CIRCLE_TEST_REPORTS/$CIRCLE_PROJECT_REPONAME-integration"
- cd "$GO_PROJECT_SRC_PATH" && ./godelw test --tags=integration --junit-output="$CIRCLE_TEST_REPORTS/$CIRCLE_PROJECT_REPONAME/$CIRCLE_PROJECT_REPONAME-integration.xml"
- cd "$GO_PROJECT_SRC_PATH" && ./godelw dist
deployment:
release:
tag: /[0-9]+(\.[0-9]+)+(-rc[0-9]+)?/
owner: palantir
commands:
- cd "$GO_PROJECT_SRC_PATH" && ./godelw publish bintray --url https://api.bintray.com --subject palantir --repository releases --user "$BINTRAY_USERNAME" --password "$BINTRAY_PASSWORD" --publish --downloads-list