Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
137 lines (117 loc) · 6.68 KB
/
Copy pathTaskfile.yml
File metadata and controls
137 lines (117 loc) · 6.68 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
version: '3'
# The site: Astro Starlight under src/, and two Go tools under tools/ - refgen writes the
# reference pages from the sources they describe, linkcheck fails on a link the build did not
# produce. SPIN, TERRAFORM and BRAND are checkouts of spin-stack/spin, spin-stack/spin-terraform-aws
# and spin-stack/brand: by default the ones task sources fetches into .sources/, at the commits
# versions.yaml pins. SHOTS is where it unpacks the dashboard's screenshots, which spin's
# release carries as site-shots.tar.gz.
vars:
SPIN: '{{.SPIN | default ".sources/spin"}}'
TERRAFORM: '{{.TERRAFORM | default ".sources/spin-terraform-aws"}}'
BRAND: '{{.BRAND | default ".sources/brand"}}'
SHOTS: '{{.SHOTS | default ".sources/spin-site-shots"}}'
BASE_PATH: '{{.BASE_PATH | default "/website"}}'
tasks:
install:
desc: Install the site's dependencies from the lockfile, through Socket Firewall (sfw).
cmds:
- sfw pnpm install --frozen-lockfile
dev:
desc: Serve the site with live reload.
cmds:
- pnpm dev
sources:
desc: Fetch spin, spin-terraform-aws and brand into .sources/, each at the commit versions.yaml pins, and spin's release's screenshots (site-shots.tar.gz) beside them. spin is private - SOURCES_TOKEN, or git's own credentials, reads it.
cmds:
- go run ./tools/sources spin spin-terraform-aws brand
sources:bump:
desc: Move the pins to the newest releases - spin only to one that holds the commit pinned, brand to its main - and fetch them, and rewrite the prices. Then task reference.
cmds:
- go run ./tools/sources -bump spin spin-terraform-aws brand
- task: pricing
# The cost page's numbers: generated, dated, and refused by reference:check once they are a
# month old or of other machines than the module starts, so a figure on the page is never
# quietly stale. The sync rewrites them every day.
pricing:
desc: Write src/data/pricing.json - what the machines the module starts by default cost an hour, on demand, in each region with images, from the lists the AWS pricing page loads (tools/pricing).
cmds:
- go run ./tools/pricing -terraform {{.TERRAFORM}} -out src/data/pricing.json
sync:pr:
desc: Commit what sources:bump and reference changed to branch sync/sources as the sync App (SYNC_TOKEN, BOT its login), and open its one pull request or update it. sync.yml runs it.
cmds:
- go run ./tools/sync pr -bot '{{.BOT}}' -reference '{{.REFERENCE | default "success"}}'
sync:issue:
desc: Write spin's issue "Site vs spin main" as the sources App (SOURCES_TOKEN, BOT its login) - MODE release, the commits a bump takes in, or main, what spin main has past the pin - with the release chain. sync.yml runs it.
cmds:
- go run ./tools/sync issue -mode '{{.MODE}}' -bot '{{.BOT}}'
reference:
desc: Write the reference pages (CLI, Terraform, config file, API) and what the site copies from the spin, spin-terraform-aws and brand checkouts.
cmds:
- task: sources
- go run ./tools/refgen -spin {{.SPIN}} -terraform {{.TERRAFORM}} -brand {{.BRAND}} -shots {{.SHOTS}}
reference:check:
desc: Fail if a reference page is not what the sources say.
cmds:
- task: sources
- go run ./tools/refgen -spin {{.SPIN}} -terraform {{.TERRAFORM}} -brand {{.BRAND}} -shots {{.SHOTS}} -check
- go run ./tools/pricing -terraform {{.TERRAFORM}} -check
# A hand-written page names what it reads and the release it was read against (tools/refgen's
# reads.go), and reference:check fails once that has changed. This is the answer: after reading
# the page against the diff the check named, and correcting it.
reviewed:
desc: Stamp a hand-written page's reads with the sources as they are - PAGE=src/content/docs/<page> - once it has been read against what changed.
requires:
vars: [PAGE]
cmds:
- go run ./tools/refgen -spin {{.SPIN}} -terraform {{.TERRAFORM}} -reviewed {{.PAGE}}
reference:public:
desc: Fail if what the site has of spin-terraform-aws and brand is not what they say at the commits versions.yaml pins. Needs no spin checkout, nor any credential.
# A fork's pull request has no token to read spin with, and this half needs nothing of it:
# what the site says of spin stays as reference.json has it, and is held by reference:check.
cmds:
- go run ./tools/sources spin-terraform-aws brand
- go run ./tools/refgen -only terraform,brand -terraform .sources/spin-terraform-aws -brand .sources/brand -check
- go run ./tools/pricing -terraform .sources/spin-terraform-aws -check
build:
desc: Build the site into dist/, with llms.txt, llms-full.txt and a .md twin of every page.
cmds:
- pnpm build
links:
desc: Fail on a link to a page or an anchor the build did not produce.
cmds:
- go run ./tools/linkcheck -base {{.BASE_PATH}} dist
links:external:
desc: Open every link out of the site and every ghcr.io reference, as a reader with no credential would. Run it on the day the repositories go public.
cmds:
- go run ./tools/linkcheck -external dist
gate:
desc: What CI runs - every install through the firewall and every workflow step a task, the install, vet and the tools' tests, the reference against the public sources, the build, and every link.
cmds:
- sfw check
# The Task running this one, which taskgate asks for the task names a workflow step runs.
- taskgate -task {{.TASK_EXE}}
# AGENTS.md is loaded into every session of an agent's: a path or a task it names that the
# tree does not have is an instruction to do what cannot be done.
- refs -task {{.TASK_EXE}}
- task: install
- go vet ./...
- go test ./...
- task: reference:public
- task: build
- task: links
exposure:
desc: What this repository shows the world - every ref's commits, pull request heads included, and its issues, pull requests and comments - against .github/exposure-allow.txt.
# The repository is public: a value that lands in a pull request is published the moment the
# pull request is opened. The private repositories are named, so this finds what the daily
# workflow does, whose token sees none of the organization's.
cmds:
- exposure -allow .github/exposure-allow.txt -gitleaks-config .gitleaks.toml -private ami,ci,shipset,skills,spin,spinbox.dev-deploy spin-stack/website
check:
desc: What CI runs with the token that reads spin - the reference against the sources at their pins, and the gate.
cmds:
- task: reference:check
- task: gate
check:public:
desc: What CI runs with no token to read spin, a fork's pull request - the gate, whose reference:public needs none.
cmds:
- task: gate