21
21
# The parameters of this script is:
22
22
# 1. target_branch, the branch into which the pull request is merged.
23
23
# 2. current_branch, the branch with which the pull request is associated.
24
- # 3. [optional] generation_config, the path to the generation configuration,
24
+ # 3. [optional] image_tag, the tag of gcr.io/cloud-devrel-public-resources/java-library-generation.
25
+ # The value will be parsed from the generation configuration if not specified.
26
+ # 4. [optional] generation_config, the path to the generation configuration,
25
27
# the default value is generation_config.yaml in the repository root.
26
28
while [[ $# -gt 0 ]]; do
27
29
key=" $1 "
@@ -34,6 +36,10 @@ case "${key}" in
34
36
current_branch=" $2 "
35
37
shift
36
38
;;
39
+ --image_tag)
40
+ image_tag=" $2 "
41
+ shift
42
+ ;;
37
43
--generation_config)
38
44
generation_config=" $2 "
39
45
shift
@@ -56,6 +62,10 @@ if [ -z "${current_branch}" ]; then
56
62
exit 1
57
63
fi
58
64
65
+ if [ -z " ${image_tag} " ]; then
66
+ image_tag=$( grep " gapic_generator_version" " ${generation_config} " | cut -d ' :' -f 2 | xargs)
67
+ fi
68
+
59
69
if [ -z " ${generation_config} " ]; then
60
70
generation_config=generation_config.yaml
61
71
echo " Using default generation config: ${generation_config} "
@@ -96,13 +106,8 @@ docker run \
96
106
--current-generation-config-path=" ${workspace_name} /${generation_config} "
97
107
98
108
# commit the change to the pull request.
99
- if [[ $( basename " $( pwd) " ) == " google-cloud-java" ]]; then
100
- git add java-* pom.xml gapic-libraries-bom/pom.xml versions.txt
101
- else
102
- # The image leaves intermediate folders and files it works with. Here we remove them
103
- rm -rdf output googleapis " ${baseline_generation_config} "
104
- git add --all -- ' :!pr_description.txt'
105
- fi
109
+ rm -rdf output googleapis " ${baseline_generation_config} "
110
+ git add --all -- ' :!pr_description.txt'
106
111
changed_files=$( git diff --cached --name-only)
107
112
if [[ " ${changed_files} " == " " ]]; then
108
113
echo " There is no generated code change with the generation config change ${config_diff} ."
0 commit comments