Added no bootstrap install option.

This commit is contained in:
yohan 2020-04-15 16:43:16 +02:00
parent 9a9aa91396
commit bd859d1a2f

View File

@ -6,14 +6,23 @@ SCRIPTPATH=$(dirname $SCRIPT)
cd $SCRIPTPATH
test -z $1 || HOST="_$1"
test -z $2 || INSTANCE="_$2"
if test -z "$1" && [ "$1" != "bootstrap" ] && [ "$1" != "normal" ]
then
echo "First argument must be \"bootstap\" or normal"
exit 1
else
REPO="$1"
fi
test -z $2 || HOST="_$2"
test -z $3 || INSTANCE="_$3"
test -f ~/secrets.tar.gz.enc || { echo "ERROR: ~/secrets.tar.gz.enc not found, exiting."; exit 1; }
openssl enc -aes-256-cbc -d -in ~/secrets.tar.gz.enc \
| sudo tar -zxv --strip 2 secrets/docker-mysql-stack${HOST}${INSTANCE}/debian.cnf \
|| { echo "Could not extract from secrets archive, exiting."; rm -f ~/secrets.tar.gz.enc; exit 1; }
sudo chown root. debian.cnf
if [ "$REPO" == "bootstrap" ]
then
test -f ~/openrc.sh || { echo "ERROR: ~/openrc.sh not found, exiting."; exit 1; }
source ~/openrc.sh
export OS_REGION_NAME=GRA
@ -41,6 +50,13 @@ done
unset VERSION_MYSQL
DIRECTORY=$(pwd)
cd ~/build/docker-mysql; export VERSION_MYSQL=$(git show-ref --head| head -1 | cut -f 1|cut -c -10); cd $DIRECTORY
else
unset VERSION_MYSQL
export VERSION_MYSQL=$(git ls-remote https://git.scimetis.net/yohan/docker-mysql.git| head -1 | cut -f 1|cut -c -10)
rm -rf ~/build
mkdir -p ~/build
git clone https://git.scimetis.net/yohan/docker-mysql.git ~/build/docker-mysql
fi
sudo docker build -t mysql-server:$VERSION_MYSQL ~/build/docker-mysql