Skip to content

Commit 047f733

Browse files
committed
Try correcting domain proxy maven settings in buildah-oci-ta again.
1 parent c714658 commit 047f733

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

deploy/tasks/buildah-oci-ta.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,13 @@ spec:
290290
dockerfile_copy=$(mktemp --tmpdir "$(basename "$dockerfile_path").XXXXXX")
291291
cp "$dockerfile_path" "$dockerfile_copy"
292292
293-
if grep -q '^\s*RUN \(./\)\?mvn' "$dockerfile_copy"; then
294-
if [ -n "$JVM_BUILD_WORKSPACE_ARTIFACT_CACHE_PORT_80_TCP_ADDR" ]; then
295-
settings="<settings><proxies><proxy><id>domain-proxy</id><active>true</active><protocol>http</protocol><host>localhost</host><port>8080</port></proxy></proxies><mirrors><mirror><id>mirror.default</id><url>http://$JVM_BUILD_WORKSPACE_ARTIFACT_CACHE_PORT_80_TCP_ADDR/v1/cache/default/0/</url><mirrorOf>*</mirrorOf></mirror></mirrors></settings>"
296-
else
297-
settings="<settings><proxies><proxy><id>domain-proxy</id><active>true</active><protocol>http</protocol><host>localhost</host><port>8080</port></proxy></proxies></settings>"
298-
fi
299-
300-
sed -i -e "s|^\s*RUN \(\(./\)\?mvn\)\(.*\)|RUN echo \"$settings\" > /tmp/settings.yaml; \1 -s /tmp/settings.yaml \3|g" "$dockerfile_copy"
301-
touch /var/lib/containers/java
293+
if [ -n "$JVM_BUILD_WORKSPACE_ARTIFACT_CACHE_PORT_80_TCP_ADDR" ] && grep -q '^\s*RUN \(./\)\?mvn' "$dockerfile_copy"; then
294+
settings="<settings><proxies><proxy><id>domain-proxy</id><active>true</active><protocol>http</protocol><host>localhost</host><port>8080</port></proxy></proxies><mirrors><mirror><id>mirror.default</id><url>http://$JVM_BUILD_WORKSPACE_ARTIFACT_CACHE_PORT_80_TCP_ADDR/v1/cache/default/0/</url><mirrorOf>*</mirrorOf></mirror></mirrors></settings>"
295+
else
296+
settings="<settings><proxies><proxy><id>domain-proxy</id><active>true</active><protocol>http</protocol><host>localhost</host><port>8080</port></proxy></proxies></settings>"
302297
fi
298+
sed -i -e "s|^\s*RUN \(\(./\)\?mvn\)\(.*\)|RUN echo \"$settings\" > /tmp/settings.yaml; \1 -s /tmp/settings.yaml \3|g" "$dockerfile_copy"
299+
touch /var/lib/containers/java
303300
304301
# Fixing group permission on /var/lib/containers
305302
chown root:root /var/lib/containers

0 commit comments

Comments
 (0)