better args parsing for docker
This commit is contained in:
parent
9a53a6914b
commit
554d9383bc
1 changed files with 18 additions and 8 deletions
26
generate.sh
26
generate.sh
|
@ -31,6 +31,7 @@ defaultLang="fr"
|
|||
header="header.html"
|
||||
footer="footer.html"
|
||||
org=0
|
||||
testDocker=0
|
||||
|
||||
################################################################################
|
||||
# Génère un message d'aide
|
||||
|
@ -78,14 +79,7 @@ do
|
|||
exit 0
|
||||
;;
|
||||
"-t") # lancer un docker de test
|
||||
docker build . --tag site && echo -e \
|
||||
"\n\033[32mSite de test déployé sur l'adresse" \
|
||||
"localhost:8080\033[0m" || exit 1
|
||||
echo -e "\033[32mC-c pour quitter\033[0m\n"
|
||||
|
||||
docker run --rm -p 8080:80 site
|
||||
docker rmi site
|
||||
exit 0
|
||||
testDocker=1
|
||||
;;
|
||||
"-d") ;&
|
||||
"-n")
|
||||
|
@ -133,6 +127,22 @@ function generate_header {
|
|||
echo -e " </div>\n" >> $tmpHeader
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if [ $testDocker -eq 1 ]
|
||||
then
|
||||
docker build . --tag site && echo -e \
|
||||
"\n\033[32mSite de test déployé sur l'adresse" \
|
||||
"localhost:8080\033[0m" || exit 1
|
||||
echo -e "\033[32mC-c pour quitter\033[0m\n"
|
||||
|
||||
docker run --rm -p 8080:80 site
|
||||
docker rmi site
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -d $target ]
|
||||
then
|
||||
# TODO demander à l'utilisateur
|
||||
|
|
Loading…
Reference in a new issue