|
| 1 | +# Orchestrator Deployment |
| 2 | + |
| 3 | +The package provides a script-based installer for the orchestrator (workflows, PostgreSQL, and related resources) in an OpenShift/Kubernetes namespace. Use it when your E2E tests depend on a pre-installed orchestrator in the cluster. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +`installOrchestrator` runs a bundled shell script that: |
| 8 | + |
| 9 | +1. Ensures the target namespace exists (reuses it if present, creates it if not) |
| 10 | +2. Sets the current `oc`/`kubectl` context to that namespace |
| 11 | +3. Deploys PostgreSQL, operator, and orchestrator workflows as defined by the script |
| 12 | + |
| 13 | +The script is intended for use in global setup, `beforeAll`, or standalone tooling—not for per-test runs. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- OpenShift or Kubernetes cluster and `oc` (or `kubectl`) in `PATH` |
| 18 | +- You must be logged in: `oc login` (or equivalent) |
| 19 | +- The script expects `bash` |
| 20 | + |
| 21 | +## Basic Usage |
| 22 | + |
| 23 | +```typescript |
| 24 | +import installOrchestrator from "@red-hat-developer-hub/e2e-test-utils/orchestrator"; |
| 25 | + |
| 26 | +// Use default namespace "orchestrator" |
| 27 | +await installOrchestrator(); |
| 28 | + |
| 29 | +// Use a custom namespace |
| 30 | +await installOrchestrator("my-orchestrator-ns"); |
| 31 | +``` |
| 32 | + |
| 33 | +## Usage in Tests |
| 34 | + |
| 35 | +### Global setup |
| 36 | + |
| 37 | +Run once before all tests: |
| 38 | + |
| 39 | +```typescript |
| 40 | +// global-setup.ts |
| 41 | +import installOrchestrator from "@red-hat-developer-hub/e2e-test-utils/orchestrator"; |
| 42 | + |
| 43 | +export default async function globalSetup() { |
| 44 | + const namespace = process.env.ORCHESTRATOR_NAMESPACE ?? "orchestrator"; |
| 45 | + await installOrchestrator(namespace); |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +### Before all tests in a file |
| 50 | + |
| 51 | +```typescript |
| 52 | +import { test } from "@red-hat-developer-hub/e2e-test-utils/test"; |
| 53 | +import installOrchestrator from "@red-hat-developer-hub/e2e-test-utils/orchestrator"; |
| 54 | + |
| 55 | +test.beforeAll(async () => { |
| 56 | + await installOrchestrator("orchestrator"); |
| 57 | +}); |
| 58 | + |
| 59 | +test("uses orchestrator", async () => { |
| 60 | + // ... |
| 61 | +}); |
| 62 | +``` |
| 63 | + |
| 64 | +## Namespace behavior |
| 65 | + |
| 66 | +- If the namespace **does not exist**, it is created and the script continues with deployment. |
| 67 | +- If the namespace **already exists**, it is reused (not deleted or recreated). The script configures the context and proceeds with deployment steps that are idempotent where applicable. |
| 68 | + |
| 69 | +This allows reusing the same namespace across runs or sharing it with other tooling. |
| 70 | + |
| 71 | +## Related Pages |
| 72 | + |
| 73 | +- [installOrchestrator API](/api/deployment/orchestrator) - Function signature and options |
| 74 | +- [Deployment Overview](/guide/deployment/) - Other deployment options (RHDH, Keycloak) |
0 commit comments