Skip to content
Snippets Groups Projects
test.sh 579 B
Newer Older
Pierre Ozoux's avatar
Pierre Ozoux committed
#!/bin/bash -eux

cp /data/indiehosters/unit-files/* /etc/systemd/system && sudo systemctl daemon-reload

image=$1

# prepare data
/data/indiehosters/scripts/provision.sh -e test@test.org -a $image -u $image.test -f /data/indiehosters/tests/unsecure-certs/indiehosters.dev.pem
Pierre Ozoux's avatar
Pierre Ozoux committed

if [ "$image" == "static" ]; then
  systemctl start $image@$image.test
  systemctl enable $image@$image.test
Pierre Ozoux's avatar
Pierre Ozoux committed
  sleep 20
Pierre Ozoux's avatar
Pierre Ozoux committed
else
  systemctl start lamp@$image.test
  systemctl enable lamp@$image.test
Pierre Ozoux's avatar
Pierre Ozoux committed
  sleep 60
Pierre Ozoux's avatar
Pierre Ozoux committed
fi

systemctl list-units | grep "$image\.test" | grep -c failed | grep 0
Pierre Ozoux's avatar
Pierre Ozoux committed
curl -L $image.test
Pierre Ozoux's avatar
Pierre Ozoux committed