Skip to content

Commit

Permalink
all: update to use Go modules
Browse files Browse the repository at this point in the history
  • Loading branch information
andybons-stripe committed Dec 18, 2020
1 parent 1e0a0ce commit 1c3f5f1
Show file tree
Hide file tree
Showing 1,697 changed files with 273,237 additions and 143,576 deletions.
40 changes: 13 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ version: 2.1
executors:
"previous":
docker:
- image: golang:1.12
- image: golang:1.14
"stable":
docker:
- image: golang:1.13
- image: golang:1.15

commands:
install:
Expand Down Expand Up @@ -43,44 +43,26 @@ commands:
name: protoc-gen-gogofaster
command: |
if ! [ -x $GOPATH/bin/protoc-gen-gogofaster ] ; then
go get -d -v github.com/gogo/protobuf/protoc-gen-gogofaster
cd $GOPATH/src/github.com/gogo/protobuf
git fetch
git reset --hard <<parameters.protoc_gen_gogofaster_tag>>
go install github.com/gogo/protobuf/protoc-gen-gogofaster
go get -u -v github.com/gogo/protobuf/protoc-gen-gogofaster@<<parameters.protoc_gen_gogofaster_tag>>
fi
- run:
name: gojson
command: |
if ! [ -x $GOPATH/bin/gojson ] ; then
go get -d -u github.com/ChimeraCoder/gojson/gojson
cd $GOPATH/src/github.com/ChimeraCoder/gojson
git fetch
git reset --hard <<parameters.gojson_tag>>
go install github.com/ChimeraCoder/gojson/gojson
fi
- run:
name: dep
command: |
if ! [ -x $GOPATH/bin/dep ] ; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
go get -u -v github.com/ChimeraCoder/gojson/gojson@<<parameters.gojson_tag>>
fi
- run:
name: stringer
command: |
if ! [ -x $GOPATH/bin/stringer ] ; then
go get -u -u golang.org/x/tools/cmd/stringer
cd $GOPATH/src/golang.org/x/tools/cmd/stringer
git reset --hard <<parameters.stringer_rev>>
go install
go get -u -v golang.org/x/tools/cmd/stringer
fi
- save_cache:
<<: *prereq_cache_key
paths:
- /opt/protoc
- /go/bin/protoc-gen-gogofaster
- /go/src/github.com/gogo/protobuf
- /go/bin/dep
- /go/pkg/mod/github.com/gogo/protobuf@<<parameters.protoc_gen_gogofaster_tag>>
- /go/bin/stringer
fetch_and_build_latest_go:
description: "Builds the latest version of go from source"
Expand Down Expand Up @@ -162,14 +144,18 @@ jobs:
executor:
name: stable
working_directory: /go/src/github.com/stripe/veneur
environment:
GO111MODULE: "on"
steps:
- checkout
- test
- checkout
- test

test_previous:
executor:
name: previous
working_directory: /go/src/github.com/stripe/veneur
environment:
GO111MODULE: "on"
steps:
- checkout
- test
Expand All @@ -179,7 +165,7 @@ jobs:
- image: golang:latest
working_directory: /go/src/github.com/stripe/veneur
environment:
GO111MODULE: auto
GO111MODULE: "on"
steps:
- fetch_and_build_latest_go
- checkout
Expand Down
26 changes: 8 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
# For running Veneur under Docker, you probably want either the pre-built images
# published at https://hub.docker.com/r/stripe/veneur/
# or the Dockerfiles in https://github.com/stripe/veneur/tree/master/public-docker-images
FROM golang:1.14
MAINTAINER The Stripe Observability Team <[email protected]>
FROM golang:1.15
LABEL maintainer="The Stripe Observability Team <[email protected]>"

RUN mkdir -p /build
ENV GOPATH=/go
ENV GO111MODULE=on
RUN apt-get update
RUN apt-get install -y zip
RUN go get -u -v github.com/ChimeraCoder/gojson/gojson
RUN go get -d -v github.com/gogo/protobuf/protoc-gen-gogofaster
WORKDIR /go/src/github.com/gogo/protobuf
RUN git fetch
RUN git checkout v1.2.1
RUN go install github.com/gogo/protobuf/protoc-gen-gogofaster
WORKDIR /go
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
RUN go get -u -v github.com/gogo/protobuf/[email protected]
RUN go get -u -v golang.org/x/tools/cmd/stringer
WORKDIR /go/src/golang.org/x/tools/cmd/stringer
RUN git checkout d11f6ec946130207fd66b479a9a6def585b5110b
RUN go install
WORKDIR /go
WORKDIR /protoc
RUN wget https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip
RUN unzip protoc-3.1.0-linux-x86_64.zip
RUN cp bin/protoc /usr/bin/protoc
RUN chmod 777 /usr/bin/protoc

WORKDIR /go/src/github.com/stripe/veneur
ADD . /go/src/github.com/stripe/veneur
WORKDIR /veneur
ADD . /veneur

# If running locally, ignore any changes since
# the last commit
Expand All @@ -38,7 +29,6 @@ RUN git reset --hard HEAD && git status
# because we are guaranteed only one version of Go
# used to build protoc-gen-go
RUN go generate
RUN dep check
# Exclude vendor from gofmt checks.
RUN mv vendor ../ && gofmt -w . && mv ../vendor .

Expand All @@ -58,6 +48,6 @@ RUN git add .
RUN git diff --cached
RUN git diff-index --cached --exit-code HEAD


RUN mkdir -p /build
RUN go test -race -v -timeout 60s -ldflags "-X github.com/stripe/veneur.VERSION=$(git rev-parse HEAD) -X github.com/stripe/veneur.BUILD_DATE=$(date +%s)" ./...
CMD cp -r henson /build/ && env GOBIN=/build go install -a -v -ldflags "-X github.com/stripe/veneur.VERSION=$(git rev-parse HEAD) -X github.com/stripe/veneur.BUILD_DATE=$(date +%s)" ./cmd/...
Loading

0 comments on commit 1c3f5f1

Please sign in to comment.