Mise à jour de wrapper.sh
This commit is contained in:
parent
795340a75c
commit
662cd77c2b
9
wrapper.sh
Executable file → Normal file
9
wrapper.sh
Executable file → Normal file
@ -2,7 +2,7 @@
|
||||
|
||||
###### Seules variables à modifier ######
|
||||
export GIREF_HOSTNAME=votre_machine
|
||||
export VOLUME=le_dossier_a_monter
|
||||
export VOLUMES=les_dossier_a_monter:separes_par:deux_points
|
||||
export VPN_USER=votre_idul
|
||||
export USER_ID=id_user_giref
|
||||
export GROUPE_ID=id_groupe
|
||||
@ -15,7 +15,7 @@ editeCompose() {
|
||||
if [ ! -f docker-compose-template.yml ]; then
|
||||
echo "Erreur, fichier docker-compose-template.yml introuvable, l'avez-vous supprimer ?"
|
||||
else
|
||||
cp docker-compose-template.yml docker-compose.yml
|
||||
cp -f docker-compose-template.yml docker-compose.yml
|
||||
IFS=':' arrVOLUMES=($VOLUMES); unset IFS
|
||||
for i in "${arrVOLUMES[@]}"
|
||||
do
|
||||
@ -28,7 +28,6 @@ editeCompose() {
|
||||
|
||||
export VPN_SERVER=vpn.ulaval.ca
|
||||
if [ "$1" == "up" ]; then
|
||||
rm -rf docker-compose.yml
|
||||
editeCompose
|
||||
echo "Veuillez rentrer votre mot de passe pour ${VPN_SERVER} :"
|
||||
read -s password
|
||||
@ -36,14 +35,16 @@ if [ "$1" == "up" ]; then
|
||||
docker-compose up -d
|
||||
echo -e "Vous pouvez vous connecter à \e[94mhttp://${GIREF_HOSTNAME}/theia/\e[39m (Attention, le / à la fin est important)"
|
||||
elif [ "$1" == "down" ]; then
|
||||
editeCompose
|
||||
echo "Arrêt de theia..."
|
||||
export VPN_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
|
||||
docker-compose down
|
||||
elif [ "$1" == "build" ]; then
|
||||
editeCompose
|
||||
export VPN_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
|
||||
docker-compose build theia
|
||||
else
|
||||
echo "Le script doit prendre un des arguments suivants: up, down, build, config"
|
||||
echo "Le script doit prendre un des arguments suivants: up, down, build"
|
||||
fi
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user