Skip to content

Commit

Permalink
Merge pull request #124 from launchdarkly/eb/ch81703/modules
Browse files Browse the repository at this point in the history
(v6 - #1) build with modules, drop support for old Go versions, update CircleCI images
  • Loading branch information
eli-darkly authored Jul 9, 2020
2 parents 41fe664 + 1d4c9c1 commit e794d47
Show file tree
Hide file tree
Showing 1,212 changed files with 359 additions and 366,093 deletions.
31 changes: 6 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,12 @@ workflows:
jobs:
- go-test:
name: Go 1.14
docker-image: circleci/golang:1.14
docker-image: cimg/go:1.14
run-lint: true
test-coverage: true
- go-test:
name: Go 1.13
docker-image: circleci/golang:1.13
run-lint: true
- go-test:
name: Go 1.12
docker-image: circleci/golang:1.12
- go-test:
name: Go 1.11
docker-image: circleci/golang:1.11
- go-test:
name: Go 1.10
docker-image: circleci/golang:1.10
- go-test:
name: Go 1.9
docker-image: circleci/golang:1.9
- go-test:
name: Go 1.8
docker-image: circleci/golang:1.8
docker-image: cimg/go:1.13
- test-publish
- publish:
filters:
Expand Down Expand Up @@ -63,14 +47,11 @@ jobs:
COMMON_GO_PACKAGES: >
github.com/jstemmer/go-junit-report
working_directory: /go/src/gopkg.in/launchdarkly/ld-relay.v5

steps:
- checkout
- run: go get -u $COMMON_GO_PACKAGES
- run: go version && go env
- run: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- run: dep ensure -dry-run
- when:
condition: <<parameters.run-lint>>
steps:
Expand Down Expand Up @@ -107,7 +88,9 @@ jobs:
# note that CircleCI doesn't let us use "when" for an environment variable like $CC_TEST_REPORTER_ID
command: |
if [[ -n "$CC_TEST_REPORTER_ID" ]]; then
./cc-test-reporter format-coverage $CIRCLE_ARTIFACTS/coverage.txt -t gocov --output $CIRCLE_ARTIFACTS/coverage.json
./cc-test-reporter format-coverage $CIRCLE_ARTIFACTS/coverage.txt -t gocov \
--prefix github.com/launchdarkly/ld-relay/v6 \
--output $CIRCLE_ARTIFACTS/coverage.json
./cc-test-reporter upload-coverage --input $CIRCLE_ARTIFACTS/coverage.json
fi
- run:
Expand All @@ -124,11 +107,10 @@ jobs:
test-publish:
docker:
- &release_docker_image
image: circleci/golang:1.10.3
image: cimg/go:1.13
environment:
<<: *environment

working_directory: /go/src/gopkg.in/launchdarkly/ld-relay.v5
steps:
- checkout
- setup_remote_docker # start docker engine
Expand All @@ -143,7 +125,6 @@ jobs:
docker:
- <<: *release_docker_image

working_directory: /go/src/gopkg.in/launchdarkly/ld-relay.v5
steps:
- checkout
- setup_remote_docker # start docker engine
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ _out
/bin/

/dist/
.vscode
3 changes: 2 additions & 1 deletion .ldrelease/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ repo:
private: ld-relay-private

releasableBranches:
- name: v6
- name: v5

publications:
- url: https://godoc.org/github.com/launchdarkly/ld-relay
- url: https://pkg.go.dev/github.com/launchdarkly/ld-relay
description: documentation
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This is a standalone Dockerfile that does not depend on goreleaser building the binary
# It is NOT the version that is pushed to dockerhub
FROM golang:1.10.3-alpine as builder
FROM golang:1.13.12-alpine as builder

RUN apk --no-cache add \
libc-dev \
&& rm -rf /var/cache/apk/*

ARG SRC_DIR=/go/src/gopkg.in/launchdarkly/ld-relay.v5
ARG SRC_DIR=/go/ld-relay

RUN mkdir -p $SRC_DIR

Expand All @@ -20,7 +20,7 @@ ENV GOPATH=/go

RUN go build -a -o ldr ./cmd/ld-relay

FROM alpine:3.10.2
FROM golang:1.13.12-alpine

RUN addgroup -g 1000 -S ldr-user && \
adduser -u 1000 -S ldr-user -G ldr-user && \
Expand All @@ -33,7 +33,7 @@ RUN apk add --no-cache \
&& update-ca-certificates \
&& rm -rf /var/cache/apk/*

ARG SRC_DIR=/go/src/gopkg.in/launchdarkly/ld-relay.v5
ARG SRC_DIR=/go/ld-relay

COPY --from=builder ${SRC_DIR}/ldr /usr/bin/ldr

Expand Down
Loading

0 comments on commit e794d47

Please sign in to comment.