Skip to content

Add go modules #144

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

Merged
merged 5 commits into from
Sep 26, 2018
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
43 changes: 40 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
version: 2
jobs:
test:
test-install-golang-prev:
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/segmentio/chamber
steps:
- checkout
- run:
name: 'Test install golang (previous release)'
command: |
go get -v . && chamber version

test-install-golang-current:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/segmentio/chamber
steps:
- checkout
- run:
name: 'Test go get install on current golang release'
command: |
go get -v . && chamber version

# only need this job until 1.13 is released
test-install-golang-1.11-GOMODULE-on:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/segmentio/chamber
steps:
- checkout
- run:
name: 'Test go get install on golang 1.11 GO111MODULE=on'
command: |
GO111MODULE=on go get -v . && chamber version

test:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/segmentio/chamber
steps:
- checkout
- run:
Expand All @@ -13,7 +47,7 @@ jobs:

dist:
docker:
- image: circleci/golang:1.10
- image: circleci/golang:1.11
working_directory: /go/src/github.com/segmentio/chamber
steps:
- checkout
Expand All @@ -31,7 +65,7 @@ jobs:

publish:
docker:
- image: circleci/golang:1.10
- image: circleci/golang:1.11
working_directory: /go/src/github.com/segmentio/chamber
steps:
- checkout
Expand All @@ -56,6 +90,9 @@ workflows:
test-dist-publish:
jobs:
- test
- test-install-golang-prev
- test-install-golang-current
- test-install-golang-1.11-GOMODULE-on
- dist:
# needed to ensure dist happens on tag events
filters:
Expand Down
20 changes: 7 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
VERSION := $(shell git describe --tags --always --dirty="-dev")
LDFLAGS := -ldflags='-X "main.Version=$(VERSION)"'

test: | govendor
govendor sync
go test -v ./...
test:
GO111MODULE=on go test -v ./...

all: dist/chamber-$(VERSION)-darwin-amd64 dist/chamber-$(VERSION)-linux-amd64

Expand All @@ -19,15 +18,10 @@ clean:
dist/:
mkdir -p dist

dist/chamber-$(VERSION)-darwin-amd64: | govendor dist/
govendor sync
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o $@
dist/chamber-$(VERSION)-darwin-amd64: | dist/
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build $(LDFLAGS) -o $@

dist/chamber-$(VERSION)-linux-amd64: | govendor dist/
govendor sync
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o $@
dist/chamber-$(VERSION)-linux-amd64: | dist/
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build $(LDFLAGS) -o $@

govendor:
go get -u github.com/kardianos/govendor

.PHONY: clean all govendor
.PHONY: clean all
12 changes: 12 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/segmentio/chamber

require (
github.com/aws/aws-sdk-go v1.15.26
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/magiconair/properties v1.8.0
github.com/pkg/errors v0.8.0
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.2 // indirect
github.com/stretchr/testify v1.2.2
)
20 changes: 20 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
github.com/aws/aws-sdk-go v1.15.26 h1:p9fZ5yY1JnB3T0iLQQsLrFY70Pyfft6WcNANHtGOyYc=
github.com/aws/aws-sdk-go v1.15.26/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-ini/ini v1.25.4 h1:Mujh4R/dH6YL8bxuISne3xX2+qcQ9p0IxKAP6ExWoUo=
github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc=
github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=