Skip to content

Commit

Permalink
move docker build into script
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Jun 11, 2024
1 parent 58ce2fc commit 66e1d18
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
9 changes: 9 additions & 0 deletions .github/scripts/hermetic_library_generation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set -e
# 1. git
# 2. gh
# 3. docker
# 4. mvn

# The parameters of this script is:
# 1. target_branch, the branch into which the pull request is merged.
Expand Down Expand Up @@ -89,6 +90,14 @@ fi
git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}"
config_diff=$(diff "${generation_config}" "${baseline_generation_config}" || true)

# install generator locally since we're using a SNAPSHOT version.
mvn -V -B -ntp clean install -DskipTests

# build image locally since we want to include latest change.
docker build \
-f .cloudbuild/library_generation/library_generation.Dockerfile \
-t gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \
.
# run hermetic code generation docker image.
docker run \
--rm \
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
- name: Build image
shell: bash
run: |
docker build \
-f .cloudbuild/library_generation/library_generation.Dockerfile \
-t gcr.io/cloud-devrel-public-resources/java-library-generation:latest \
.
- name: Install all modules
shell: bash
run: |
mvn -V -B -ntp clean install -DskipTests
- name: Generate changed libraries
shell: bash
run: |
Expand Down

0 comments on commit 66e1d18

Please sign in to comment.