Skip to content

Commit

Permalink
fix: bind maven local repository in docker environment (#10967)
Browse files Browse the repository at this point in the history
* fix: bind home dir in docker run

* update config for testing

* chore: generate libraries at Fri Jun 14 14:48:27 UTC 2024

* restore config

* Revert "restore config"

This reverts commit bb6370c.

* restore config

* restore change

* add comments

---------

Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
  • Loading branch information
JoeWang1127 and cloud-java-bot committed Jun 14, 2024
1 parent acd8025 commit 3e7752f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .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 @@ -88,12 +89,15 @@ fi
git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}"
config_diff=$(diff "${generation_config}" "${baseline_generation_config}" || true)

# get .m2 folder so it's mapped into the docker container
m2_folder=$(dirname "$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)")

# run hermetic code generation docker image.
docker run \
--rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):${workspace_name}" \
-v "$HOME"/.m2:/home/.m2 \
-v "${m2_folder}":/home/.m2 \
gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \
--baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \
--current-generation-config-path="${workspace_name}/${generation_config}"
Expand Down

0 comments on commit 3e7752f

Please sign in to comment.