fix(deploy): guard prepare hook install so CF staging does not fail - #2222
Merged
Merged
Conversation
The prepare hook (added in 8febee6) runs 'sh scripts/install-git-hooks.sh' on every npm install, including the CF buildpack compile phase. cds build carries the prepare/setup:git-hooks scripts into gen/srv/package.json but does NOT copy scripts/install-git-hooks.sh, so staging aborts with 'cannot open scripts/install-git-hooks.sh: No such file' -> BuildpackCompileFailed. This broke both last night's PROD deploy and today's DEV deploy. Guard setup:git-hooks to no-op when the dev-only script is absent (CF artifact), while preserving local behavior when it's present.
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.
Root cause
Both last night's PROD emergency deploy and today's DEV deploy failed at CF staging with:
The
preparehook was wired in8febee66(CI-structure change).prepareruns on every npm install, including the CF buildpack compile phase.cds build --productioncarries theprepare/setup:git-hooksscripts intogen/srv/package.jsonbut does not copy the dev-only shell script, so staging aborts.Fix
Guard
setup:git-hooksto no-op when the dev-only install script is absent (the CF artifact), preserving local dev behavior when present.Verification
package.jsonvalid JSONDeploy-blocking. Needs to reach main too for the PROD retry (main == DEV currently).