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

[docker_test.sh] Manage special condition where folder is present before...

[docker_test.sh] Manage special condition where folder is present before pulling but not secret files
parent dfbae798
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,18 @@ usage() {
exit 1
}
create_dumb_secrets() {
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
}
if [[ $(hostname) != *"test"* ]]; then
echo "ERROR : DO NOT USE OUTSIDE OF A TEST MACHINE !"
usage
......@@ -33,6 +45,7 @@ if [[ -d "$1" ]]; then
cd "$1"
echo -e "\n==== Stop and remove existing containers ===="
create_dumb_secrets()
docker-compose down
cd ..
else
......@@ -59,15 +72,7 @@ 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
create_dumb_secrets()
echo -e "\n==== Replace production URL with testing URL in all files ===="
for f in $(grep -l -r ".picasoft.net" .); do
......
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