mirror of
https://git.sindominio.net/estibadores/wordpress.git
synced 2024-11-09 21:01:07 +01:00
42 lines
737 B
Bash
Executable File
42 lines
737 B
Bash
Executable File
#!/bin/bash
|
|
|
|
tear_down () {
|
|
docker-compose stop
|
|
cd ..
|
|
rm -rf tmp
|
|
}
|
|
|
|
mkdir tmp
|
|
cat env.sample | sed "s/USER_GROUP.*$/USER_GROUP=`id -u`:`id -g`/" > tmp/.env
|
|
cat docker-compose.yml | sed 's/registry.sindominio.net\/wordpress/wordpress/' > tmp/docker-compose.yml
|
|
|
|
cd tmp
|
|
mkdir db uploads
|
|
|
|
docker-compose up -d
|
|
|
|
# Wait for the web server to respond
|
|
cont=0
|
|
echo -n "Espera al servidor web "
|
|
while ! curl -s localhost:8080 > /dev/null; do
|
|
echo -n "."
|
|
cont=$((cont+1))
|
|
if [ "$cont" == 30 ]; then
|
|
echo " no responde"
|
|
tear_down
|
|
exit 1
|
|
fi
|
|
sleep 1
|
|
done
|
|
echo " connectado"
|
|
|
|
STR=`curl -s localhost:8080 |grep "Hello world!"`
|
|
tear_down
|
|
|
|
if [[ "$STR" == "" ]]
|
|
then
|
|
echo "No encontre 'Hello world!' en la web del contenedor"
|
|
exit 1
|
|
fi
|
|
|