diff --git a/docker/PYROS_DOCKER_BUILD b/docker/PYROS_DOCKER_BUILD new file mode 100755 index 0000000..da3f587 --- /dev/null +++ b/docker/PYROS_DOCKER_BUILD @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +[ ! -d "../vendor/guitastro/" ] && git clone https://gitlab.irap.omp.eu/guitastrolib/guitastro.git ../vendor/guitastro/ + +export CURRENT_UID=$(id -u) + +if [ $CURRENT_UID -eq 0 ] +then +echo "You can't run this script as root, use a normal user" +exit 1 +else +docker compose build +fi + diff --git a/docker/PYROS_DOCKER_BUILD.sh b/docker/PYROS_DOCKER_BUILD.sh deleted file mode 100755 index da3f587..0000000 --- a/docker/PYROS_DOCKER_BUILD.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -[ ! -d "../vendor/guitastro/" ] && git clone https://gitlab.irap.omp.eu/guitastrolib/guitastro.git ../vendor/guitastro/ - -export CURRENT_UID=$(id -u) - -if [ $CURRENT_UID -eq 0 ] -then -echo "You can't run this script as root, use a normal user" -exit 1 -else -docker compose build -fi - diff --git a/docker/PYROS_DOCKER_INSTALL b/docker/PYROS_DOCKER_INSTALL index 9935b18..72c7d28 100755 --- a/docker/PYROS_DOCKER_INSTALL +++ b/docker/PYROS_DOCKER_INSTALL @@ -3,7 +3,7 @@ # if no container is running if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then echo "pyros-db or pyros weren't running, starting them..." - ./PYROS_DOCKER_START.sh + ./PYROS_DOCKER_START #./PYROS_DOCKER_START.bat fi diff --git a/docker/PYROS_DOCKER_RUN b/docker/PYROS_DOCKER_RUN index 893014d..ecbc464 100755 --- a/docker/PYROS_DOCKER_RUN +++ b/docker/PYROS_DOCKER_RUN @@ -4,7 +4,7 @@ if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] then echo "pyros-db or pyros weren't running, starting them..." - ./PYROS_DOCKER_START.sh + ./PYROS_DOCKER_START #./PYROS_DOCKER_START.bat fi diff --git a/docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY b/docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY index fb9c761..efac61f 100755 --- a/docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY +++ b/docker/PYROS_DOCKER_RUN_WEBSERVER_ONLY @@ -3,7 +3,8 @@ #if no container is running if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] ; then echo "pyros-db or pyros weren't running, starting them..." - ./PYROS_DOCKER_START.bat + ./PYROS_DOCKER_START + #./PYROS_DOCKER_START.bat fi docker compose exec pyros python3 pyros.py -d start webserver $@ diff --git a/docker/PYROS_DOCKER_SHELL b/docker/PYROS_DOCKER_SHELL index 71d5e81..17b057c 100755 --- a/docker/PYROS_DOCKER_SHELL +++ b/docker/PYROS_DOCKER_SHELL @@ -4,7 +4,7 @@ if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] then echo "pyros-db or pyros weren't running, starting them..." - ./PYROS_DOCKER_START.sh + ./PYROS_DOCKER_START #./PYROS_DOCKER_START.bat fi docker compose exec pyros bash $@ diff --git a/docker/PYROS_DOCKER_START b/docker/PYROS_DOCKER_START new file mode 100755 index 0000000..60ade66 --- /dev/null +++ b/docker/PYROS_DOCKER_START @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# We need these variables for the build and when we launch the containers +# But then, we do not need them anymore. Anyway they are referenced in the docker-compose.yml but it does not find them in memory => makes a warning when using the containers... +export CURRENT_UID=$(id -u) +export COMPUTER_HOSTNAME=$HOSTNAME + +echo +echo "First STOP just in case:" +docker compose down --remove-orphans + +echo +echo "Then START:" +# Take docker-compose.yml folder name ("docker") as containers group name in Docker Desktop by default +docker compose up -d +# Change this group name with -p option +#docker compose -p pyros-app up -d + +# See started containers +echo +echo "Started containers for pyros:" +docker ps | grep pyros diff --git a/docker/PYROS_DOCKER_START.sh b/docker/PYROS_DOCKER_START.sh deleted file mode 100755 index 60ade66..0000000 --- a/docker/PYROS_DOCKER_START.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# We need these variables for the build and when we launch the containers -# But then, we do not need them anymore. Anyway they are referenced in the docker-compose.yml but it does not find them in memory => makes a warning when using the containers... -export CURRENT_UID=$(id -u) -export COMPUTER_HOSTNAME=$HOSTNAME - -echo -echo "First STOP just in case:" -docker compose down --remove-orphans - -echo -echo "Then START:" -# Take docker-compose.yml folder name ("docker") as containers group name in Docker Desktop by default -docker compose up -d -# Change this group name with -p option -#docker compose -p pyros-app up -d - -# See started containers -echo -echo "Started containers for pyros:" -docker ps | grep pyros diff --git a/docker/PYROS_DOCKER_TEST b/docker/PYROS_DOCKER_TEST index b997496..8b89dc3 100755 --- a/docker/PYROS_DOCKER_TEST +++ b/docker/PYROS_DOCKER_TEST @@ -4,7 +4,7 @@ if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] then echo "pyros-db or pyros weren't running, starting them..." - ./PYROS_DOCKER_START.sh + ./PYROS_DOCKER_START #./PYROS_DOCKER_START.bat fi docker compose exec pyros python3 pyros.py test $@ diff --git a/docker/PYROS_DOCKER_UPDATE b/docker/PYROS_DOCKER_UPDATE index a12b1f3..f5cc478 100755 --- a/docker/PYROS_DOCKER_UPDATE +++ b/docker/PYROS_DOCKER_UPDATE @@ -4,7 +4,7 @@ if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 4 ] then echo "pyros-db or pyros weren't running, starting them..." - ./PYROS_DOCKER_START.sh + ./PYROS_DOCKER_START #./PYROS_DOCKER_START.bat fi -- libgit2 0.21.2