Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions plugins/power-pages/skills/setup-pipeline/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,21 @@ Steps:
```bash
node "${PLUGIN_ROOT}/scripts/lib/detect-project-context.js"
```
Capture output as JSON; extract `.siteName` (store as `siteName`), `.websiteRecordId`, `.environmentUrl` (store as `devEnvUrl`), and `.solutionManifest` (store as `solutionManifest`). If `siteName` is absent (no `powerpages.config.json`), stop and advise running `/power-pages:create-site` first. If `solutionManifest` is null (no `.solution-manifest.json`), stop and advise running `/power-pages:setup-solution` first.
Capture output as JSON; extract `.siteName` (store as `siteName`), `.websiteRecordId`, `.environmentUrl` (store as `devEnvUrl`), and `.solutionManifest` (store as `solutionManifest`). **`devEnvUrl` is `null` for declarative / data-model (EDM) sites** — `detect-project-context.js` reads the env URL only from `powerpages.config.json`, which those sites don't have. Do **not** treat a null `devEnvUrl` as an error here; Step 2 resolves the authoritative dev env URL from `pac env who`. If `siteName` is absent, stop and advise running `/power-pages:create-site` first — a downloaded/deployed site (code **or** declarative) always resolves a `siteName` (from `powerpages.config.json` *or* `.powerpages-site/website.yml`), so a missing `siteName` means there is no site checked out here, **not** merely "no `powerpages.config.json`". If `solutionManifest` is null (no `.solution-manifest.json`), stop and advise running `/power-pages:setup-solution` first.
Comment thread
tyaginidhi marked this conversation as resolved.

**Manifest version check:**
- If `solutionManifest.schemaVersion === 2` (multi-solution layout), set `MULTI_SOLUTION_MODE = true` and store `solutionManifest.solutions[]` as `SOLUTIONS_LIST`. See Phase 6b — a SINGLE pipeline ships all solutions through per-solution stage runs (the pre-v1.3.x "one pipeline per solution" layout was reverted because it cluttered the Pipelines UI).
- If `schemaVersion` is absent or `1` (single solution), read `solutionManifest.solution.uniqueName` and `solutionManifest.solution.solutionId`. One pipeline will be created (existing flow).

2. Run `verify-alm-prerequisites.js` to confirm PAC CLI auth, acquire a token, and verify API access:
2. Run `verify-alm-prerequisites.js` to confirm PAC CLI auth, acquire a token, and verify API access. **Pass `--envUrl` only when `devEnvUrl` is non-null** (code sites). When `devEnvUrl` is null (declarative / data-model sites from Step 1), **omit `--envUrl` entirely** — do not pass `--envUrl "null"` or an empty value:
```bash
# Code sites — devEnvUrl resolved from powerpages.config.json in Step 1:
node "${PLUGIN_ROOT}/scripts/lib/verify-alm-prerequisites.js" --envUrl "{devEnvUrl}"
Comment thread
tyaginidhi marked this conversation as resolved.

# Declarative / data-model (EDM) sites — devEnvUrl is null, omit the flag:
node "${PLUGIN_ROOT}/scripts/lib/verify-alm-prerequisites.js"
```
Capture output as JSON; extract `.envUrl` (use to confirm `devEnvUrl`) and `.token` (store as `DEV_TOKEN`).
`verify-alm-prerequisites.js` treats `--envUrl` as optional and resolves the environment from `pac env who` when it's omitted (the flag only *overrides* the PAC CLI env). Capture output as JSON; extract `.envUrl` and `.token` (store as `DEV_TOKEN`), then **set `devEnvUrl = .envUrl`** — this verified value (from `pac env who`) is the authoritative dev env URL for every later step: it backfills the null for declarative sites and confirms it for code sites. If `.envUrl` is still empty after this, stop and advise the user to run `pac auth create` / select an environment (`pac org select`) before retrying.

3. Run silently:
```bash
Expand Down
Loading