@plexus-ms/cli 0.130.0 → 0.131.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.
Files changed (56) hide show
  1. package/dist/plx.js +3265 -2277
  2. package/dist/templates/app-nextjs/files/.gitignore.jinja +6 -0
  3. package/dist/templates/app-nextjs/files/PLEXUS.md.jinja +5 -0
  4. package/dist/templates/app-nextjs/files/docker/Dockerfile +39 -0
  5. package/dist/templates/app-nextjs/files/docker/compose.ci.yaml.jinja +22 -0
  6. package/dist/templates/app-nextjs/files/docker/compose.yaml.jinja +50 -0
  7. package/dist/templates/app-nextjs/files/next.config.ts +16 -0
  8. package/dist/templates/app-nextjs/files/package.json.jinja +28 -0
  9. package/dist/templates/app-nextjs/files/postcss.config.mjs +7 -0
  10. package/dist/templates/app-nextjs/files/src/app/healthz/route.ts +7 -0
  11. package/dist/templates/app-nextjs/files/src/app/layout.tsx +7 -0
  12. package/dist/templates/app-nextjs/files/src/app/page.tsx.jinja +3 -0
  13. package/dist/templates/app-nextjs/files/tsconfig.json +10 -0
  14. package/dist/templates/app-nextjs/template.yml +31 -0
  15. package/dist/templates/repo-operations/files/.github/workflows/deploy.yml.jinja +37 -0
  16. package/dist/templates/repo-operations/files/.github/workflows/on_commit.yml.jinja +25 -0
  17. package/dist/templates/repo-operations/files/.github/workflows/on_pr.yml.jinja +24 -0
  18. package/dist/templates/repo-operations/files/.github/workflows/plx-update.yml.jinja +30 -0
  19. package/dist/templates/repo-operations/files/.github/workflows/{% if ci_strategy == 'hybrid' or ci_registry == 'own' %}housekeeping.yml{% endif %}.jinja +30 -0
  20. package/dist/templates/repo-operations/files/.gitignore.jinja +2 -0
  21. package/dist/templates/repo-operations/files/PLEXUS.md.jinja +3 -0
  22. package/dist/templates/repo-operations/files/ansible-playbookw +17 -0
  23. package/dist/templates/repo-operations/files/ansible.cfg +4 -0
  24. package/dist/templates/repo-operations/files/apps/.gitkeep +0 -0
  25. package/dist/templates/repo-operations/files/hk.pkl +21 -0
  26. package/dist/templates/repo-operations/files/inventory/group_vars/all.yml.jinja +6 -0
  27. package/dist/templates/repo-operations/files/inventory/group_vars/platform.yml.jinja +13 -0
  28. package/dist/templates/repo-operations/files/inventory/hosts.yml.jinja +21 -0
  29. package/dist/templates/repo-operations/files/mise.toml.jinja +103 -0
  30. package/dist/templates/repo-operations/files/platform.yml.jinja +6 -0
  31. package/dist/templates/repo-operations/files/renovate.json.jinja +5 -0
  32. package/dist/templates/repo-operations/files/requirements.yml +15 -0
  33. package/dist/templates/repo-operations/files/secrets.env.jinja +3 -0
  34. package/dist/templates/repo-operations/files/{% if ci_strategy != 'github' %}ci.yml{% endif %}.jinja +6 -0
  35. package/dist/templates/repo-operations/files/{% if infrastructure %}infrastructure.yml{% endif %}.jinja +6 -0
  36. package/dist/templates/repo-operations/template.yml +72 -0
  37. package/dist/templates/repo-turbo/files/.github/workflows/on_pr.yml.jinja +91 -0
  38. package/dist/templates/repo-turbo/files/.github/workflows/on_push.yml.jinja +109 -0
  39. package/dist/templates/repo-turbo/files/.github/workflows/plx-update.yml.jinja +30 -0
  40. package/dist/templates/repo-turbo/files/.github/workflows/{% if not publishes_packages %}on_commit.yml{% endif %}.jinja +28 -0
  41. package/dist/templates/repo-turbo/files/.github/workflows/{% if not publishes_packages and ci_registry == 'ghcr' %}housekeeping.yml{% endif %}.jinja +28 -0
  42. package/dist/templates/repo-turbo/files/.gitignore.jinja +7 -0
  43. package/dist/templates/repo-turbo/files/PLEXUS.md.jinja +11 -0
  44. package/dist/templates/repo-turbo/files/biome.json +4 -0
  45. package/dist/templates/repo-turbo/files/hk.pkl +22 -0
  46. package/dist/templates/repo-turbo/files/mise.toml.jinja +137 -0
  47. package/dist/templates/repo-turbo/files/package.json.jinja +11 -0
  48. package/dist/templates/repo-turbo/files/packages/.gitkeep +0 -0
  49. package/dist/templates/repo-turbo/files/pnpm-workspace.yaml.jinja +18 -0
  50. package/dist/templates/repo-turbo/files/renovate.json.jinja +14 -0
  51. package/dist/templates/repo-turbo/files/turbo.json.jinja +35 -0
  52. package/dist/templates/repo-turbo/files/{% if not publishes_packages %}.dockerignore{% endif %} +9 -0
  53. package/dist/templates/repo-turbo/files/{% if not publishes_packages %}apps{% endif %}/.gitkeep +0 -0
  54. package/dist/templates/repo-turbo/files/{% if publishes_packages %}.changeset{% endif %}/config.json.jinja +11 -0
  55. package/dist/templates/repo-turbo/template.yml +103 -0
  56. package/package.json +3 -2
@@ -0,0 +1,6 @@
1
+ /coverage
2
+ /.next/
3
+ .pnpm-debug.log*
4
+ .env*
5
+ *.tsbuildinfo
6
+ next-env.d.ts
@@ -0,0 +1,5 @@
1
+ - `{{ name }}`, a Next.js app: `docker/Dockerfile` builds its image and `docker/compose.yaml` runs it on its host.
2
+ - Its verbs are the repo root's: `mise :dev <app>`, `mise :build <app>` and `mise :verify <app>`, `<app>` being this directory's name.
3
+ {%- if profile == 'stateful' %}
4
+ - The `migrate` and `seed` scripts in `package.json` fail until they are written: the deploy verb runs `migrate` in the image, through the compose file's `migrate` service, and `seed` loads development data and never runs on a host.
5
+ {%- endif %}
@@ -0,0 +1,39 @@
1
+ # syntax=docker/dockerfile:1
2
+ # Generated from plexus-ms/template-app-nextjs.
3
+ # The image build of a Next.js standalone app in the monorepo, from its root or a pruned context (PLX-App/Dockerfile).
4
+ FROM node:24-slim@sha256:c86ecead9e55a5210ac1727de38a4ca840bf03dcaf34dc9749addbf383b1920c AS builder
5
+ ARG APP
6
+ WORKDIR /repo
7
+ ENV CI=1
8
+ ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
9
+ RUN corepack enable
10
+ # package.json comes along so that corepack runs the pnpm its packageManager pins.
11
+ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
12
+ # The npmrc secret is the token of the tenant's private package registry, for a repo that installs
13
+ # from one (§ 5 PLX-Delivery); a build without the secret mounts nothing.
14
+ RUN --mount=type=secret,id=npmrc,target=/root/.npmrc pnpm fetch
15
+ COPY turbo.json ./
16
+ COPY packages packages
17
+ COPY apps/${APP} apps/${APP}
18
+ # public/ is optional; an empty one lets the runner stage copy it unconditionally.
19
+ RUN mkdir -p apps/${APP}/public
20
+ RUN --mount=type=secret,id=npmrc,target=/root/.npmrc pnpm install --frozen-lockfile --prefer-offline
21
+ # pnpm, not Turbo, whose strict environment would hide BUILD_HASH and the key from `next build`;
22
+ # the filter's trailing `...` builds the app's workspace dependencies first, as `^build` would.
23
+ ARG BUILD_HASH
24
+ RUN --mount=type=secret,id=next-server-actions-encryption-key,env=NEXT_SERVER_ACTIONS_ENCRYPTION_KEY \
25
+ BUILD_HASH=${BUILD_HASH} pnpm --filter "{./apps/${APP}}..." run build
26
+
27
+ FROM node:24-slim@sha256:c86ecead9e55a5210ac1727de38a4ca840bf03dcaf34dc9749addbf383b1920c AS runner
28
+ ARG APP
29
+ WORKDIR /repo
30
+ ENV NODE_ENV=production
31
+ # The standalone output keeps the monorepo's layout; the static files and public/ go in beside it.
32
+ COPY --from=builder --chown=node:node /repo/apps/${APP}/.next/standalone ./
33
+ COPY --from=builder --chown=node:node /repo/apps/${APP}/.next/static ./apps/${APP}/.next/static
34
+ COPY --from=builder --chown=node:node /repo/apps/${APP}/public ./apps/${APP}/public
35
+ WORKDIR /repo/apps/${APP}
36
+ USER node
37
+ EXPOSE 3000
38
+ ENV HOSTNAME=0.0.0.0
39
+ ENTRYPOINT ["node", "server.js"]
@@ -0,0 +1,22 @@
1
+ # Generated from plexus-ms/template-app-nextjs.
2
+ # The override of compose.yaml that `plx-ci test` reads beside it, never the deploy verb (§ 1 PLX-Delivery).
3
+
4
+ # Added to the environment the specs run in, on the runner beside the stack, to CI, PLEXUS_LOOPBACK_PORT and E2E_BASE_URL.
5
+ x-plexus-ci:
6
+ env: {}
7
+
8
+ # Stands in for .env and .env.secret, with throwaway values.
9
+ x-ci-env: &ci-env
10
+ PUBLIC_URL: http://127.0.0.1:${PLEXUS_LOOPBACK_PORT:?set by plx-ci test}
11
+
12
+ services:
13
+ web:
14
+ environment: *ci-env
15
+ restart: "no"
16
+ {%- if profile == "stateful" %}
17
+ # plx-ci test runs migrate once before `up`.
18
+ migrate:
19
+ environment: *ci-env
20
+ # Data services go here, published on 127.0.0.1 for the specs and kept in RAM (`volumes: !override []`
21
+ # and a tmpfs for the data directory), with the database URL in x-plexus-ci.env above.
22
+ {%- endif %}
@@ -0,0 +1,50 @@
1
+ services:
2
+ web:
3
+ image: ${PLEXUS_DEPLOYMENT_IMAGE:?rendered by the deploy verb}
4
+ restart: unless-stopped
5
+ environment:
6
+ NODE_ENV: production
7
+ # What the deployment says about itself, pinned by the deploy verb (PLX-Releases): the display version,
8
+ # where the repo has them, and the commit it was started from. Empty where none is handed over.
9
+ PLEXUS_DISPLAY_VERSION: ${PLEXUS_DISPLAY_VERSION:-}
10
+ PLEXUS_COMMIT_SHA: ${PLEXUS_COMMIT_SHA:-}
11
+ env_file:
12
+ - path: .env
13
+ required: false
14
+ - path: .env.secret
15
+ required: false
16
+ ports:
17
+ - "127.0.0.1:${PLEXUS_LOOPBACK_PORT:?set by the platform playbook}:3000"
18
+ labels:
19
+ plexus.tenant: {{ tenant }}
20
+ healthcheck:
21
+ test:
22
+ - CMD
23
+ - node
24
+ - -e
25
+ - "fetch('http://127.0.0.1:3000/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
26
+ interval: 30s
27
+ timeout: 5s
28
+ retries: 3
29
+ start_period: 60s
30
+ start_interval: 1s
31
+ {%- if profile == "stateful" %}
32
+
33
+ migrate:
34
+ image: ${PLEXUS_DEPLOYMENT_IMAGE:?rendered by the deploy verb}
35
+ profiles: ["migrate"]
36
+ # npm, not pnpm: the image holds node and the standalone build and nothing else.
37
+ entrypoint: ["npm", "run", "migrate"]
38
+ environment:
39
+ NODE_ENV: production
40
+ env_file:
41
+ - path: .env
42
+ required: false
43
+ - path: .env.secret
44
+ required: false
45
+ labels:
46
+ plexus.tenant: {{ tenant }}
47
+
48
+ # Data services go here, each a dependency of web and migrate, with its data in a named volume,
49
+ # never in a bind-mounted directory (§ 9.1 PLX-App).
50
+ {%- endif %}
@@ -0,0 +1,16 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import type { NextConfig } from 'next';
3
+
4
+ // The workspace root, two levels up from this app; under `plx umbrella` it is the umbrella's,
5
+ // where the dependencies are then installed.
6
+ const root = process.env.PLX_UMBRELLA_ROOT || fileURLToPath(new URL('../../', import.meta.url));
7
+
8
+ const nextConfig: NextConfig = {
9
+ output: 'standalone',
10
+ // BUILD_HASH comes from the image build; without it Next draws a random ID, as in development.
11
+ generateBuildId: () => process.env.BUILD_HASH || null,
12
+ outputFileTracingRoot: root,
13
+ turbopack: { root },
14
+ };
15
+
16
+ export default nextConfig;
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "{{ name }}",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "check": "next typegen && tsc --noEmit"{% if profile == 'stateful' %},
10
+ "migrate": "echo 'migrate: not written yet. Name the migration command here; the migrate service of docker/compose.yaml runs it in the image, which holds node and the standalone build.' >&2; exit 1",
11
+ "seed": "echo 'seed: not written yet. Name the command here that loads development sample data into a fresh, migrated database.' >&2; exit 1"{% endif %}
12
+ },
13
+ "dependencies": {
14
+ "@plexus-ms/std": "^0.2.0",
15
+ "next": "^16",
16
+ "react": "^19",
17
+ "react-dom": "^19"
18
+ },
19
+ "devDependencies": {
20
+ "@plexus-ms/config": "catalog:plexus",
21
+ "@tailwindcss/postcss": "^4",
22
+ "@types/node": "^24",
23
+ "@types/react": "^19",
24
+ "@types/react-dom": "^19",
25
+ "tailwindcss": "^4",
26
+ "typescript": "catalog:"
27
+ }
28
+ }
@@ -0,0 +1,7 @@
1
+ const config = {
2
+ plugins: {
3
+ '@tailwindcss/postcss': {},
4
+ },
5
+ };
6
+
7
+ export default config;
@@ -0,0 +1,7 @@
1
+ import { connection } from 'next/server';
2
+
3
+ // The route of the compose healthcheck (PLX-App/Healthcheck): check here what the app cannot serve without.
4
+ export async function GET() {
5
+ await connection();
6
+ return new Response(null);
7
+ }
@@ -0,0 +1,7 @@
1
+ export default function RootLayout({ children }: LayoutProps<'/'>) {
2
+ return (
3
+ <html lang="en">
4
+ <body>{children}</body>
5
+ </html>
6
+ );
7
+ }
@@ -0,0 +1,3 @@
1
+ export default function Page() {
2
+ return <h1>{{ name }}</h1>;
3
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@plexus-ms/config/tsconfig-next",
3
+ "compilerOptions": {
4
+ "paths": {
5
+ "@/*": ["./src/*"]
6
+ }
7
+ },
8
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts", "**/*.mts"],
9
+ "exclude": ["node_modules"]
10
+ }
@@ -0,0 +1,31 @@
1
+ # Until the version that cuts over from copier is out, this template and
2
+ # template-app-nextjs are one: a change to either is made in both.
3
+ # files/.gitignore.jinja is a .gitignore: npm leaves a file of that name out of a package, so the
4
+ # template carries it with the suffix, which renders it to the same bytes.
5
+ name: app-nextjs
6
+
7
+ # The enclosing repo's answer; whoever renders the app passes it.
8
+ reads:
9
+ tenant:
10
+
11
+ questions:
12
+ name:
13
+ type: str
14
+ help: "App name (for package.json)"
15
+
16
+ profile:
17
+ type: str
18
+ help: "The app's profile (§§ 8 and 9 PLX-App), which its marker states: stateless, an app holding no state of its own; stateful, an app with data services of its own, which gets a migrate service in its compose file and migrate and seed scripts to write"
19
+ choices:
20
+ - stateless
21
+ - stateful
22
+ default: stateless
23
+
24
+ policies:
25
+ # The app's source and its marker are rendered at birth only: an update would fight what the author
26
+ # wrote, or add a root layout to an app whose route groups hold their own; the marker's frontmatter is
27
+ # plx's.
28
+ PLEXUS.md.jinja: born-once
29
+ src/app/layout.tsx: born-once
30
+ src/app/page.tsx.jinja: born-once
31
+ src/app/healthz/route.ts: born-once
@@ -0,0 +1,37 @@
1
+ {% raw %}name: deploy
2
+
3
+ # Generated from plexus-ms/template-repo-operations: edit the template, never this file.
4
+ # Mounts the deploy verb for the third-party apps under apps/ (PLX-App/SourceRepo, § 6 PLX-Delivery).
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ paths: ['apps/**']
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ deploy-targets:
17
+ uses: plexus-ms/tooling/.github/workflows/_deploy-targets.yml@0.131.0
18
+ with:
19
+ strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
20
+
21
+ deploy:
22
+ needs: deploy-targets
23
+ # An empty matrix is an error, not a no-op.
24
+ if: ${{ needs.deploy-targets.outputs.matrix != '[]' }}
25
+ strategy:
26
+ fail-fast: false
27
+ matrix:
28
+ include: ${{ fromJSON(needs.deploy-targets.outputs.matrix) }}
29
+ uses: plexus-ms/tooling/.github/workflows/_deploy.yml@0.131.0
30
+ with:
31
+ strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
32
+ app: ${{ matrix.app }}
33
+ host: ${{ matrix.host }}
34
+ overlay: {% endraw %}{{ ci_overlay }}{% raw %}
35
+ secrets:
36
+ op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
37
+ {% endraw %}
@@ -0,0 +1,25 @@
1
+ {% raw %}name: on_commit
2
+
3
+ # Generated from plexus-ms/template-repo-operations: edit the template, never this file.
4
+ # The check of a push to main, the trunk that takes an operator's direct pushes (§ 2 PLX-Delivery).
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ paths-ignore: ['**/*.md']
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ concurrency:
15
+ group: on_commit-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ check:
20
+ uses: plexus-ms/tooling/.github/workflows/_check.yml@0.131.0
21
+ with:
22
+ strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
23
+ size: small
24
+ tasks: verify
25
+ {% endraw %}
@@ -0,0 +1,24 @@
1
+ {% raw %}name: on_pr
2
+
3
+ # Generated from plexus-ms/template-repo-operations: edit the template, never this file.
4
+ # The check of a pull request, as the merge result (§ 2 PLX-Delivery).
5
+
6
+ on:
7
+ pull_request:
8
+ paths-ignore: ['**/*.md']
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ concurrency:
14
+ group: on_pr-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ check:
19
+ uses: plexus-ms/tooling/.github/workflows/_check.yml@0.131.0
20
+ with:
21
+ strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
22
+ size: small
23
+ tasks: verify
24
+ {% endraw %}
@@ -0,0 +1,30 @@
1
+ {% raw %}name: plx-update
2
+
3
+ # Generated from plexus-ms/template-repo-operations: edit the template, never this file.
4
+ # Mounts the update verb, `plx update` (§ 3 PLX-Updates).
5
+
6
+ on:
7
+ schedule:
8
+ - cron: '23 6 * * *'
9
+ workflow_dispatch:
10
+ inputs:
11
+ version:
12
+ description: "The version to take (default: the newest)"
13
+ required: false
14
+ default: ''
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ update:
21
+ uses: plexus-ms/tooling/.github/workflows/_plx-update.yml@0.131.0
22
+ with:
23
+ version: ${{ inputs.version || '' }}
24
+ now: ${{ github.event_name == 'workflow_dispatch' }}
25
+ gh-client-id: ${{ vars.GH_CLIENT_ID }}
26
+ strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
27
+ secrets:
28
+ gh-private-key: ${{ secrets.GH_PRIVATE_KEY }}
29
+ op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
30
+ {%- endraw %}
@@ -0,0 +1,30 @@
1
+ {% raw %}name: housekeeping
2
+
3
+ # Generated from plexus-ms/template-repo-operations: edit the template, never this file.
4
+ # The daily housekeeping of the tenant's CI: its throwaway instances, its registry buckets (§ 8 PLX-Delivery).
5
+
6
+ on:
7
+ schedule:
8
+ - cron: '17 4 * * *'
9
+ workflow_dispatch:
10
+ inputs:
11
+ dry_run:
12
+ description: Only list what would be deleted
13
+ type: boolean
14
+ default: false
15
+
16
+ permissions:
17
+ contents: read
18
+ packages: write
19
+
20
+ jobs:
21
+ housekeeping:
22
+ uses: plexus-ms/tooling/.github/workflows/_housekeeping.yml@0.131.0
23
+ with:
24
+ strategy: ${{ vars.CI_STRATEGY || '{% endraw %}{{ ci_strategy }}{% raw %}' }}
25
+ registry: {% endraw %}{{ 'own' if ci_registry == 'own' else 'none' }}{% raw %}
26
+ dry-run: ${{ inputs.dry_run || false }}
27
+ alerts-email: '{% endraw %}{{ alerts_email }}{% raw %}'
28
+ secrets:
29
+ op-service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
30
+ {% endraw %}
@@ -0,0 +1,2 @@
1
+ .DS_Store
2
+ *.pem
@@ -0,0 +1,3 @@
1
+ - The operations repo of `{{ tenant }}`: the playbooks that mount the `plexus.*` collections, one per layer, the inventory they run on, and the third-party apps under `apps/`, each with a marker of its own.
2
+ - `mise :platform` applies the platform layer{% if infrastructure %}, `mise :infrastructure` the infrastructure layer{% endif %}{% if ci_strategy != 'github' %}, `mise :ci` the runner host{% endif %}; `mise :verify` checks the repo.
3
+ - The Plexus version the repo is on is its `plx` pin in `mise.toml`, the collections in `requirements.yml` pinned to the same.
@@ -0,0 +1,17 @@
1
+ #!/bin/bash
2
+ # Generated from plexus-ms/template-repo-operations.
3
+ # Runs a playbook with the op:// pointers of secrets.env resolved (§ 1 PLX-Secrets): ./ansible-playbookw <playbook> [args...]
4
+
5
+ playbook="${1:?Usage: $0 <playbook> [extra args...]}"
6
+ shift
7
+
8
+ SECRETS_FILE="$(dirname "$playbook")/secrets.env"
9
+ if [ -f "$SECRETS_FILE" ]; then
10
+ SECRETS_ARG="--env-file $SECRETS_FILE"
11
+ else
12
+ SECRETS_ARG=""
13
+ fi
14
+
15
+ op run --no-masking $SECRETS_ARG -- \
16
+ ansible-playbook \
17
+ "./$playbook" "$@"
@@ -0,0 +1,4 @@
1
+ [defaults]
2
+ inventory = inventory/hosts.yml
3
+ interpreter_python = auto_silent
4
+ callback_result_format = yaml
@@ -0,0 +1,21 @@
1
+ amends "package://github.com/jdx/hk/releases/download/v1.48.0/hk@1.48.0#/Config.pkl"
2
+
3
+ hooks {
4
+ ["pre-commit"] {
5
+ fix = true
6
+ stash = true
7
+ steps {
8
+ ["lint"] {
9
+ check = "mise :lint {{ files }}"
10
+ fix = "mise :lint --write {{ files }}"
11
+ }
12
+ }
13
+ }
14
+ ["pre-push"] {
15
+ steps {
16
+ ["check"] {
17
+ check = "mise :check"
18
+ }
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,6 @@
1
+ # Generated from plexus-ms/template-repo-operations.
2
+ # What every host of this tenant gets, whichever layer's playbook reaches it (§ 2 PLX-Platform).
3
+
4
+ iam_admins: []
5
+
6
+ firewall_trusted_interfaces: []
@@ -0,0 +1,13 @@
1
+ # Generated from plexus-ms/template-repo-operations.
2
+ # What the hosts that run this tenant's apps get; their apps are per host, in host_vars (§ 3 PLX-Platform).
3
+
4
+ plexus_deploy_user: plexus
5
+ plexus_deploy_root: /opt/stacks
6
+
7
+ plexus_up: true
8
+
9
+ plexus_apps: []
10
+
11
+ plexus_deploy_pubkey: "{% raw %}{{ lookup('env', 'DEPLOY_PUBKEY') | default('', true) }}{% endraw %}"
12
+ plexus_ghcr_user: "{% raw %}{{ lookup('env', 'GHCR_USER') | default('', true) }}{% endraw %}"
13
+ plexus_ghcr_token: "{% raw %}{{ lookup('env', 'GHCR_TOKEN') | default('', true) }}{% endraw %}"
@@ -0,0 +1,21 @@
1
+ # Generated from plexus-ms/template-repo-operations.
2
+ # The groups the shipped playbooks target (§ 1 PLX-Platform); a host's own facts go to host_vars/<host>.yml.
3
+ platform:
4
+ hosts:
5
+ host01.{{ tenant }}.example:
6
+ {%- if ci_strategy != 'github' %}
7
+
8
+ ci:
9
+ hosts: {}
10
+ {%- endif %}
11
+ {%- if infrastructure %}
12
+
13
+ proxmox:
14
+ hosts: {}
15
+ pbs:
16
+ hosts: {}
17
+ haproxy:
18
+ hosts: {}
19
+ guests:
20
+ hosts: {}
21
+ {%- endif %}
@@ -0,0 +1,103 @@
1
+ # Generated from plexus-ms/template-repo-operations.
2
+ # The verbs of the operations repo (PLX-Tenancy/OperationsRepo): one per layer's playbook, and the contract verbs.
3
+
4
+ # `mise :verb` needs the root marker, though the repo has no sub-projects (§ 2 PLX-Repo).
5
+ monorepo_root = true
6
+ # The root is the one project: mise does not walk the tree for others.
7
+ [monorepo]
8
+ config_roots = ["."]
9
+
10
+ [tools]
11
+ node = "24"
12
+ hk = "latest"
13
+ python = "3.14"
14
+ uv = "latest"
15
+ ansible = { version = "latest", uvx = true }
16
+ copier = { version = "latest", uvx = true }
17
+ # The plx pins are written with each Plexus version, never by the update bot (§ 1 PLX-Updates);
18
+ # allow_low_downloads only waives npm's young-package heuristics.
19
+ "npm:@plexus-ms/cli" = { version = "0.131.0", allow_low_downloads = true }
20
+ {%- if ci_strategy == 'hybrid' or ci_registry == 'own' %}
21
+ "npm:@plexus-ms/cli-ci" = { version = "0.131.0", allow_low_downloads = true }
22
+ {%- endif %}
23
+
24
+ [hooks]
25
+ # hk is absent on a CI runner whose mise installs only the tools a job names.
26
+ postinstall = "if command -v hk >/dev/null; then hk install --mise; fi"
27
+
28
+ # A layer's verb passes what follows `--` to ansible-playbook: `mise platform -- --tags apps --limit vm101`.
29
+ [tasks.platform]
30
+ depends = ["collections"]
31
+ description = "The platform layer on the app hosts (PLX-Platform): host baseline, deploy user, ingress, secrets, apps; --tags for a part"
32
+ run = './ansible-playbookw platform.yml'
33
+
34
+ {% if infrastructure -%}
35
+ [tasks.infrastructure]
36
+ depends = ["collections"]
37
+ description = "The infrastructure layer under the hosts (PLX-Infrastructure): hypervisor, guests, backup server, ingress VM; --tags for a part"
38
+ run = './ansible-playbookw infrastructure.yml'
39
+
40
+ {% endif -%}
41
+ {% if ci_strategy != 'github' -%}
42
+ [tasks.ci]
43
+ depends = ["collections"]
44
+ description = "The tenant's CI capacity (§ 8 PLX-Delivery): the runner host and its slots; --tags for a part"
45
+ run = './ansible-playbookw ci.yml'
46
+
47
+ {% endif -%}
48
+ [tasks.dev]
49
+ description = "No-op: an operations repo has no development environment to start"
50
+ run = 'echo "dev: nothing to start in an operations repo"'
51
+
52
+ [tasks.build]
53
+ description = "No-op: an operations repo produces no artifact; third-party apps pin published images"
54
+ run = 'echo "build: nothing to build in an operations repo"'
55
+
56
+ [tasks.lint]
57
+ description = "Formatting of the text files: no trailing whitespace, one final newline, one kind of line ending"
58
+ usage = '''
59
+ flag "--write" help="Fix the files in place"
60
+ arg "<paths>" var=#true default="." help="Files or directories to lint (defaults to the whole repo)"
61
+ '''
62
+ # hk's own fixers, so that lint needs no tool beyond the pinned ones.
63
+ run = '''
64
+ eval "set -- $usage_paths"
65
+ files=$(git ls-files --cached --others --exclude-standard -- "$@" | grep -E '\.(ya?ml|toml|md|json|cfg|pkl|env|j2|sh)$|(^|/)ansible-playbookw$' || true)
66
+ [ -n "$files" ] || exit 0
67
+ status=0
68
+ for fixer in trailing-whitespace end-of-file-fixer mixed-line-ending; do
69
+ printf '%s\n' "$files" | tr '\n' '\0' | xargs -0 hk util "$fixer" ${usage_write:+--fix} || status=1
70
+ done
71
+ [ "$status" = 0 ] || echo "lint: \`mise :lint --write\` fixes these in place" >&2
72
+ exit "$status"
73
+ '''
74
+
75
+ [tasks.check]
76
+ depends = ["collections"]
77
+ description = "Static checks: lint, the contracts' checks (plx doctor), then playbook syntax against the pinned collections"
78
+ run = [
79
+ 'mise run lint',
80
+ 'plx doctor',
81
+ 'ansible-playbook --syntax-check platform.yml',
82
+ {%- if infrastructure %}
83
+ 'ansible-playbook --syntax-check infrastructure.yml',
84
+ {%- endif %}
85
+ {%- if ci_strategy != 'github' %}
86
+ 'ansible-playbook --syntax-check ci.yml',
87
+ {%- endif %}
88
+ ]
89
+
90
+ [tasks.test]
91
+ description = "No-op: an operations repo has no tests that gate a deploy"
92
+ run = 'echo "test: nothing to test in an operations repo"'
93
+
94
+ [tasks.verify]
95
+ description = "Perform all steps that verify code quality"
96
+ run = ['mise run check', 'mise run test']
97
+
98
+ [tasks.collections]
99
+ description = "Install the pinned plexus.* collections"
100
+ hide = true
101
+ run = 'ansible-galaxy collection install -r requirements.yml'
102
+ sources = ["requirements.yml"]
103
+ outputs = { auto = true }
@@ -0,0 +1,6 @@
1
+ ---
2
+ # Generated from plexus-ms/template-repo-operations.
3
+ # Mounts plexus.platform.playbook for the app hosts of the group `platform` (§ 1 PLX-Platform): `mise platform`.
4
+ - import_playbook: plexus.platform.playbook
5
+
6
+ # Plays of this tenant's own go below, tagged like the shipped ones.
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": ["github>plexus-ms/tooling//renovate/default", "github>plexus-ms/tooling//renovate/operations"]{% if pr_reviewers %},
4
+ "reviewers": [{% for r in pr_reviewers.split(',') %}"{{ r.strip() }}"{% if not loop.last %}, {% endif %}{% endfor %}]{% endif %}
5
+ }
@@ -0,0 +1,15 @@
1
+ # Generated from plexus-ms/template-repo-operations.
2
+ # The plexus.* collections at the Plexus version (§ 1.5 PLX), moved only by the pull request that takes a version.
3
+ collections:
4
+ - name: https://github.com/plexus-ms/tooling.git#/ansible/host/
5
+ type: git
6
+ version: 0.130.0
7
+ - name: https://github.com/plexus-ms/tooling.git#/ansible/platform/
8
+ type: git
9
+ version: 0.130.0
10
+ - name: https://github.com/plexus-ms/tooling.git#/ansible/infrastructure/
11
+ type: git
12
+ version: 0.130.0
13
+ - name: https://github.com/plexus-ms/tooling.git#/ansible/ci/
14
+ type: git
15
+ version: 0.130.0
@@ -0,0 +1,3 @@
1
+ DEPLOY_PUBKEY=op://{{ tenant }}/deploy-ssh/public_key
2
+ GHCR_USER=op://{{ tenant }}/ghcr/username
3
+ GHCR_TOKEN=op://{{ tenant }}/ghcr/credential
@@ -0,0 +1,6 @@
1
+ ---
2
+ # Generated from plexus-ms/template-repo-operations.
3
+ # Mounts plexus.ci.playbook for the runner host of the group `ci` (§ 8 PLX-Delivery): `mise ci`.
4
+ - import_playbook: plexus.ci.playbook
5
+
6
+ # Plays of this tenant's own go below, tagged like the shipped ones.