Skip to content

Commit

Permalink
fix(docker): update path to CLI jar (#1241)
Browse files Browse the repository at this point in the history
* chore(docker): add .github/ to .dockerignore

* feat(docker): test container image before pushing

* fix(docker): update path to CLI jar

* fix(cli): return exit code 0 for --help

* chore(docker): add more ancillary trees to .dockerignore
  • Loading branch information
themightychris authored Aug 17, 2022
1 parent 7d0c704 commit 0923169
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.git/
.github/
docs/
Dockerfile
build/
config/
scripts/
22 changes: 21 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,27 @@ jobs:
echo ::set-output name=version::${AXION_VERSION}
echo ::set-output name=tags::${DOCKER_TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Build and push
# Build and push steps are split up in order to test the built contaire image in between
# - build-args and labels inputs _must_ be kept matching between both to prevent rebuild
# - See: https://github.com/docker/build-push-action/blob/master/docs/advanced/test-before-push.md
- name: Build Docker container image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
build-args: |
VERSION_TAG=${{ steps.prep.outputs.version }}
load: true
tags: ${{ steps.prep.outputs.tags }}
labels: |
org.opencontainers.image.source=https://github.com/${GITHUB_REPOSITORY,,}.git
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
- name: Test Docker container image
run: docker run --rm ${{ steps.prep.outputs.tags }} --help
- name: Push Docker container image
uses: docker/build-push-action@v3
with:
context: .
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN ./gradlew shadowJar \


FROM openjdk:11-slim
COPY --from=build /build/main/build/libs/gtfs-validator-*-cli.jar /gtfs-validator-cli.jar
COPY --from=build /build/cli/build/libs/gtfs-validator-*-cli.jar /gtfs-validator-cli.jar
WORKDIR /

ARG VERSION_TAG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static Arguments parseArguments(String[] argv) {
jCommander.usage();
System.out.println(
"⚠️ Note that parameters marked with an asterisk (*) in the help menu are mandatory.");
return null;
System.exit(0);
}
if (args.getExportNoticeSchema()) {
exportNoticeSchema(args);
Expand Down

0 comments on commit 0923169

Please sign in to comment.