feat: Implement intelligent dry-run logic for portracker and update standards
This commit is contained in:
@@ -18,6 +18,12 @@ This document outlines the mandatory standards for services managed in this repo
|
||||
## 3. Deployment and Setup
|
||||
- **Idempotent Scripts**: Every service must include a `create_<service>_folders.sh` script.
|
||||
- **Setup Documentation**: Every service folder must contain a `SETUP.md` file documenting the end-to-end flow, highlighting manual pre-setup steps (user creation, ID lookup).
|
||||
- **Intelligent Dry-Run Mode**: Scripts must support a dry-run mode (default) that compares current system state with target state:
|
||||
- If a folder exists, report it as "existing" with the phrase "no changes will be made".
|
||||
- If owner/permissions already match, report as "matched" with current state and the phrase "no changes will be made".
|
||||
- If a target folder does not exist yet during a dry-run check, report ownership/permissions as "WILL SET upon creation".
|
||||
- **Recursion**: For recursive operations (`chown -R`, `chmod -R`), dry-run must verify all nested items and report if any deviate from the target state.
|
||||
- **Execute Instructions**: The dry-run output must clearly instruct the user how to apply the changes (e.g., "To apply changes, run: sudo bash $0 --run").
|
||||
- **Script Requirements**:
|
||||
- Must use `mkdir -p` to handle existing directories.
|
||||
- Must set correct ownership (`chown`) and permissions (`chmod`) based on the service user.
|
||||
|
||||
Reference in New Issue
Block a user