Fixes tests for lamp image
This commit is contained in:
parent
335ddda4ff
commit
6447f158ef
3 changed files with 31 additions and 11 deletions
|
@ -1,12 +1,23 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
image=$1
|
||||
if [ "$image" == "wordpress" ] || [ "$image" == "known" ]; then
|
||||
systemctl stop lamp@$image.test
|
||||
sleep 15
|
||||
else
|
||||
systemctl stop $image@$image.test
|
||||
fi
|
||||
|
||||
systemctl stop *@$image.test.timer
|
||||
systemctl stop *@$image.test
|
||||
systemctl reset-failed
|
||||
systemctl list-units | grep -c "$image\.test" | grep 0
|
||||
rm -rf /data/import/$image.test
|
||||
rm -rf /data/runtime/domains/$image.test
|
||||
rm -rf /data/domains/$image.test
|
||||
systemctl disable $image@$image.test
|
||||
systemctl stop *@$image.test.timer
|
||||
systemctl stop *@$image.test
|
||||
systemctl reset-failed
|
||||
if [ "$image" == "wordpress" ] || [ "$image" == "known" ]; then
|
||||
systemctl disable lamp@$image.test
|
||||
else
|
||||
systemctl disable $image@$image.test
|
||||
fi
|
||||
systemctl list-units | grep -c "$image\.test" | grep 0
|
||||
|
|
|
@ -7,13 +7,17 @@ image=$1
|
|||
# prepare data
|
||||
mkdir -p /data/import/$image.test/TLS
|
||||
cp /data/indiehosters/scripts/unsecure-certs/example.dev.pem /data/import/$image.test/TLS/$image.test.pem
|
||||
if [ "$image" == "staticgit" ]; then
|
||||
mkdir -p /data/import/$image.test/static-git
|
||||
echo "https://github.com/indiehosters/website.git" > /data/import/$image.test/static-git/GITURL
|
||||
echo "APPLICATION=$image" > /data/import/$image.test/.env
|
||||
if [ "$image" == "wordpress" ] || [ "$image" == "known" ]; then
|
||||
echo "VOLUME=$(cat /data/indiehosters/dockerfiles/services/$image/VOLUME)" >> /data/import/$image.test/.env
|
||||
fi
|
||||
|
||||
# start image from import
|
||||
systemctl start $image@$image.test
|
||||
if [ "$image" == "wordpress" ] || [ "$image" == "known" ]; then
|
||||
systemctl start lamp@$image.test
|
||||
else
|
||||
systemctl start $image@$image.test
|
||||
fi
|
||||
|
||||
# tests
|
||||
/data/indiehosters/tests/test-image.sh $image
|
||||
|
@ -22,8 +26,13 @@ systemctl start $image@$image.test
|
|||
## make sure to backup first
|
||||
systemctl start backup@$image.test
|
||||
/data/indiehosters/tests/clean-image.sh $image
|
||||
systemctl enable $image@$image.test
|
||||
systemctl start $image@$image.test
|
||||
if [ "$image" == "wordpress" ] || [ "$image" == "known" ]; then
|
||||
systemctl enable lamp@$image.test
|
||||
systemctl start lamp@$image.test
|
||||
else
|
||||
systemctl enable $image@$image.test
|
||||
systemctl start $image@$image.test
|
||||
fi
|
||||
|
||||
# tests
|
||||
/data/indiehosters/tests/test-image.sh $image
|
||||
|
|
|
@ -9,5 +9,5 @@ else
|
|||
fi
|
||||
|
||||
systemctl list-units | grep "$image\.test" | grep -c failed | grep 0
|
||||
ip=`docker inspect --format {{.NetworkSettings.IPAddress}} $image-$image.test`
|
||||
ip=`docker inspect --format {{.NetworkSettings.IPAddress}} $image.test`
|
||||
curl -L $ip
|
||||
|
|
Loading…
Reference in a new issue