ansible-galaxy
ansible-galaxy copied to clipboard
Rebuild client only when needed
Should the make client be handled by as part of calling scripts/common_startup.sh instead of invoked directly ? common_startup.sh has some smart logic to not rebuild the client if there are no changes since the last build and reimplement it in this role doesn't seem to make a lot of sense.
fwiw the logic is
if git diff --quiet "$(cat static/client_build_hash.txt)" -- client/ config/plugins/visualizations/; then
echo "The Galaxy client build is up to date and will not be rebuilt at this time."
SKIP_CLIENT_BUILD=1
else
echo "The Galaxy client is out of date and will be built now."
fi
common_startup.sh does too much stuff to just call it (imo), deconstructing it gives the role more power and also makes it much easier to debug when some part of it goes wrong.
That said, if we wanted to make it an option (much like we do with the "deconstructed client build" (there is an option to run the individual steps of make client-production-maps), that would be ok.
What about splitting up the reusable parts of common_startup.sh in smaller scripts that the role can reuse?
The goal be to not reinvent the wheel in 2 separate places.
it'd also be more version agnostic that way
Probably worth mentioning here that I'd like to split it out to be able to check individual plugins as well.
So, instead of checking a single build hash for everything, having one for the primary client, one for each of the plugins in config/plugins/visualizations/, with those being individually comparable and buildable.
What about splitting up the reusable parts of
common_startup.shin smaller scripts that the role can reuse?
This is better, and I am on board with the idea of deduplication, but I still find it's clearer to understand what's failed when using proper Ansible modules rather than running command a bunch of times.