Skip to content

Commit

Permalink
Move to using github docker registry for build environment
Browse files Browse the repository at this point in the history
This reduces the bus factor by moving control to the repo
and away from my personal docker hub account.
  • Loading branch information
johanbrandhorst committed Apr 28, 2020
1 parent ead3fc0 commit 6dc78d0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
5 changes: 2 additions & 3 deletions .circleci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Contained within is the CI test setup for the Gateway. It runs on Circle CI.
Great, it should be as simple as thus (run from the root of the directory):

```bash
$ docker run -v $(pwd):/go/src/github.com/grpc-ecosystem/grpc-gateway --rm jfbrandhorst/grpc-gateway-build-env:1.14 \
$ docker run -v $(pwd):/go/src/github.com/grpc-ecosystem/grpc-gateway --rm docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14 \
/bin/bash -c 'cd /go/src/github.com/grpc-ecosystem/grpc-gateway && \
make realclean && \
make examples'
Expand All @@ -18,5 +18,4 @@ If this has resulted in some file changes in the repo, please ensure you check t
### Whats up with the Dockerfile?

The `Dockerfile` in this folder is used as the build environment when regenerating the files (see above).
The canonical repository for this Dockerfile is `jfbrandhorst/grpc-gateway-build-env`. Please request access
before attempting to make any changes to the Dockerfile.
The canonical repository for this Dockerfile is `docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env`.
35 changes: 28 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ version: 2
jobs:
build:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
- image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
auth:
username: $GITHUB_USER
password: $GITHUB_TOKEN
working_directory: /src/grpc-gateway
steps:
- checkout
- run: go build ./...
test:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
- image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
auth:
username: $GITHUB_USER
password: $GITHUB_TOKEN
working_directory: /src/grpc-gateway
environment:
GLOG_logtostderr: '1'
Expand All @@ -19,7 +25,10 @@ jobs:
- run: bash <(curl -s https://codecov.io/bash)
node_test:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
- image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
auth:
username: $GITHUB_USER
password: $GITHUB_TOKEN
working_directory: /src/grpc-gateway
steps:
- checkout
Expand All @@ -32,7 +41,10 @@ jobs:
./node_modules/.bin/gulp
generate:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
- image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
auth:
username: $GITHUB_USER
password: $GITHUB_TOKEN
working_directory: /src/grpc-gateway
steps:
- checkout
Expand All @@ -43,7 +55,10 @@ jobs:
- run: git diff --exit-code
lint:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
- image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
auth:
username: $GITHUB_USER
password: $GITHUB_TOKEN
working_directory: /src/grpc-gateway
steps:
- checkout
Expand Down Expand Up @@ -88,7 +103,10 @@ jobs:
when: always
gorelease:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
- image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
auth:
username: $GITHUB_USER
password: $GITHUB_TOKEN
working_directory: /src/grpc-gateway
steps:
- checkout
Expand All @@ -101,7 +119,10 @@ jobs:
- run: gorelease
release:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
- image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
auth:
username: $GITHUB_USER
password: $GITHUB_TOKEN
working_directory: /src/grpc-gateway
steps:
- checkout
Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ All submissions, including submissions by project members, require review.
Great, it should be as simple as thus (run from the root of the directory):

```bash
docker run -v $(pwd):/src/grpc-gateway --rm jfbrandhorst/grpc-gateway-build-env:1.14 \
docker run -v $(pwd):/src/grpc-gateway --rm docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14 \
/bin/bash -c 'cd /src/grpc-gateway && \
make realclean && \
make examples && \
Expand All @@ -36,6 +36,9 @@ docker run -itv $(pwd):/grpc-gateway -w /grpc-gateway --entrypoint /bin/bash --r
l.gcr.io/google/bazel -c 'bazel run :gazelle'
```

You may need to authenticate with github to pull `docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env`.
You can do this by following the steps on the [Github Package docs](https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages).

If this has resulted in some file changes in the repo, please ensure you check those in with your merge request.

### Making a release
Expand Down

0 comments on commit 6dc78d0

Please sign in to comment.