mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-19 13:54:25 +01:00
[bug] script to mount payment-schedules volume results in invalid yml file
+ improved scripts for mounting volumes + increased verbosity of upgrade script
This commit is contained in:
parent
021c019ba4
commit
303c0a0ba8
@ -2,6 +2,9 @@
|
||||
|
||||
## Next release
|
||||
- Allow inserting hyperlinks in customized info messages
|
||||
- Improved scripts for mounting volumes
|
||||
- Increased verbosity of upgrade script
|
||||
- Fix a bug: mounting the payment-schedules volume in the docker-compose file results in an invalid file
|
||||
|
||||
## v4.7.3 2021 March 03
|
||||
- Improved the setup script
|
||||
|
@ -18,9 +18,11 @@ config()
|
||||
|
||||
add_mount()
|
||||
{
|
||||
# shellcheck disable=SC2016
|
||||
# we don't want to expand ${PWD}
|
||||
yq -i eval ".services.$SERVICE.volumes += [\"\${PWD}/payment_schedules:/usr/src/app/payment_schedules\"]" docker-compose.yml
|
||||
if [[ ! $(yq eval ".services.$SERVICE.volumes.[] | select (. == \"*payment_schedules\")" docker-compose.yml) ]]; then
|
||||
# shellcheck disable=SC2016
|
||||
# we don't want to expand ${PWD}
|
||||
yq -i eval ".services.$SERVICE.volumes += [\"\${PWD}/payment_schedules:/usr/src/app/payment_schedules\"]" docker-compose.yml
|
||||
fi
|
||||
}
|
||||
|
||||
proceed()
|
||||
|
@ -18,8 +18,10 @@ config()
|
||||
|
||||
change_mount()
|
||||
{
|
||||
yq -i eval ".services.$SERVICE.volumes.[] | select(. == \"*assets\") |= \"\${PWD}/public/packs:/usr/src/app/public/packs\"" docker-compose.yml
|
||||
echo "Service volume was replaced for $SERVICE: /assets changed to /packs"
|
||||
if [[ $(yq eval ".services.$SERVICE.volumes.[] | select (. == \"*assets\")" docker-compose.yml) ]]; then
|
||||
yq -i eval ".services.$SERVICE.volumes.[] |= select(. == \"*assets\") |= \"\${PWD}/public/packs:/usr/src/app/public/packs\"" docker-compose.yml
|
||||
echo "Service volume was replaced for $SERVICE: /assets changed to /packs"
|
||||
fi
|
||||
}
|
||||
|
||||
proceed()
|
||||
|
@ -87,6 +87,7 @@ add_environments()
|
||||
{
|
||||
for ENV in "${ENVIRONMENTS[@]}"; do
|
||||
if [[ "$ENV" =~ ^[A-Z0-9_]+=.*$ ]]; then
|
||||
printf "Inserting variable %s...\n" "$ENV"
|
||||
printf "# added on %s\n%s\n" "$(date +%Y-%m-%d\ %R)" "$ENV" >> "config/env"
|
||||
else
|
||||
echo "Ignoring invalid option: -e $ENV. Given value is not valid environment variable, please see https://huit.re/environment-doc"
|
||||
@ -125,6 +126,7 @@ upgrade()
|
||||
BRANCH='master'
|
||||
if yq eval '.services.*.image | select(. == "sleede/fab-manager*")' docker-compose.yml | grep -q ':dev'; then BRANCH='dev'; fi
|
||||
for SCRIPT in "${SCRIPTS[@]}"; do
|
||||
printf "Running script %s from branch %s...\n" "$SCRIPT" "$BRANCH"
|
||||
if [[ "$YES_ALL" = "true" ]]; then
|
||||
\curl -sSL "https://raw.githubusercontent.com/sleede/fab-manager/$BRANCH/scripts/$SCRIPT.sh" | bash -s -- -y
|
||||
else
|
||||
@ -134,6 +136,7 @@ upgrade()
|
||||
compile_assets
|
||||
docker-compose run --rm "$SERVICE" bundle exec rake db:migrate
|
||||
for COMMAND in "${COMMANDS[@]}"; do
|
||||
printf "Running command %s...\n" "$COMMAND"
|
||||
docker-compose run --rm "$SERVICE" bundle exec "$COMMAND"
|
||||
done
|
||||
docker-compose up -d
|
||||
|
Loading…
x
Reference in New Issue
Block a user