Repository navigation
chore(deps): install plugin dependencies with one script - #1128
Merged
Merged
Conversation
Replace the cd chains in install-ssp and update-ssp with scripts/local-deps.sh, which runs composer and npm in each web/app/plugins/cbf-* plugin. The semantic glossary plugins now get their npm dependencies too, and cbf-multisite's own npm hooks go. Plugins follow root --no-dev, and npm is skipped under --no-dev and in CI, which builds assets separately. Failures now stop the run instead of being ignored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
install-sspandupdate-sspwalked the plugins with a chain ofcdcommands, listing each plugin by hand. Only cbf-multisite installed its npm dependencies, through its own hooks, and|| truehid any npm failure. The chain also installed each plugin's dev dependencies on the servers, even under the deploy'scomposer install --no-dev.Change
scripts/local-deps.sh install|updaterunscomposer(with--working-dir) andnpm(with--prefix) in everyweb/app/plugins/cbf-*plugin that has acomposer.jsonorpackage.json. New plugins are picked up without editing a list.post-install-cmdandpost-update-cmdcall it, through thelocal-deps:installandlocal-deps:updatescripts.COMPOSER_DEV_MODE), so the servers get--no-dev. The only plugin dev dependency iscomposer/installers, which has no effect on plugins installed in place.--no-dev(the servers), in CI (assets are built in their own step in deploy-application.yml), and when npm isn't installed.>line names the plugin.npm install || trueandnpm update || truehooks are removed, and the deploy-push.yml comment is updated.Testing
Ran
composer run-script post-install-cmdlocally:--no-dev: each plugin installed without dev dependencies, no npmCI=1: each plugin installed with dev dependencies, no npmnpm installin each plugin with a package.json, lockfiles unchangedThe
updatepath wasn't run, to avoid rewriting the lockfiles; it's the same loop.