adding counter and detatch to compose test
parent
21ecc27a94
commit
5d5dfe14ee
@ -1,14 +1,21 @@
|
||||
#!/bin/sh
|
||||
# remove old containers
|
||||
docker-compose -p ci --file docker-compose.test.yml rm -f
|
||||
# run tests
|
||||
docker-compose -p ci --file docker-compose.test.yml up --build
|
||||
# run tests (and detatch)
|
||||
docker-compose -p ci --file docker-compose.test.yml up --build -d
|
||||
|
||||
|
||||
echo "Inspecting exited containers:"
|
||||
docker-compose -p ci --file docker-compose.test.yml ps
|
||||
docker-compose -p ci --file docker-compose.test.yml ps -q | xargs docker inspect -p ci -f '{{ .State.ExitCode }}' | while read code; do
|
||||
COUNTER=0
|
||||
docker-compose -p ci --file docker-compose.test.yml ps -q | xargs docker inspect -f '{{ .State.ExitCode }}' | while read code; do
|
||||
echo "Exit code is currently $code"
|
||||
if [ "$code" != "0" ]; then
|
||||
exit $code
|
||||
fi
|
||||
echo The counter is $COUNTER
|
||||
let COUNTER=COUNTER+1
|
||||
if [ $COUNTER -gt 50 ]; do
|
||||
exit 1
|
||||
done
|
||||
done
|
||||
|
Loading…
Reference in New Issue