ansible-galaxy icon indicating copy to clipboard operation
ansible-galaxy copied to clipboard

Rebuild client only when needed

Open nsoranzo opened this issue 5 years ago • 6 comments

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.

nsoranzo avatar Mar 04 '20 08:03 nsoranzo

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

mvdbeek avatar Mar 04 '20 08:03 mvdbeek

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.

natefoo avatar Mar 04 '20 11:03 natefoo

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.

nsoranzo avatar Mar 04 '20 13:03 nsoranzo

it'd also be more version agnostic that way

mvdbeek avatar Mar 04 '20 13:03 mvdbeek

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.

dannon avatar Mar 04 '20 13:03 dannon

What about splitting up the reusable parts of common_startup.sh in 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.

natefoo avatar Mar 04 '20 13:03 natefoo