Repository navigation
Expand file tree
/
Copy pathblueprint.yaml
More file actions
157 lines (151 loc) · 7.78 KB
/
Copy pathblueprint.yaml
File metadata and controls
157 lines (151 loc) · 7.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# The cms-wordpress card: what the console's Blueprints page renders and the
# platform's bootstrap door consumes.
#
# THIS FILE IS NOT THE BUILD. `spec.bootstrap.blueprint` names the build
# document — `repo-blueprint.yaml`, whose phases a runner places. This card is
# what an operator reads and fills in before pressing Build, and
# `testing/manifest.test.sh` compares every list below to the document that
# actually does the thing, not to a copy of itself.
#
# The division of labour with the registry is strict: the registry (orun-cloud
# `infra/baselines-registry/baselines.yaml`) owns identity and commerce — id,
# visibility, tier, the pinned tag. This file owns the build contract. Neither
# restates the other, which is why there is no `tag` here: this file is
# fetched AT the tag the registry pins.
apiVersion: orun.io/v1
kind: Blueprint
metadata:
name: cms-wordpress
displayName: WordPress Headless CMS — a Next.js front end for WordPress on Cloudflare Workers
description: >
Vercel's Next.js Starter for WordPress Headless CMS as a product of its
own: posts, pages, categories, tags and authors read from a WordPress
site's REST API, with search, filters, pagination, a sitemap, Open Graph
images and a revalidation webhook for the next-revalidate plugin — built
by OpenNext into one Cloudflare Worker with Static Assets, with CI that
deploys it to stage and prod on merge, smoke-tested. It goes live before
any WordPress is connected, on bundled sample posts, and reads yours once
you give it its URL. One provider, one consent, one landing.
tags: [cms, wordpress, headless, nextjs, cloudflare]
spec:
source:
repo: sourceplane/cms-wordpress
# No `tag`. The registry pins it; this file is fetched at it.
# ── What the operator reads first ────────────────────────────────────────
overview:
lede: >
A headless WordPress front end on Cloudflare alone. It deploys with
sample posts and a "no WordPress site is connected" notice; give it
your WordPress URL and it renders your posts, pages and terms.
architecture:
- layer: Edge
items: [web]
- layer: Content
items: [WordPress REST API (connected after the build)]
- layer: Delivery
items: [GitHub Actions, OpenNext, wrangler]
outcome:
- Live on stage and prod, in one landing
- Sample posts until a WordPress site is connected — never a 500
- Every merge redeploys, smoke-tested
- Its own CI from the first commit
requires:
# Cloudflare is the only provider connection a bootstrap needs. GitHub
# arrives as the App installation plus the repo link, not as a
# connection row. WordPress is NOT a provider the platform brokers: the
# site is built without it, and its owner connects one afterwards (the
# product's README, "Connecting WordPress").
integrations: [github, cloudflare]
apiKeyRole: admin # secret writes need the admin floor
# Every input is collected by the console: keys are lowercase (the
# platform's reader refuses anything else), every one carries the `pattern`
# its value is checked against before Continue, and a value the console
# already holds says so with `from`. repo-blueprint.yaml declares the same
# names; `repoPrivate`, `orunWorkspace` and `epicSlug` are build inputs with
# defaults (or filled from the build's workspace) and are not asked.
#
# NOR IS THE DOMAIN. The site goes live on workers.dev, and a domain is an
# owner's step after the bootstrap: `productdomain` defaults to empty, the
# rebrand writes the reserved placeholder `<reponame>.example.com` where
# the domain goes, and the site's README ("Custom domain") says how to set
# it. Nothing that needs a domain is removed — it waits for one.
inputs:
- key: reponame
label: Repo name
pattern: "^[a-z][a-z0-9-]{1,38}$"
# The operator picked the repository; its name IS this value.
from: repo.name
- key: productname
label: Site name
pattern: "^[A-Za-z0-9][A-Za-z0-9 .,'&-]{1,48}$"
help: The name visitors see — in the nav, the footer and the page titles.
example: Acme Notes
- key: githuborg
label: GitHub organisation
pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$"
help: The GitHub org or user the site's repository is created under.
# DERIVED FROM THE CHOSEN REPOSITORY: its owner IS this value. Declared
# because repo-blueprint.yaml requires it — a build may declare more
# inputs than this card, but not require one nobody supplies.
from: repo.owner
- key: subdomain
label: workers.dev subdomain
pattern: "^[a-z0-9][a-z0-9-]{0,62}$"
help: The workers.dev subdomain of the Cloudflare account the site deploys into.
example: acme
# READ FROM THE CLOUDFLARE CONNECTION, not asked. The subdomain belongs
# to the account the same way its id does, and there is exactly one
# right answer — a typed one could only be wrong, and wrong showed up
# after deploy, in the deploy's smoke, 01-product's probes and the
# verify URL below. The integration reads it from Cloudflare at connect
# and on its hourly health check; the bootstrap door fills this input
# from the connection the build is BOUND to, the same one
# CLOUDFLARE_ACCOUNT_ID and the deploy token mint from, so all three
# name one account. The console renders no field for it, and an account
# with no workers.dev subdomain refuses the build at the door, naming
# the fix, before anything is created.
from: connection.cloudflare.workersSubdomain
# ── PREVIEW ONLY. repo-blueprint.yaml's one `orun.integrations/reconcile@v1`
# hook (`secrets`) mints these, brokered, during 01-product. ──────────────
# Transcribed from that hook's own `secrets:` list (each key and its
# template), so testing/manifest.test.sh compares this list to the document
# that mints them. The console renders them read-only: no credential is ever typed,
# shown or stored. Keys that already exist are kept. The WordPress URL and
# the webhook secret are not here: no platform connection can mint them,
# the site is built and deployed without them, and its owner adds them
# afterwards.
secrets:
- key: CLOUDFLARE_API_TOKEN
provider: cloudflare
template: workers-deploy
why: Deploys the site's Worker and its static assets
- key: CLOUDFLARE_ACCOUNT_ID
provider: cloudflare
template: account-id
why: Connection fact, not a secret
fact: true
# ── PREVIEW ONLY. repo-blueprint.yaml's run-level `hooks.preInstantiate`
# opens these — the epic, every milestone in this order, every task — before
# the first phase places. Idempotent by identity, so a re-run finds what it
# made before.
programme:
epicSlug: cms-wordpress-baselining # = repo-blueprint.yaml's `epicSlug` default
epicName: "WordPress site baselining — {productname}"
milestones:
# The whole product is one landing (01-product): the repository, its
# CI, the site and its tests are one pull request and one convergence.
- name: 01-product
- name: 02-docs
bootstrap:
# THE BUILD DOCUMENT. There is no umbrella workflow and no agent brief:
# every phase is declared in it and orun runs it.
blueprint: repo-blueprint.yaml
# Summed from the phases' expectedMinutes (01-product 11, 02-docs 1). An
# estimate until a bootstrap on this shape measures it.
expectedMinutes: 12
tokenChannel: ORUN_TOKEN_FILE # how a runner hands over its refreshed token
# The site's URL per environment, as the console links it.
verify:
urls:
- "https://{reponame}-web-{env}.{subdomain}.workers.dev"
envs: [stage, prod]