Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable docker image test #174

Merged
merged 4 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions scripts/dockerImageTest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
while getopts t:d: flag; do
case "${flag}" in
t) DATE="${OPTARG}" ;;
d) DRIVER="${OPTARG}" ;;
*) echo "Invalid option" ;;
esac
done

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
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
cat system/Dockerfile-full inventory/Dockerfile-full

echo "$DOCKER_PASSWORD" | sudo docker login -u "$DOCKER_USERNAME" --password-stdin cp.stg.icr.io
sudo docker pull -q "cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi"
sudo echo "build level:"; docker inspect --format "{{ index .Config.Labels \"org.opencontainers.image.revision\"}}" cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi

sudo ../scripts/testAppFinish.sh
sudo ../scripts/testAppStart.sh
9 changes: 9 additions & 0 deletions scripts/testAppFinish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,14 @@ else
exit 1
fi

docker exec system cat /logs/messages.log | grep product
docker exec system cat /logs/messages.log | grep java
docker exec system-optimized cat /logs/messages.log | grep product
docker exec system-optimized cat /logs/messages.log | grep java
docker exec inventory cat /logs/messages.log | grep product
docker exec inventory cat /logs/messages.log | grep java
docker exec inventory-optimized cat /logs/messages.log | grep product
docker exec inventory-optimized cat /logs/messages.log | grep java

docker stop inventory system inventory-optimized system-optimized
docker rm inventory system inventory-optimized system-optimized
Loading