1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

WIP: migrate yq commands to V4

This commit is contained in:
Sylvain 2021-02-24 17:00:33 +01:00
parent 120c9144bb
commit 8cfd2d1694
2 changed files with 9 additions and 9 deletions

View File

@ -147,7 +147,7 @@ prepare_files()
}
yq() {
docker run --rm -i -v "${FABMANAGER_PATH}:/workdir" mikefarah/yq yq "$@"
docker run --rm -i -v "${FABMANAGER_PATH}:/workdir" mikefarah/yq:4 "$@"
}
prepare_nginx()
@ -160,16 +160,16 @@ prepare_nginx()
else
# if nginx is not installed, remove its associated block from docker-compose.yml
echo "Removing nginx..."
yq d -i docker-compose.yml services.nginx
yq -i eval 'del(.services.nginx)' docker-compose.yml
read -rp "Do you want to map the Fab-manager's service to an external network? (Y/n) " confirm </dev/tty
if [ "$confirm" != "n" ]; then
echo "Adding a network configuration to the docker-compose.yml file..."
yq w -i docker-compose.yml networks.web.external true
yq w -i docker-compose.yml networks.db ''
yq w -i docker-compose.yml services.fabmanager.networks[+] web
yq w -i docker-compose.yml services.fabmanager.networks[+] db
yq w -i docker-compose.yml services.postgres.networks[+] db
yq w -i docker-compose.yml services.redis.networks[+] db
yq -i eval '.networks.web.external = "true"' docker-compose.yml
yq -i eval '.networks.db = ""' docker-compose.yml
yq -i eval '.services.fabmanager.networks += ["web"]' docker-compose.yml
yq -i eval '.services.fabmanager.networks += ["db"]' docker-compose.yml
yq -i eval '.services.postgres.networks += ["db"]' docker-compose.yml
yq -i eval '.services.redis.networks += ["db"]' docker-compose.yml
fi
fi
}

View File

@ -28,7 +28,7 @@ parseparams()
}
yq() {
docker run --rm -i -v "${PWD}:/workdir" mikefarah/yq yq "$@"
docker run --rm -i -v "${PWD}:/workdir" mikefarah/yq:3 "$@"
}
jq() {