File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 33 Ondro Mihalyi <
[email protected] > (@ondromih)
44GitRepo: https://github.com/OmniFish-EE/docker-library-glassfish.git
55GitFetch: refs/heads/main
6- GitCommit: 12efd43d7633d89cb28edf3a5b0cf3c12ac31c1f
6+ GitCommit: 3e22307467c6f9557077f9eb4d481e3ede8df30f
77
88Tags: 7.0.0, 7.0.0-jdk17, 7.0.0-jdk17-eclipse-temurin
99Architectures: amd64
Original file line number Diff line number Diff line change @@ -5,17 +5,23 @@ serverImage="$1"
55containerId=" $( docker run -d " $serverImage " ) "
66trap " docker rm -vf $containerId > /dev/null" EXIT
77
8- logLine=' ^\s+Eclipse GlassFish\s+[\.0-9]+'
9- timeout=60
8+ waitForLogLine () {
9+ timeout=" $1 " ;
10+ logLine=" $2 " ;
11+ until docker logs $containerId 2>&1 | grep -q -E " $logLine "
12+ do
13+ if [ $timeout -eq 0 ]
14+ then
15+ exit 100;
16+ fi
17+ sleep 1
18+ timeout=$(( timeout- 1 ))
19+ done
20+ }
1021
11- until docker logs $containerId 2>&1 | grep -q -E " $logLine "
12- do
13- if [ $timeout -eq 0 ]
14- then
15- exit 100;
16- fi
17- sleep 1
18- timeout=$(( timeout- 1 ))
19- done
22+ waitForLogLine 60 ' ^\s+Eclipse GlassFish\s+[\.0-9]+' ;
23+ echo " GlassFish started as ${containerId} "
2024
21- echo " Success!"
25+ docker stop " ${containerId} " &
26+ waitForLogLine 30 ' ^\s+Completed shutdown of GlassFish runtime' ;
27+ echo " GlassFish stopped OK!"
You can’t perform that action at this time.
0 commit comments