Skip to content

Commit 51b4db7

Browse files
committed
Debug. Fix missing anchors
1 parent 24e532a commit 51b4db7

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/build/preprocessor/AbstractPreprocessor.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,18 @@ public void run() {
146146
echo "PATH:$PATH"
147147
148148
update-ca-trust
149-
150-
# Go through certificates and insert them into the cacerts
151-
for cert in /etc/pki/ca-trust/source/anchors/*; do
152-
echo "inserting $cert into java cacerts"
153-
keytool -import -alias $(basename $cert)-ca \\
154-
-file $cert \\
155-
-keystore /etc/pki/java/cacerts \\
156-
-storepass changeit --noprompt
157-
done;
149+
ls -lR /etc/pki || true
150+
151+
if [ -d /etc/pki/ca-trust/source/anchors ]; then
152+
# Go through certificates and insert them into the cacerts
153+
for cert in /etc/pki/ca-trust/source/anchors/*; do
154+
echo "inserting $cert into java cacerts"
155+
keytool -import -alias $(basename $cert)-ca \\
156+
-file $cert \\
157+
-keystore /etc/pki/java/cacerts \\
158+
-storepass changeit --noprompt
159+
done
160+
fi
158161
159162
# End of generic build script
160163

0 commit comments

Comments
 (0)