Skip to content

Commit 32b190e

Browse files
nmiyakeuschi2000
authored andcommitted
Use gödel to build and publish product (#15)
1 parent 6b64746 commit 32b190e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+15627
-680
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*.iml
2+
*.ipr
3+
*.iws
24
.idea/
3-
build/
4-
coverage.out
5-
gotest.out
6-
5+
/build/
6+
/dist/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2016 Palantir Technologies, Inc.
189+
Copyright {yyyy} {name of copyright owner}
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

Makefile

Lines changed: 0 additions & 19 deletions
This file was deleted.

circle.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,52 @@
11
machine:
2-
post:
3-
- mkdir -p download
4-
- test -e download/$GODIST || wget -O download/$GODIST https://storage.googleapis.com/golang/$GODIST
5-
- sudo rm -rf /usr/local/go
6-
- sudo tar -C /usr/local -xzf download/$GODIST
72
environment:
8-
GODIST: "go1.6.2.linux-amd64.tar.gz"
3+
GODIST: "go1.7.3.linux-amd64.tar.gz"
94
GOPATH: "$HOME/.go_workspace"
105
IMPORT_PATH: "github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
116
GO_PROJECT_SRC_PATH: "$GOPATH/src/$IMPORT_PATH"
7+
post:
8+
- mkdir -p download
9+
- test -e "download/$GODIST" || wget -O "download/$GODIST" "https://storage.googleapis.com/golang/$GODIST"
10+
# create custom Go distribution with packages built for darwin-amd64 if it is not present
11+
- |
12+
if [ ! -e "download/$GODIST-custom.tgz" ]; then
13+
sudo rm -rf /usr/local/go && \
14+
sudo tar -C /usr/local -xzf "download/$GODIST" && \
15+
sudo env GOOS=linux GOARCH=amd64 /usr/local/go/bin/go install std && \
16+
sudo env GOOS=darwin GOARCH=amd64 /usr/local/go/bin/go install std && \
17+
tar -C /usr/local -czf "download/$GODIST-custom.tgz" go
18+
fi
19+
- sudo rm -rf /usr/local/go
20+
- sudo tar -C /usr/local -xzf "download/$GODIST-custom.tgz"
1221

1322
checkout:
1423
post:
15-
# ensure that up-to-date tags are retrieved
16-
- "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow"
17-
- git fetch --tags --all --prune
24+
# ensure all tags are fetched and up-to-date
25+
- git tag -l | xargs git tag -d && git fetch -t
1826

1927
dependencies:
20-
pre:
21-
# build script
22-
- go get -u -v golang.org/x/tools/go/gcimporter15
23-
- go get -u -v github.com/kisielk/errcheck
24-
- go get -u -v github.com/mitchellh/gox
25-
- go get -u -v golang.org/x/tools/cmd/cover
26-
- go get -u -v github.com/mattn/goveralls
27-
- go get -u -v github.com/pierrre/gotestcover
28-
- go get -u -v github.com/jstemmer/go-junit-report
29-
- go get -u -v github.com/mdempsky/unconvert
30-
- go get -u -v github.com/remyoudompheng/go-misc/deadcode
31-
- go get -u -v github.com/gordonklaus/ineffassign
32-
- go get -u -v github.com/opennota/check/cmd/varcheck
33-
- go get -u -v github.com/golang/lint/golint
34-
# code
35-
- go get -u -v gopkg.in/yaml.v2
3628
override:
3729
- mkdir -p "$GOPATH/src/$IMPORT_PATH"
3830
- rsync -az --delete ./ "$GOPATH/src/$IMPORT_PATH/"
31+
- cd "$GO_PROJECT_SRC_PATH" && ./godelw version
3932
cache_directories:
33+
- ~/.godel
4034
- ~/download
4135

4236
test:
4337
pre:
4438
- go version
4539
override:
46-
- test -d "$GO_PROJECT_SRC_PATH" && cd "$GO_PROJECT_SRC_PATH" && make verify
47-
- cp "$GO_PROJECT_SRC_PATH/coverage.out" .
40+
- cd "$GO_PROJECT_SRC_PATH" && go install $(./godelw packages)
41+
- mkdir -p "$CIRCLE_TEST_REPORTS/$CIRCLE_PROJECT_REPONAME"
42+
- cd "$GO_PROJECT_SRC_PATH" && ./godelw verify --apply=false --junit-output="$CIRCLE_TEST_REPORTS/$CIRCLE_PROJECT_REPONAME/$CIRCLE_PROJECT_REPONAME-tests.xml"
43+
- mkdir -p "$CIRCLE_TEST_REPORTS/$CIRCLE_PROJECT_REPONAME-integration"
44+
- cd "$GO_PROJECT_SRC_PATH" && ./godelw test --tags=integration --junit-output="$CIRCLE_TEST_REPORTS/$CIRCLE_PROJECT_REPONAME/$CIRCLE_PROJECT_REPONAME-integration.xml"
45+
- cd "$GO_PROJECT_SRC_PATH" && ./godelw dist
4846

4947
deployment:
5048
release:
5149
tag: /[0-9]+(\.[0-9]+)+(-rc[0-9]+)?/
50+
owner: palantir
5251
commands:
53-
- cd "$GO_PROJECT_SRC_PATH" && make build dist publish
52+
- 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

go-java-launcher/main_test.go

Lines changed: 0 additions & 37 deletions
This file was deleted.

godel/config/check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
checks:
2+
golint:
3+
filters:
4+
- value: "should have comment or be unexported"
5+
- value: "or a comment on this block"

godel/config/dist.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
products:
2+
go-java-launcher:
3+
build:
4+
main-pkg: .
5+
os-archs:
6+
- os: darwin
7+
arch: amd64
8+
- os: linux
9+
arch: amd64
10+
dist:
11+
dist-type:
12+
type: bin
13+
info:
14+
omit-init-sh: true
15+
script: |
16+
set -euo pipefail
17+
mkdir $DIST_DIR/service
18+
mv $DIST_DIR/bin $DIST_DIR/service/bin
19+
group-id: com.palantir.launching

godel/config/exclude.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
names:
2+
- "\\..+"
3+
- "vendor"
4+
paths:
5+
- "godel"

godel/config/format.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
formatters:
2+
gofmt:
3+
args:
4+
- "-s"

godel/config/godel.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
distributionURL=https://palantir.bintray.com/releases/com/palantir/godel/godel/0.11.0/godel-0.11.0.tgz
2+
distributionSHA256=ee8e571e2153b02673192ee5a6f2786ecc7ee73cecd1a4b7527be6cb751ac5fc

0 commit comments

Comments
 (0)