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

[Test] Do not pull nor reset and keep the script idempotent

This was annoying when testing stuff directly on pica01-test without having a commit.
parent cb075d9a
No related branches found
No related tags found
No related merge requests found
......@@ -51,24 +51,10 @@ if [[ -d "$1" ]]; then
echo -e "\n==== Stop and remove existing containers and volumes ===="
docker-compose down -v
else
echo "WARNING : directory does not exist ($1) ; will try to pull"
fi
echo -e "\n==== Pull Dockerfiles repository ===="
echo -e "Using branch \033[31m $(git rev-parse --abbrev-ref HEAD)\e[0m, is this correct ? [y/N]"
read ans
if [ $ans == "y" ]; then
git pull
cd ${REPO_PATH}/$1
git checkout -- .
else
echo "Aborting."
exit 0
echo "Error : directory does not exist ($1)"
exit 1
fi
create_dumb_secrets
echo -e "\n==== Remove and re-create named external volumes ===="
for v in $(docker-compose config --volumes); do
res=$(grep $v -A 1 docker-compose.yml | grep 'external' || true)
......@@ -93,7 +79,11 @@ docker-compose build
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}
# Revert old changes so the script is idempotent
sed -i "s/.test.picasoft.net/.picasoft.net/g" ${f}
# Apply again
sed -i "s/.picasoft.net/.test.picasoft.net/g" ${f}
# And revert for the registry which is always the production one
sed -i "s/registry.test.picasoft.net/registry.picasoft.net/g" ${f}
done
......
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