: nply/minci

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
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.