Added local install option.
This commit is contained in:
parent
07f4b88431
commit
0de35b6733
66
create.sh
66
create.sh
@ -14,35 +14,43 @@ do
|
|||||||
{ echo "ERROR: could not create network ${NETWORK}, exiting."; exit 1; }
|
{ echo "ERROR: could not create network ${NETWORK}, exiting."; exit 1; }
|
||||||
done
|
done
|
||||||
|
|
||||||
test -f ~/openrc.sh || { echo "ERROR: ~/openrc.sh not found, exiting."; exit 1; }
|
if test -z "$1" || [ "$1" != "local" ]
|
||||||
source ~/openrc.sh
|
then
|
||||||
export OS_REGION_NAME=GRA
|
test -f ~/openrc.sh || { echo "ERROR: ~/openrc.sh not found, exiting."; exit 1; }
|
||||||
test -f ~/duplicity_password.sh || { echo "ERROR: ~/duplicity_password.sh not found, exiting."; exit 1; }
|
source ~/openrc.sh
|
||||||
source ~/duplicity_password.sh
|
export OS_REGION_NAME=GRA
|
||||||
|
test -f ~/duplicity_password.sh || { echo "ERROR: ~/duplicity_password.sh not found, exiting."; exit 1; }
|
||||||
sudo docker image inspect duplicity:latest &> /dev/null || { echo "ERROR: duplicity:latest image not found, exiting."; exit 1; }
|
source ~/duplicity_password.sh
|
||||||
|
|
||||||
rm -rf ~/build
|
sudo docker image inspect duplicity:latest &> /dev/null || { echo "ERROR: duplicity:latest image not found, exiting."; exit 1; }
|
||||||
mkdir -p ~/build
|
|
||||||
for name in docker-reverse-proxy
|
rm -rf ~/build
|
||||||
do
|
mkdir -p ~/build
|
||||||
sudo -E docker run --rm -e SWIFT_USERNAME=$OS_USERNAME \
|
for name in docker-reverse-proxy
|
||||||
-e SWIFT_PASSWORD=$OS_PASSWORD \
|
do
|
||||||
-e SWIFT_AUTHURL=$OS_AUTH_URL \
|
sudo -E docker run --rm -e SWIFT_USERNAME=$OS_USERNAME \
|
||||||
-e SWIFT_AUTHVERSION=$OS_IDENTITY_API_VERSION \
|
-e SWIFT_PASSWORD=$OS_PASSWORD \
|
||||||
-e SWIFT_TENANTNAME=$OS_TENANT_NAME \
|
-e SWIFT_AUTHURL=$OS_AUTH_URL \
|
||||||
-e SWIFT_REGIONNAME=$OS_REGION_NAME \
|
-e SWIFT_AUTHVERSION=$OS_IDENTITY_API_VERSION \
|
||||||
-e PASSPHRASE=$PASSPHRASE \
|
-e SWIFT_TENANTNAME=$OS_TENANT_NAME \
|
||||||
--name backup-restore -v ~/build:/mnt/build --entrypoint /bin/bash duplicity:latest \
|
-e SWIFT_REGIONNAME=$OS_REGION_NAME \
|
||||||
-c "duplicity restore --name bootstrap --file-to-restore ${name}.tar.gz swift://bootstrap /mnt/build/${name}.tar.gz"
|
-e PASSPHRASE=$PASSPHRASE \
|
||||||
tar -xzf ~/build/${name}.tar.gz -C ~/build/
|
--name backup-restore -v ~/build:/mnt/build --entrypoint /bin/bash duplicity:latest \
|
||||||
done
|
-c "duplicity restore --name bootstrap --file-to-restore ${name}.tar.gz swift://bootstrap /mnt/build/${name}.tar.gz"
|
||||||
|
tar -xzf ~/build/${name}.tar.gz -C ~/build/
|
||||||
# --force-recreate is used to recreate container when crontab file has changed
|
done
|
||||||
unset VERSION_PROXY
|
|
||||||
cd ~/build/docker-reverse-proxy; export VERSION_PROXY=$(git show-ref --head| head -1 | cut -f 1|cut -c -10)
|
# --force-recreate is used to recreate container when crontab file has changed
|
||||||
cd $SCRIPTPATH
|
unset VERSION_PROXY
|
||||||
|
cd ~/build/docker-reverse-proxy; export VERSION_PROXY=$(git show-ref --head| head -1 | cut -f 1|cut -c -10)
|
||||||
|
cd $SCRIPTPATH
|
||||||
|
else
|
||||||
|
unset VERSION_PROXY
|
||||||
|
export VERSION_PROXY=$(git ls-remote https://git.scimetis.net/yohan/docker-reverse-proxy.git| head -1 | cut -f 1|cut -c -10)
|
||||||
|
rm -rf ~/build
|
||||||
|
mkdir -p ~/build
|
||||||
|
git clone https://git.scimetis.net/yohan/docker-reverse-proxy.git ~/build/docker-reverse-proxy
|
||||||
|
fi
|
||||||
sudo docker build -t reverse-proxy:$VERSION_PROXY ~/build/docker-reverse-proxy
|
sudo docker build -t reverse-proxy:$VERSION_PROXY ~/build/docker-reverse-proxy
|
||||||
|
|
||||||
sudo -E bash -c 'docker-compose up --no-start --force-recreate'
|
sudo -E bash -c 'docker-compose up --no-start --force-recreate'
|
||||||
|
Loading…
Reference in New Issue
Block a user