commit 6c7f6d9779ebeae5067ffa3b12395b140014b262
parent 0527610a5ac9ed04ef9daa1a2d60884ec4bffbb1
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Mon, 14 Sep 2026 20:30:43 +0530
parent 0527610a5ac9ed04ef9daa1a2d60884ec4bffbb1
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Mon, 14 Sep 2026 20:30:43 +0530
Document minci deployment trigger model
2 files changed, 139 insertions(+), 0 deletions(-)
A
|
80
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/evals/001-secure-jobfile-branch.md b/evals/001-secure-jobfile-branch.md @@ -0,0 +1,59 @@ +# Secure Jobfile branch for deployed projects + +## Context + +Some projects should be built and deployed by minci without storing deployment +commands, host names, or artifact publishing paths on the application's normal +release branch. The runner already supports this separation with two existing +configuration knobs: + +- `branch` selects the repository branch that minci fetches, resets to, tests, + packages, and deploys. +- `jobfile` selects an explicit Jobfile path to source instead of the checked-out + `.config/Jobfile`. + +## Intended usage + +For projects such as `movements`, keep the deployment Jobfile on a separate +integration branch, but make that Jobfile react to pushes on the application +branch that is actually deployed: + +```sh +# ~/.minci or /etc/minci on the runner +repo = git@nply.org:asapien/movements.git +branch = main +jobfile = /path/to/secure/movements/.config/Jobfile +``` + +The secure Jobfile can live in a local checkout of the project's `integ` branch +(or another operator-controlled path), while its triggers name the deployed ref: + +```sh +project=movements +triggers="refs/heads/main: lint package deploy" +``` + +With that arrangement, minci sources the protected Jobfile, but all job +functions run with `srcdir` set to the freshly checked out `main` tree. Artifacts +and deployments are therefore produced from `main`, not from the branch that +stores the Jobfile. + +## Evaluation + +This keeps operational deployment logic out of the deployed application branch +while preserving normal minci semantics: + +1. A push to `main` is the deployable event. +2. The Jobfile remains operator-controlled on `integ` or an explicit local path. +3. Artifact names and deployment contents are derived from `$FETCH_HEAD` for + `main`. +4. No server-side route or minci protocol change is required. + +## Failure modes to avoid + +- Do not set `triggers` to `refs/heads/integ` unless the `integ` branch itself is + intended to be built/deployed. +- Do not archive or rsync the Jobfile branch when deploying the application; use + `$FETCH_HEAD` from the checked-out `branch`. +- Do not depend on `.config/Jobfile` being present on `main` when `jobfile` is + configured externally.
diff --git a/evals/002-minci-run-start-and-gitolite-hooks.md b/evals/002-minci-run-start-and-gitolite-hooks.md @@ -0,0 +1,80 @@ +# Minci run start and gitolite hook adapter report + +## Summary + +This pass checked the existing gitolite hook layout on `cdg-1`, added a generic +minci adapter beside the existing mirror adapter, and added minci support for +operator-held Jobfiles and web-requested run starts. + +## Hook installation on `cdg-1` + +Gitolite is using the admin repository's local hook directory: + +- `LOCAL_CODE => $rc{GL_ADMIN_BASE}/local` +- repository `post-receive` hooks are symlinks to + `/home/git/.gitolite/local/hooks/common/post-receive` +- repo-specific hook support remains commented out in `.gitolite.rc` + +Observed common hooks: + +- `/home/git/.gitolite/hooks/common/update` +- `/home/git/.gitolite/hooks/gitolite-admin/post-update` +- `/home/git/.gitolite/local/hooks/common/post-receive` +- `/home/git/.gitolite/local/hooks/multi-hook-driver` + +The new adapter does not conflict with repo-local hooks because gitolite's +repo-specific hooks feature is not enabled. The active `post-receive` path is +the common local hook symlink installed by gitolite setup. + +## Adapter behaviour + +The common `post-receive` hook stays repository-agnostic: + +- mirroring runs only when `gitolite.mirror.simple` is configured; +- minci offload runs only when `gitolite.minci = true` is configured. + +This keeps the hook as an adapter. Repository selection remains in gitolite +configuration, not in shell conditionals embedded in the hook. + +## Minci changes + +The minci runner now supports `/etc/minci.d/<repo>/Jobfile` when no explicit +`jobfile` is set. This allows the tested/deployed branch to remain clean while +operators keep deployment Jobfiles outside that branch. + +The web UI can write start requests for a project or job and attempts to start +the runner command compiled into `RUNNER`. On `cdg-1`, the deployed binary was +compiled with: + +```text +RUNNER=/usr/local/sbin/minci-submit +``` + +The wrapper uses sudo to execute `/usr/local/bin/minci.sh` as the `git` user. + +## Movements run + +`movements` was added to the runner configuration and minci database on `cdg-1`. +The deployment Jobfile is installed at: + +```text +/etc/minci.d/movements/Jobfile +``` + +The build/deploy run completed successfully: + +- `movements/lint`: pass +- `movements/package`: pass +- `movements/deploy`: pass + +The deploy job published to `ops.saikrupagas.com` and verified +`includes/navigation.php` with `php -l`. + +## Caveat + +A direct CGI POST reliably creates the start marker. The runner wrapper itself +also works when invoked as `www-data`. During verification, the FastCGI request +path did not visibly invoke the wrapper, so gitolite push-triggered offload is +the confirmed reliable trigger path at this point. The web start form remains a +queue/start integration point, but should be rechecked under FastCGI process +manager constraints before relying on it as the only trigger.
: nply/minci