v1.31.0
guíaPatrón · 08_CICDenglishversión en español

Complete Ovillo CI/CD guide — the /hv:cicd-* workflows and all their variants

12 minlectura
2640palabras
10secciones
2026-09-22última edición
1cambios

For developers. How Ovillo's four CI/CD workflows work and how they behave according to your adoption phase, stack, entrypoints (multi-entrypoint), branching strategy and deployment model.

Platform: Azure DevOps Server 2020 on-premise, with the configured agent pool. Runtime rules: the G1-G19 invariants live in .claude/skills/cicd-runtime/SKILL.md; the platform's constraints are declared in ecosystem.config.json (cicd.platform + cicd.variant).


0. The mental model (read this first)

Three ideas that explain everything else:

  1. Build ≠ deploy. A push to the base branch builds (compile + test + artifact), but it does not deploy. Deploying is a later decision and on demand (/hv:cicd-deploy). "Releasing" a version (/hv:cicd-release) does not deploy either: it only creates the tag and triggers the build.
  2. The agent deploys, not your machine. The commands only queue the pipeline over REST; the MSDeploy to the target IIS runs on a deploy agent that lives on the server itself. Never copy files by hand.
  3. One solution = one repository, but N entrypoints. Each deployable project (Web, API, Console) gets its own pipeline (R25). Routing to the application or services servers is decided by the entrypoint's type.

The four workflows at a glance

CommandWhat it doesWhen
/hv:cicd-initGenerates or updates the pipeline (azure-pipelines.yml + the Azure DevOps definition). A wizard, by phases.Once per project/entrypoint, and when promoting a phase or updating the template.
/hv:cicd-statusShows the state: latest builds, time per stage, coverage, last deployment per environment, template drift.Whenever you want to see how the pipeline is doing.
/hv:cicd-releaseCreates a semver tag + push → triggers the build. It does NOT deploy.When you mark a version as ready.
/hv:cicd-deployRequests the deployment to dev/pre/pro on demand (Azure: the DeployEnv variable · GitHub: gh workflow run -f environment=).When you promote an artifact to an environment.

1. Cross-cutting concepts (this is where "the variants" come from)

1.1 Adoption phases (0 / 1 / 2)

/hv:cicd-init asks for the adoption level (P0). It decides what gets generated:

PhaseNameWhat it generatesCD
0Local onlyJust the docs and manual runbook (RUNBOOK_DEPLOY_MANUAL.md). No Azure DevOps pipeline.No
1Build validationA minimal azure-pipelines.yml: build + test + publish the artifact. One pipeline for the whole solution (CI only).No
2Full CDThe complete pipeline: build + test + gates + one pipeline per entrypoint with deploy stages, triple rollback, variable groups.Yes

Phase 1 = one build pipeline for the solution. The per-entrypoint pipelines with CD (Web→app, API→svc) are phase 2. Promoting 1→2 does not recreate from scratch (idempotence, R14): run /hv:cicd-init again and choose "promote".

See the detail in GUIA_FASES_ADOPCION.md.

1.2 Supported stacks (4 variants)

/hv:cicd-init detects the stack in PHASE 0.1 and generates the right template:

StackDetectionCD toKey notes
.NET SDK-style (dotnet)An SDK-style .csproj, net8/9/10IIS (MSDeploy)Coverage gate G7/R18 (coverage-gate.ps1); per-environment config = a secrets vault or VG injection (R23).
Classic .NET Framework (netfx)packages.config + MVC5/WebApi2, net48IIS (MSDeploy)MSBuild (NuGetCommand@2+VSBuild@1+VSTest@2); per-environment config = Web.<Cfg>.config transforms (R23).
Vue + Vite + TS (vue)package.json + viteIIS (static files)Best-effort smoke (R11); TakeAppOffline:false (R10); always to applications.
.NET tool (nettool)A NuGet tool or libraryNot IISPublishes the .nupkg to an internal feed; no deploy stage (the security gate is informational, R22 N/A).

The table of canonical task versions per stack is in R4.

1.3 Entrypoints and application-vs-services routing (R25)

Each repository = one solution, but it can have several entrypoint projects. /hv:cicd-init detects ALL of them (PHASE 0.1-ter) and generates one pipeline per deployable entrypoint:

Entrypoint typeDetectionCICDTarget server
Web (UI)Microsoft.NET.Sdk.Web with views (or MVC5 netfx)yesyesApplications (public by nature)
Web APIMicrosoft.NET.Sdk.Web without viewsyesyesServices if private (default) · Applications if marked public
Console / WorkerOutputType=Exe without SDK.Web, IHostedServiceyesyesconfigurable (scheduled task; the real pool's DeployTarget, with no fixed app/svc type)
  • In P1-bis the wizard shows the classification and, for each Web/API, asks whether it is public; it stores that in _hilo/ESTADO_PROYECTO.json.infraestructura.cicd[].publico.
  • Routing → serverType (app/svc) → the capability DeployTarget=<env>-<app|svc> (R1, R25).
  • Naming: one entrypoint → azure-pipelines.yml + the definition <PROJECT> (backwards compatible). More than one → azure-pipelines.<slug>.yml + the definition <PROJECT>-<slug>, with trigger.paths narrowed to that entrypoint's subtree.

The real DeployTarget is derived from the pool (R1/FB-002): /hv:cicd-init queries the agents' actual capabilities and maps each environment × type to an existing value (it does not hardcode <env>-<app|svc> if the infrastructure team used a different scheme).

The server inventory (Dev dev01/svc01, Pre demo01/demosvc01, Prod APPNODE*/SVCNODE*) and the capability scheme: the table in R1 plus the handoff in PERMISOS_CICD.md.

1.4 Deployment models (auto / on-demand / branch-gated)

/hv:cicd-init P2-bis asks for the deployment model (phase 2 only). The default is suggested by your branching strategy:

ModelDeployment gateWhen (default)
AutoDEV automatic on push; PRE/PROD with ManualValidation/approvalContinuous CD to DEV, a single branch.
On-demand (R20)DeployEnv=<env> (a push does not deploy)100% on-demand deployment, a single branch (github-flow, trunk-based, ...).
Branch-gated (R24)DeployEnv plus Build.SourceBranchOn demand with branches per environment (gitlab-flow, gitflow).

1.5 Branching strategy → trigger + branch policy (R21)

/hv:cicd-init reads configuracion.branching.estrategia and derives trigger.branches, plus whether to recommend the "Build validation" branch policy (which runs the build on PRs):

Strategytrigger.branches.includeBuild-validation branch policySuggested deploy model
github-flow-simplificado[main]NO (it would block the direct push)on-demand
trunk-based[main]optionalon-demand
developer-branch[{ramaBase}]NOon-demand
github-flow[main]YES (PR gate to main)on-demand
gitflow[main, develop, release/*]YESbranch-gated
release-flow / oneflow[main, release/*]YESon-demand/branch-gated
gitlab-flow[main, pre-production, production]YESbranch-gated

The golden rule: direct-push strategies (github-flow-simplificado, trunk-based, developer-branch) → base branch only + pr: none + no policy (it warns: "do NOT enable build validation, it blocks your direct push"). Strategies with PRs → add the branches and recommend the policy. Always pr: none in the YAML (in Azure DevOps Git the PR triggers are the branch policy, not the YAML's pr:).

1.6 Per-environment configuration and secrets

Stack / caseHowRule
Secrets (all of them)An Azure DevOps variable group (<PIPELINE>-secrets, isSecret) + a pre-build fail-fastR16
netfx, per-environment configurationWeb.<Cfg>.config transforms (one build per environment) + a variable group for the secretsR23
.NET SDK-style with a secrets vaultAddAzureKeyVault(...); the deployment injects nothingR23 (P4-bis)
.NET SDK-style without a secrets vaultVariable group + injection at deploy time through PowerShell (NOT FileTransform@1: it breaks with JSONC and with keys containing dots)R23 (P4-bis)
The quality record's service keyZero-touch: /hv:cicd-init PHASE 2.7 issues it through the Hub and leaves it isSecret in the variable group (it is never printed)R16

1.7 Quality and security gates

  • Coverage (R18): a gate with ops/cicd/scripts/coverage-gate.ps1 -ThresholdLine/-ThresholdBranch (Ovillo's own script, no external tools; dotnet-reportgenerator-globaltool). WARN-first by default (it warns, it does not take the build down); the team raises it to BLOCK once their coverage is stable. ReportGenerator also publishes the CoverageReport HTML as an artifact; CRAP and hotspots go to the Hub's quality record.
  • Security (R22): the verdict-file pattern — the scan runs once in Build (vulnerable dependencies, secrets in config, hardening, Roslyn SAST) and each deploy stage decides: DEV=WARN, DEMO/PROD=BLOCK if the severity is ≥ High.

2. /hv:cicd-init — generate or update the pipeline

This is the central command. An idempotent wizard (R14): running it again breaks nothing.

2.1 Syntax and when to use it

/hv:cicd-init            # interactive wizard (detects stack, entrypoints, phase)

Use it to: create the pipeline, promote a phase (0→1→2), add or modify a stage, or re-render the YAML to the latest template. Do NOT use it to deploy (/hv:cicd-deploy) or to version (/hv:cicd-release).

2.2 The flow (what happens inside)

PHASE 0 — Detection and pre-validation

  • 0.1 Detects the stack (4 variants). If it is a Classic (XAML) .xaml build → it aborts (not supported).
  • 0.1-ter Enumerates all the entrypoints of the solution and classifies them (Web/API/Console).
  • 0.3-bis Brownfield: if there are pre-existing secrets in versioned config, the security gate is generated in mode: warn for PRE/PROD too (it does not block the first pipeline because of older debt; it records SEC-XXX).
  • 0.4 Pre-flight against Azure DevOps: the configured pool (cicd.buildPool) visible, the queue authorized, and so on (the pool's Use permission is granted by the infrastructure team to the project's group — see PERMISOS_CICD.md).
  • 0.5 Idempotence: if azure-pipelines.yml already exists, it goes into edit mode (five options, see 2.3).

PHASE 1 — The wizard (P0-P5)

  • P0 Adoption phase (0/1/2).
  • P1 / P1-bis Confirms the project + the entrypoints, and asks whether each Web/API is public (it stores all N).
  • P2 Environments (phase ≥ 1).
  • P2-bis The deployment model (auto/on-demand/branch-gated; the default follows the branching strategy).
  • P3 A consolidated checklist (trigger, naming, smoke URL, ...) with inferred defaults → you confirm.
  • P4 / P4-bis Variable groups / secrets + per-environment configuration (.NET SDK-style: vault versus VG injection).
  • P5 Summary and final confirmation.

PHASE 2 — Generation

  • Renders the stack's *.yml.template, one pipeline per deployable entrypoint (Console included: CD through a scheduled task).
  • 2.5/2.6 Registers one Azure DevOps definition and one Hub record per entrypoint (register_pipeline, UPSERT).
  • 2.7 (optional, yes by default) Wires up the quality record to the dashboard.
  • 2.8 Self-check (validate-pipeline-complete.ps1) + a template stamp in the YAML header (# Ovillo cicd-architect <stack> @ vX.Y.Z (tpl <hash>)) so drift can be detected later.

2.3 Edit mode (running it again on an already initialized project)

Before the options, it reconciles the entrypoints: it re-detects them and adds to cicd[] any that are missing. Then:

OptionAction
1Add a stage
2Modify a stage
3Regenerate the docs (runbook)
4Update the whole YAML = a FULL re-render from the template (NOT a patch), preserving the # CUSTOM: blocks and the tests' --filter; it ends with the self-check (PHASE 2.8)
5Exit

If /hv:cicd-status warns you about template drift, option 4 is the right way to get up to date.


3. /hv:cicd-status — seeing the state

/hv:cicd-status [--entrypoint <slug>] [--watch] [--last N] [--format json|csv] [--stage <name>]
  • Reads cicd.pipelines[] (R25: one entry per entrypoint) and the platform (cicd.plataforma). By default it shows all of them; --entrypoint narrows it to one.
  • Phase 0: it reminds you of the manual deployment (the runbook).
  • Phase ≥ 1: it asks the Hub MCP for get_cicd_status; if that does not answer, it falls back straight to the platform: /_apis/build/builds (Azure DevOps) or gh run list + deployments per environment (GitHub). It shows: the latest builds, time per stage, the coverage trend, and the last deployment per environment (phase 2).
  • 1.5 Template drift: it compares the YAML's tpl <hash> stamp with the current hash of your stack's template. If it changed → it suggests /hv:cicd-init option 4. (Informational, it does not block.)
  • --watch: refreshes every 30s (useful during a deployment); on GitHub it follows the running job with gh run watch.

4. /hv:cicd-release — versioning and triggering the build

/hv:cicd-release [--major|--minor|--patch|--version X.Y.Z] [--deploy <dev|pre|pro>] [--no-push] [--no-gh-release] [--dry-run]
  • It checks the working tree is clean and you are on the base branch. It computes the next semver. It creates an annotated tag (-a) and pushes it.
  • The push triggers the build (compile + test + artifact). The deploy stages/jobs do NOT run (Azure: the DeployEnv variable is empty · GitHub: the deploy-* jobs only run on workflow_dispatch). On GitHub it also creates the tag's GitHub Release with generated notes (--no-gh-release skips it). For the .NET tool stack, a v* tag does publish the package.
  • --deploy <env> is an explicit shortcut (release → then /hv:cicd-deploy), never the default behaviour.
  • Do not confuse it with the ecosystem builder's own publishing command, which publishes the ecosystem's template.

5. /hv:cicd-deploy — deploying on demand

/hv:cicd-deploy --env <dev|pre|pro> [--entrypoint <slug>] [--tag vX.Y.Z | --commit <sha>] [--watch] [--dry-run] [--yes]
  • Requires phase 2 (below phase 2 it aborts and suggests promoting).
  • --entrypoint: if there is more than one and it is omitted → it lists them and asks. Each entrypoint queues its own definition; its DeployTarget=<env>-<app|svc> is already baked into the YAML.
  • Confirmation per environment (configurable in cicd[].deployConfirm): Dev and Pre go straight through by default, Prod asks for confirmation (a double check). --yes forces it through (unless the project sets deployConfirm[env]=true).
  • Azure: queues over REST with parameters={DeployEnv:<env>} (R3 + R2 TLS 1.2); the Deploy<Env> stage only runs because of its condition. GitHub: gh workflow run cd-<slug>.yml --ref <branch|tag> -f environment=<env>; only the deploy-<env> job runs, and if the environment has reviewers the run waits for their approval on GitHub (the second gate).
  • Branch-gated (R24): the branch is derived from the environment (dev/pre→develop, pro→main). Asking for --env pro from develop will not deploy (the per-branch condition does not match) — the command warns you before queueing.

6. Complete flows (recipes)

6.1 A new .NET project, one entrypoint, github-flow

1. /hv:cicd-init     → P0=phase 1 (build validation). Generates azure-pipelines.yml + the <PROJECT> definition.
                       Recommends enabling the build-validation branch policy (PR to main).
2. (push / PR)       → the build runs and validates.
3. /hv:cicd-init     → promotes to phase 2 (on-demand model). Generates the DeployDev/Pre/Prod stages + the secrets VG.
4. /hv:cicd-release --minor   → tag v1.1.0 + build.
5. /hv:cicd-deploy --env pre  → deploy to Pre (straight through). Verify.
6. /hv:cicd-deploy --env pro  → deploy to Prod (asks for confirmation).

6.2 A multi-entrypoint solution (Web + private API + Console), gitflow

1. /hv:cicd-init  → detects 3 entrypoints. P1-bis: Web=public(app), API=private(svc), Console=CD through a scheduled task.
                    P2-bis: branch-gated (the default for gitflow). Generates:
                      azure-pipelines.web.yml      + def <PROJECT>-web     (CD to applications)
                      azure-pipelines.api.yml      + def <PROJECT>-api     (CD to services)
                      azure-pipelines.console.yml  + def <PROJECT>-console (CD, scheduled task)
2. push to develop  → all three definitions build; the deployment does NOT run (DeployEnv empty).
3. /hv:cicd-deploy --env pre --entrypoint web   → DeployDemo of Web, gated by DeployEnv=pre + the develop branch (R24).
4. (merge to main) /hv:cicd-deploy --env pro --entrypoint api  → DeployProd of the API, gated by the main branch.

The Console has CD (R25) through a scheduled task (schtasks; the deployment is a file sync, robocopy /MIR /XF appsettings). Its DeployTarget is derived from the real pool (FB-002). The always-on Windows Service variant is deferred.

6.3 Legacy netfx (MVC5, .NET 4.8), per-environment configuration

1. /hv:cicd-init  → detects netfx. Generates the MSBuild pipeline (NuGet+VSBuild+VSTest+MSDeploy).
                    Per-environment config = Web.<Cfg>.config transforms (one VSBuild and one package per environment).
                    Secrets in a variable group with XmlVariableSubstitution.
2. The rest is the same as 6.1 (release + on-demand deploy).

7. Quick table: "which command for what"

I want to...Command
Create the pipeline / promote a phase / re-render/hv:cicd-init
See builds, coverage, the last deployment, drift/hv:cicd-status
Mark a version and build it/hv:cicd-release
Deploy to an environment/hv:cicd-deploy
Audit the YAML against G1-G19the cicd-pipeline-reviewer agent (AUDITAR_PIPELINE.md)
Edit the YAML with suggestionsthe cicd-architect skill
Deploy without a pipeline (phase 0)RUNBOOK_DEPLOY_MANUAL.md

8. Troubleshooting (consolidated)

SymptomLikely causeAction
/hv:cicd-deploy says requires phase 2The pipeline is in phase 0/1/hv:cicd-init → promote to phase 2
/hv:cicd-deploy (GitHub) says Workflow does not have 'workflow_dispatch' trigger, or a 404The workflow is not on the default branch, or it has no such triggerMerge cd-<slug>.yml into main; /hv:cicd-init option 4 if the trigger is missing
/hv:cicd-deploy (GitHub) leaves the run in waitingThe pre/pro environment has required reviewersA reviewer approves it in Actions → Review deployments
DeployEnv not valid at queue timeThe YAML has no on-demand model/hv:cicd-init option 4 (re-render)
The build queues but the Deploy stage is skippedThe condition (DeployEnv, or the branch when branch-gated) does not matchCheck the environment and, when branch-gated, the environment's branch
The build stays in notStartedNo agent meets the demand (the real capability ≠ the template) or the pipeline is not authorized (TEC-003)/hv:cicd-init derives the demand from the real pool; the pool authorization is granted by the infrastructure team
cicd-batch HTTP 400 in /hv:hub-client(fixed in Hub ≥ 1.7.3) PS 5.1 serializes a one-element array as a scalarUpdate the Hub; it now tolerates both a scalar and an array
The build is not triggered after a pushAzure DevOps Server 2020 path filters (R7)trigger.paths with the double pattern ** and **/*
/hv:cicd-status reports template driftYour stack's template changed/hv:cicd-init option 4 (re-render + self-check)
A green deployment but the app is downAn app bug / an external dependency / a bad secretRUNBOOK § "App down after a green deployment"; automatic R15 rollback in pre/pro

9. References

DocumentContents
.claude/skills/cicd-runtime/SKILL.mdThe 25 rules G1-G19 (inventory, deploy models, routing, gates)
_patron/08_CICD/GUIA_FASES_ADOPCION.mdThe detail of phases 0/1/2
_patron/08_CICD/PERMISOS_CICD.mdThe handoff to the infrastructure team: the configured pool (cicd.buildPool), capabilities, deploy agents
_patron/08_CICD/AUDITAR_PIPELINE.mdAuditing the YAML with the cicd-pipeline-reviewer agent
_patron/08_CICD/RUNBOOK_DEPLOY_MANUAL.mdManual deployment (phase 0)
_patron/08_CICD/RUNBOOK_ACTUALIZAR_PIPELINE.mdA safe re-render of the YAML (drift)

Ovillo — complete CI/CD guide. The /hv:cicd-* family + the one solution / N entrypoints model + application/services routing + Console/Worker CD through a scheduled task. Rules G1-G19 in cicd-runtime.

Fuente: ovillo/_patron/08_CICD/GUIA_COMPLETA_CICD_EN.md

Ovillo v1.31.0tag v1.31.0 (2026-10-06) · sin decisiones posteriores69 skills · 19 agents · 22 hooks · 3 reglas · 15 tools · 103 decisionesfuente: ovillo/_patron/08_CICD/GUIA_COMPLETA_CICD_EN.mdCopyright 2026 Hugo Valer Rojas · Apache-2.0