Commit 2c90e0d8 authored by Nicolas PERNOUD's avatar Nicolas PERNOUD
Browse files

feat: added remove instance script

parent e45a7c84
......@@ -17,10 +17,10 @@ echo "Creating instance ${INSTANCE_ID}.${COZY_TLD} ..."
docker-compose exec cozy ./cozy instances add --host 0.0.0.0 --apps drive,collect,settings,home "${INSTANCE_ID}.${COZY_TLD}" | tee "${TMPFILE}"
# Install grand lyon apps
docker-compose exec cozy ./cozy konnectors install enedis-scraping-connector --all-domains git://forge.grandlyon.com/pocs/cozy/enedis-scraping-connector.git#build
docker-compose exec cozy ./cozy apps install energy-dataviz --all-domains git://forge.grandlyon.com/pocs/cozy/energy-dataviz.git#build
docker-compose exec cozy ./cozy konnectors install grdf-scraping-connector --all-domains git://forge.grandlyon.com/pocs/cozy/grdf-scraping-connector.git#build
docker-compose exec cozy ./cozy konnectors install egl-api-connector --all-domains git://forge.grandlyon.com/pocs/cozy/egl-api-connector.git#build
docker-compose exec cozy ./cozy konnectors install enedis-scraping-connector --domain=${INSTANCE_ID}.${COZY_TLD} https://forge.grandlyon.com/pocs/cozy/enedis-scraping-connector/-/archive/build/enedis-scraping-connector-build.tar
docker-compose exec cozy ./cozy konnectors install grdf-scraping-connector --domain=${INSTANCE_ID}.${COZY_TLD} https://forge.grandlyon.com/pocs/cozy/grdf-scraping-connector/-/archive/master/grdf-scraping-connector-master.tar
docker-compose exec cozy ./cozy konnectors install egl-api-connector --domain=${INSTANCE_ID}.${COZY_TLD} https://forge.grandlyon.com/pocs/cozy/egl-api-connector/-/archive/master/egl-api-connector-master.tar
docker-compose exec cozy ./cozy apps install energy-dataviz --domain=${INSTANCE_ID}.${COZY_TLD} https://forge.grandlyon.com/pocs/cozy/energy-dataviz/-/archive/master/energy-dataviz-master.tar
## To replace by registry://store/something after next cozy-stack release
docker-compose exec cozy ./cozy apps install --domain "${INSTANCE_ID}.${COZY_TLD}" store registry://store/stable | tee -a "${TMPFILE}"
......
#!/usr/bin/env bash
# creates an instance with the default apps and grand lyon apps installed
if [ $# -ne 1 ]; then
echo "Usage: $0 <instance url>"
exit 1
fi
INSTANCE_ID=$1
source .env
TMPFILE=$(mktemp /tmp/cozyXXX)
echo "Removing instance ${INSTANCE_ID}.${COZY_TLD} ..."
docker-compose exec cozy ./cozy instances destroy --host 0.0.0.0 "${INSTANCE_ID}.${COZY_TLD}" | tee "${TMPFILE}"
# TODO find a better way to detect if there was an error
TOKEN=""
if [ $(grep -ic ERROR ${TMPFILE}) -eq 0 ]; then
TOKEN=$(grep token "${TMPFILE}" | cut -f2 -d":" | tr -d '" ')
fi
rm "${TMPFILE}"
if [ -z "${TOKEN}" ]; then
echo No token found.
exit 1
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment