feat(container): pre-up フックを追加してビルド前のリポジトリ clone 等を可能に#10
Merged
Conversation
`devbase up` 開始直後(`_ensure_env_files` の後・`_ensure_images` の前)に、 プロジェクト直下に `pre-up` 実行可能ファイルがあれば bash で実行する。 `build.context` に外部リポジトリを指定したいプロジェクトで、`docker compose up` より前にリポジトリ clone を完了させるためのフックポイントとして用意した。 既存の `./deploy` がコンテナ起動「後」に走るのに対し、`./pre-up` は起動「前」に 走るため、対称な命名としている。 - 非ゼロ終了で `devbase up` を中断(`deploy` は失敗しても続行する設計と区別) - ドキュメント (`docs/plugin-dev/quickstart.md`) に `pre-up` / `deploy` の ライフサイクル比較表とサンプルを追記 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
devbase up開始直後(_ensure_env_filesの後・_ensure_imagesの前)に、プロジェクト直下に実行可能な./pre-upがあれば bash で実行するフックを追加。build.contextに外部リポジトリを指定したいプロジェクトで、docker compose upより前に repo clone を完了させるためのフックポイント。devbase upを中断する(コンテナ起動後に走る./deployが失敗しても続行する設計とは対照的)。docs/plugin-dev/quickstart.mdにpre-up/deployのライフサイクル比較表とサンプルを追記。Test plan
./pre-upが無いプロジェクトでdevbase upが従来通り動作する./pre-upが成功するプロジェクトでdocker compose up前にフックが実行される./pre-upが非ゼロ終了したときdevbase upが中断され、後続の_ensure_images等が走らない./pre-up内でgit cloneを行い、build.contextがそのパスを参照するシナリオで正常にビルドできる