Skip to content
Snippets Groups Projects
Verified Commit 11f52311 authored by Quentin Duchemin's avatar Quentin Duchemin
Browse files

[docker_test.sh] Add logic for new services

parent 52c0d18d
No related branches found
No related tags found
No related merge requests found
......@@ -24,29 +24,21 @@ if [[ $# -ne 1 ]]; then
usage
fi
if [[ ! -d "$1" ]]; then
echo "ERROR : directory does not exist ($1)"
usage
fi
# Go to the folder of the service which will be tested
cd "$1"
echo -e "Starting procedure for \033[31m$1\e[0m..."
if [[ -d secrets ]]; then
cd secrets
echo -e "\n==== Create dumb secret files ===="
for f in *.secrets.example; do
echo -e "\tFile $1/secrets/$(basename -- "$f" .secrets.example).secrets created"
cp -- "$f" "$(basename -- "$f" .secrets.example).secrets"
done
# In case the Docker Compose changed since latest local commit,
# we need to set all down before pulling
if [[ -d "$1" ]]; then
# Go to the folder of the service which will be tested
cd "$1"
echo -e "\n==== Stop and remove existing containers ===="
docker-compose down
cd ..
else
echo "WARNING : directory does not exist ($1) ; will try to pull"
fi
echo -e "\n==== Stop and remove existing containers ===="
docker-compose down
echo -e "\n==== RESET HARD and pull Dockerfiles repository ===="
echo -e "Using branch \033[31m $(git rev-parse --abbrev-ref HEAD)\e[0m, is this correct ? [y/N]"
read ans
......@@ -59,6 +51,24 @@ else
exit 0
fi
if [[ -d "$1" ]]; then
echo "ERROR : directory does not exist ($1)"
usage
exit 1
fi
cd "$1"
if [[ -d secrets ]]; then
cd secrets
echo -e "\n==== Create dumb secret files ===="
for f in *.secrets.example; do
echo -e "\tFile $1/secrets/$(basename -- "$f" .secrets.example).secrets created"
cp -- "$f" "$(basename -- "$f" .secrets.example).secrets"
done
cd ..
fi
echo -e "\n==== Replace production URL with testing URL in all files ===="
for f in $(grep -l -r ".picasoft.net" .); do
echo -e "\tFound in" ${f}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment