@abgov/nx-oc 13.0.0-beta.5 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -139,6 +139,49 @@ npx nx run my-app:deploy
|
|
|
139
139
|
|
|
140
140
|
---
|
|
141
141
|
|
|
142
|
+
## Sandbox deployment (local build)
|
|
143
|
+
|
|
144
|
+
For rapid iteration, the `sandbox` generator wires a per-app deploy that builds
|
|
145
|
+
the image **locally with podman**, pushes it to a container registry (GHCR), and
|
|
146
|
+
imports it into your OpenShift namespace — no git push or CI wait. The Nx 23 line
|
|
147
|
+
that ships this is on the `@beta` dist-tag.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Add the sandbox targets to a project (run once per app)
|
|
151
|
+
npx nx g @abgov/nx-oc:sandbox my-app --sandboxProject=<namespace> --registry=ghcr.io/<org>
|
|
152
|
+
|
|
153
|
+
# Build → podman → push → import → roll out
|
|
154
|
+
npx nx run my-app:sandbox
|
|
155
|
+
|
|
156
|
+
# Tear down the sandbox resources + delete the pushed image
|
|
157
|
+
npx nx run my-app:sandbox-teardown
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Prerequisites: `podman` (machine started on macOS), `oc` logged in to the
|
|
161
|
+
cluster, and `gh` authenticated as an account with **`write:packages`** on the
|
|
162
|
+
registry org (the deploy reads `gh auth token` for the push and pull secret — no
|
|
163
|
+
PAT is stored, so that account must be the **active** `gh` account).
|
|
164
|
+
|
|
165
|
+
The deploy is the `@abgov/nx-oc:sandbox` **executor**, so its logic is versioned
|
|
166
|
+
in the plugin (fixes reach every project on `npm update`). It:
|
|
167
|
+
|
|
168
|
+
- **preflights** `oc`/`gh`/`podman` and fails fast with actionable messages
|
|
169
|
+
before the build;
|
|
170
|
+
- **retries `oc import-image`** to absorb the `oc tag` reconcile race;
|
|
171
|
+
- **auto-detects the database** (from an `adsp:database:*` project tag, or a
|
|
172
|
+
drizzle `db:migrate` target) and provisions a shared Postgres/Mongo instance +
|
|
173
|
+
the per-app database + migrate init container — no `--database` flag needed;
|
|
174
|
+
- for a **frontend**, ensures each paired backend's Service exists and **warns**
|
|
175
|
+
if the backend has no running pods (proxied `/api` calls would 502); pass
|
|
176
|
+
`--deployBackend` to deploy the backend in the same run;
|
|
177
|
+
- supports `--skipBuild` / `--skipPush` to **resume** a partial deploy.
|
|
178
|
+
|
|
179
|
+
Running the generator also writes `.openshift/<app>/SANDBOX.md` — a
|
|
180
|
+
deploy/troubleshooting runbook (preflight fixes, resume flags, a manual-completion
|
|
181
|
+
sequence, quota/auth/CrashLoopBackOff guidance).
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
142
185
|
## Typical workflow
|
|
143
186
|
|
|
144
187
|
1. Run `pipeline` once per workspace to generate shared build infrastructure manifests.
|