1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

[bug] unable to compile the assets during the upgrade

This occurs only if the env file has some whitespaces around the equal sign
This commit is contained in:
Sylvain 2021-03-08 17:08:07 +01:00
parent a53a6ba0ea
commit 05b2f10bec
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,8 @@
# Changelog Fab-manager
## Next release
- Fix a bug: unable to compile the assets during the upgrade, if the env file has some whitespaces around the equal sign
## v4.7.4 2021 March 08
- Show remaining training credits in the dashboard
- Allow writing short rich descriptions for each subscription plan

View File

@ -95,6 +95,12 @@ add_environments()
done
}
clean_env_file()
{
# docker run --env-file does not support whitespaces in the environment variables so we must clean the file
sed -ri 's/^([A-Z0-9_]+)\s*=\s*(.*)$/\1=\2/g' ./config/env
}
compile_assets()
{
IMAGE=$(yq eval '.services.*.image | select(. == "sleede/fab-manager*")' docker-compose.yml)
@ -106,6 +112,7 @@ compile_assets()
exit 1
fi
PG_NET_ID=$(docker inspect "$PG_ID" -f "{{json .NetworkSettings.Networks }}" | jq -r '.[] .NetworkID')
clean_env_file
# shellcheck disable=SC2068
docker run --rm --env-file ./config/env ${ENV_ARGS[@]} --link "$PG_ID" --net "$PG_NET_ID" -v "${PWD}/public/new_packs:/usr/src/app/public/packs" "$IMAGE" bundle exec rake assets:precompile
docker-compose down