# 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.
