Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use gödel to build and publish product #15

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.iml
*.ipr
*.iws
.idea/
build/
coverage.out
gotest.out

/build/
/dist/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016 Palantir Technologies, Inc.
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
19 changes: 0 additions & 19 deletions Makefile

This file was deleted.

55 changes: 27 additions & 28 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
machine:
post:
- mkdir -p download
- test -e download/$GODIST || wget -O download/$GODIST https://storage.googleapis.com/golang/$GODIST
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf download/$GODIST
environment:
GODIST: "go1.6.2.linux-amd64.tar.gz"
GODIST: "go1.7.3.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 that up-to-date tags are retrieved
- "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow"
- git fetch --tags --all --prune
# ensure all tags are fetched and up-to-date
- git tag -l | xargs git tag -d && git fetch -t

dependencies:
pre:
# build script
- go get -u -v golang.org/x/tools/go/gcimporter15
- go get -u -v github.com/kisielk/errcheck
- go get -u -v github.com/mitchellh/gox
- go get -u -v golang.org/x/tools/cmd/cover
- go get -u -v github.com/mattn/goveralls
- go get -u -v github.com/pierrre/gotestcover
- go get -u -v github.com/jstemmer/go-junit-report
- go get -u -v github.com/mdempsky/unconvert
- go get -u -v github.com/remyoudompheng/go-misc/deadcode
- go get -u -v github.com/gordonklaus/ineffassign
- go get -u -v github.com/opennota/check/cmd/varcheck
- go get -u -v github.com/golang/lint/golint
# code
- go get -u -v gopkg.in/yaml.v2
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:
- test -d "$GO_PROJECT_SRC_PATH" && cd "$GO_PROJECT_SRC_PATH" && make verify
- cp "$GO_PROJECT_SRC_PATH/coverage.out" .
- 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" && make build dist publish
- 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
37 changes: 0 additions & 37 deletions go-java-launcher/main_test.go

This file was deleted.

5 changes: 5 additions & 0 deletions godel/config/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
checks:
golint:
filters:
- value: "should have comment or be unexported"
- value: "or a comment on this block"
19 changes: 19 additions & 0 deletions godel/config/dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
products:
go-java-launcher:
build:
main-pkg: .
os-archs:
- os: darwin
arch: amd64
- os: linux
arch: amd64
dist:
dist-type:
type: bin
info:
omit-init-sh: true
script: |
set -euo pipefail
mkdir $DIST_DIR/service
mv $DIST_DIR/bin $DIST_DIR/service/bin
group-id: com.palantir.launching
5 changes: 5 additions & 0 deletions godel/config/exclude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
names:
- "\\..+"
- "vendor"
paths:
- "godel"
4 changes: 4 additions & 0 deletions godel/config/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
formatters:
gofmt:
args:
- "-s"
2 changes: 2 additions & 0 deletions godel/config/godel.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionURL=https://palantir.bintray.com/releases/com/palantir/godel/godel/0.11.0/godel-0.11.0.tgz
distributionSHA256=ee8e571e2153b02673192ee5a6f2786ecc7ee73cecd1a4b7527be6cb751ac5fc
Empty file added godel/config/imports.yml
Empty file.
14 changes: 14 additions & 0 deletions godel/config/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
header: |
// Copyright 2016 Palantir Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
4 changes: 4 additions & 0 deletions godel/config/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tags:
integration:
names:
- "^integration_test$"
Loading