Skip to content

Commit

Permalink
Update dockerImageTest.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
gkwan-ibm authored Oct 2, 2024
1 parent 8a23366 commit 780dc9f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions scripts/dockerImageTest.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
while getopts t:d: flag; do
while getopts t:d:v: flag; do
case "${flag}" in
t) DATE="${OPTARG}" ;;
d) DRIVER="${OPTARG}" ;;
v) OL_LEVEL="${OPTARG}";;
*) echo "Invalid option" ;;
esac
done
Expand All @@ -12,10 +13,18 @@ echo "Testing latest OpenLiberty Docker image"
sed -i "\#<artifactId>liberty-maven-plugin</artifactId>#a<configuration><install><runtimeUrl>https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/nightly/$DATE/$DRIVER</runtimeUrl></install></configuration>" ../start/system/pom.xml ../start/inventory/pom.xml ../finish/system/pom.xml ../finish/inventory/pom.xml
cat ../start/system/pom.xml ../start/inventory/pom.xml ../finish/system/pom.xml ../finish/inventory/pom.xml

sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi;g" system/Dockerfile inventory/Dockerfile
if [[ "$OL_LEVEL" != "" ]]; then
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java11-openj9-ubi;g" system/Dockerfile inventory/Dockerfile
else
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi;g" system/Dockerfile inventory/Dockerfile
fi
sed -i "s;RUN features.sh;#RUN features.sh;g" system/Dockerfile inventory/Dockerfile
cat system/Dockerfile inventory/Dockerfile
sed -i "s;FROM icr.io/appcafe/open-liberty:full-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi;g" system/Dockerfile-full inventory/Dockerfile-full
if [[ "$OL_LEVEL" != "" ]]; then
sed -i "s;FROM icr.io/appcafe/open-liberty:full-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java11-openj9-ubi;g" system/Dockerfile-full inventory/Dockerfile-full
else
sed -i "s;FROM icr.io/appcafe/open-liberty:full-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi;g" system/Dockerfile-full inventory/Dockerfile-full
fi
cat system/Dockerfile-full inventory/Dockerfile-full

echo "$DOCKER_PASSWORD" | sudo docker login -u "$DOCKER_USERNAME" --password-stdin cp.stg.icr.io
Expand Down

0 comments on commit 780dc9f

Please sign in to comment.