chore(ci): bootstrap CI + hooks
Some checks failed
CI / checks (push) Has been cancelled
CI / checks (pull_request) Has been cancelled

Squash-merge bootstrap-cicd into integration
This commit is contained in:
2025-09-10 21:48:32 +00:00
parent 575b33f744
commit 408db0d0cc
19 changed files with 671 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
Bootstrap CI/CD Finalized Instructions (Phase 1)
Goal
- Provide Dockeronly local checks and Git hooks with parity to future CI. CI workflows are prepared but may remain disabled until runners are ready.
Requirements
- Docker + Docker Compose v2 on the development machine. No host packages beyond Docker are required.
Local Checks
- Entry point: `scripts/ci <phase>` where phase ∈ {format, lint, build, test, security, all}.
- Always runs inside the ci container using `docker/ci.compose.yml`.
- Tools pinned in `ci.Dockerfile`: shfmt, shellcheck, hadolint, yamllint, actionlint, prettier, markdownlint, commitlint.
Hooks
- Install hooks: `make hooks-setup` (copies .githooks/* into .git/hooks).
- pre-commit: runs format + lint.
- commit-msg: runs commitlint (Conventional Commits).
- pre-push: runs build; test and security are present but currently noops.
Convenience Targets
- `make quick` → format + lint.
- `make check` → all phases.
- `make build` → compose validation.
CI (Prepared, optional enablement later)
- .gitea/workflows/ci.yml: builds ci image; runs lint + build.
- .gitea/workflows/release.yml: on pushes to main, creates annotated tag vYYYY.MM.DD-HHMM (UTC).
- .gitea/workflows/nightly.yml: nightly lint run.
- All jobs run inside the ci image; no runner host package installs.
Protected Checks (when CI is enabled)
- Protect: ci / lint, ci / build, ci / commitlint. Add ci / test and ci / security when they exist.
Future Extensions
- Add tests/security phases per repo stack; enable CI branch protections once runners are ready; optionally add pre-commit framework as an alternative to native hooks.

View File

@@ -0,0 +1,36 @@
Git Workflow Finalized Instructions
Scope
- Applies to this repo. Users typically consume tagged releases; contributors work via branches/PRs. CI/CD config is Giteanative; no GitHub/GitLab.
Branches
- main: production; default branch. Protected.
- integration: development (unprotected; merges auto on green).
- Working branches: `feature/<topic>`, `fix/<topic>`, `chore/<topic>` from integration.
- Hotfix: `hotfix/<date>` from main; PR back to main, then forward-merge into integration.
- Release branch: ephemeral or lightweight `release/*`. Protect when present; optionally fastforward to latest tag via CI.
Merges & Approvals
- Feature → integration: squash merge; automerge on green (no human approval). Selfmerge allowed.
- integration → main: squash merge; require 1 approval; selfmerge not allowed.
- Force pushes disabled on protected branches (`main`, `release/*`); PRs required.
Commit Style
- Conventional Commits for PR titles and commit messages.
Versioning & Tags
- Calendar tags: vYYYY.MM.DD-HHMM (UTC). Annotated tags only on main after release.
Release Flow
1) Feature branches PR into integration; checks pass → automerge.
2) PR integration → main; 1 approval required; on merge, deploy and tag release.
3) Optional: CI fastforwards a release branch pointer to the new tag.
Protected Checks (to enable when runners are ready)
- On protected branches (`main`, `release/*`): ci / lint, ci / build, ci / commitlint. Add ci / test and ci / security if/when introduced.
CODEOWNERS
- Keep minimal; require your review for integration → main.
Notes
- No secrets required for this repo. Future repos should integrate Vault for secrets.