Skip to content

Commit b68b291

Browse files
committed
Refactor YAML syntax in documentation for consistency; add quotes around keys and values
1 parent d2ad497 commit b68b291

3 files changed

Lines changed: 130 additions & 130 deletions

File tree

docs/examples/custom-commands.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ A command that runs a deploy script with a confirmation gate:
1212

1313
```yaml title="profile.raid.yaml"
1414
commands:
15-
- name: deploy
16-
usage: Deploy the API to staging
15+
- name: "deploy"
16+
usage: "Deploy the API to staging"
1717
tasks:
1818
- type: Confirm
1919
message: "Deploy API to staging?"
@@ -36,22 +36,22 @@ Use `Set` to define a variable, then reference it in later tasks or future comma
3636

3737
```yaml
3838
commands:
39-
- name: release
40-
usage: Tag and push a release
39+
- name: "release"
40+
usage: "Tag and push a release"
4141
tasks:
4242
- type: Prompt
43-
var: VERSION
43+
var: "VERSION"
4444
message: "Release version (e.g. 1.4.0)"
4545
- type: Shell
4646
cmd: |
4747
git tag v$VERSION
4848
git push origin v$VERSION
4949
export VERSION=$VERSION
50-
path: ~/dev/api
50+
path: "~/dev/api"
5151
- type: Shell
5252
cmd: |
5353
export COMMIT=$(git rev-parse --short HEAD)
54-
path: ~/dev/api
54+
path: "~/dev/api"
5555
- type: Print
5656
message: "Released v$VERSION at $COMMIT"
5757
```
@@ -72,17 +72,17 @@ Run tasks only on certain platforms or when a file or command exists:
7272
install:
7373
tasks:
7474
- type: Shell
75-
cmd: brew install postgresql
75+
cmd: "brew install postgresql"
7676
condition:
7777
platform: darwin
7878
cmd: "! which psql"
7979
- type: Shell
80-
cmd: sudo apt-get install -y postgresql
80+
cmd: "sudo apt-get install -y postgresql"
8181
condition:
8282
platform: linux
8383
cmd: "! which psql"
8484
- type: Shell
85-
cmd: createdb api_dev
85+
cmd: "createdb api_dev"
8686
condition:
8787
cmd: "! psql -lqt | grep api_dev"
8888
- type: Print
@@ -97,22 +97,22 @@ Mark adjacent tasks `concurrent: true` to run them in parallel. Raid waits for a
9797

9898
```yaml
9999
commands:
100-
- name: test-all
101-
usage: Run tests across all services in parallel
100+
- name: "test-all"
101+
usage: "Run tests across all services in parallel"
102102
tasks:
103103
- type: Print
104104
message: "Running tests..."
105105
- type: Shell
106-
cmd: go test ./...
107-
path: ~/dev/api
106+
cmd: "go test ./..."
107+
path: "~/dev/api"
108108
concurrent: true
109109
- type: Shell
110-
cmd: npm test
111-
path: ~/dev/frontend
110+
cmd: "npm test"
111+
path: "~/dev/frontend"
112112
concurrent: true
113113
- type: Shell
114-
cmd: pytest
115-
path: ~/dev/data-service
114+
cmd: "pytest"
115+
path: "~/dev/data-service"
116116
concurrent: true
117117
- type: Print
118118
message: "All tests passed"
@@ -136,31 +136,31 @@ Extract repeated sequences into a named group and reference them from multiple c
136136
task_groups:
137137
pull-all:
138138
- type: Shell
139-
cmd: git pull
140-
path: ~/dev/api
139+
cmd: "git pull"
140+
path: "~/dev/api"
141141
concurrent: true
142142
- type: Shell
143-
cmd: git pull
144-
path: ~/dev/frontend
143+
cmd: "git pull"
144+
path: "~/dev/frontend"
145145
concurrent: true
146146
147147
commands:
148-
- name: sync
149-
usage: Pull all repos and reinstall dependencies
148+
- name: "sync"
149+
usage: "Pull all repos and reinstall dependencies"
150150
tasks:
151151
- type: Group
152152
ref: pull-all
153153
- type: Shell
154-
cmd: npm install
155-
path: ~/dev/frontend
154+
cmd: "npm install"
155+
path: "~/dev/frontend"
156156
157-
- name: deploy
158-
usage: Pull latest and deploy
157+
- name: "deploy"
158+
usage: "Pull latest and deploy"
159159
tasks:
160160
- type: Group
161161
ref: pull-all
162162
- type: Shell
163-
cmd: ./scripts/deploy.sh
163+
cmd: "./scripts/deploy.sh"
164164
```
165165

166166
---
@@ -171,22 +171,22 @@ Commands can also live in individual repository `raid.yaml` files, scoped to tha
171171

172172
```yaml title="~/dev/api/raid.yaml"
173173
commands:
174-
- name: migrate
175-
usage: Run pending database migrations
174+
- name: "migrate"
175+
usage: "Run pending database migrations"
176176
tasks:
177177
- type: Set
178178
var: ENV
179-
value: local
179+
value: "local"
180180
- type: Confirm
181181
message: "Run migrations against $ENV?"
182182
- type: Shell
183-
cmd: go run ./cmd/migrate --env=$ENV
183+
cmd: "go run ./cmd/migrate --env=$ENV"
184184
185-
- name: seed
186-
usage: Seed the database with test data
185+
- name: "seed"
186+
usage: "Seed the database with test data"
187187
tasks:
188188
- type: Shell
189-
cmd: go run ./cmd/seed
189+
cmd: "go run ./cmd/seed"
190190
condition:
191191
cmd: "psql $DATABASE_URL -c '\\dt' | grep -q users"
192192
```

docs/examples/environments.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@ A platform has two services. Each service needs different variables per environm
1515
Profile-level environments define shared variables and tasks that apply across all repos. Repo-specific variables and tasks are defined in each repo's own `raid.yaml`.
1616

1717
```yaml title="platform.raid.yaml"
18-
name: platform
18+
name: "platform"
1919

2020
repositories:
2121
- name: api
22-
url: git@github.com:my-org/api.git
23-
path: ~/dev/api
22+
url: "git@github.com:my-org/api.git"
23+
path: "~/dev/api"
2424
- name: frontend
25-
url: git@github.com:my-org/frontend.git
26-
path: ~/dev/frontend
25+
url: "git@github.com:my-org/frontend.git"
26+
path: "~/dev/frontend"
2727

2828
environments:
29-
- name: local
29+
- name: "local"
3030
tasks:
3131
- type: Print
3232
message: "Switched to local"
33-
- name: staging
33+
- name: "staging"
3434
tasks:
3535
- type: Print
3636
message: "Switched to staging"
37-
- name: production
37+
- name: "production"
3838
tasks:
3939
- type: Confirm
4040
message: "Switch ALL services to production?"
@@ -46,66 +46,66 @@ Each repo defines its own environment variables and additional tasks in its `rai
4646

4747
```yaml title="~/dev/api/raid.yaml"
4848
environments:
49-
- name: local
49+
- name: "local"
5050
variables:
51-
- name: DATABASE_URL
52-
value: postgres://localhost:5432/api_dev
53-
- name: API_HOST
54-
value: localhost
55-
- name: API_PORT
51+
- name: "DATABASE_URL"
52+
value: "postgres://localhost:5432/api_dev"
53+
- name: "API_HOST"
54+
value: "localhost"
55+
- name: "API_PORT"
5656
value: "3000"
57-
- name: LOG_LEVEL
58-
value: debug
57+
- name: "LOG_LEVEL"
58+
value: "debug"
5959
tasks:
6060
- type: Shell
6161
cmd: docker-compose up -d db
62-
- name: staging
62+
- name: "staging"
6363
variables:
64-
- name: DATABASE_URL
65-
value: postgres://staging-db.internal:5432/api
66-
- name: API_HOST
67-
value: api.staging.my-org.com
68-
- name: API_PORT
64+
- name: "DATABASE_URL"
65+
value: "postgres://staging-db.internal:5432/api"
66+
- name: "API_HOST"
67+
value: "api.staging.my-org.com"
68+
- name: "API_PORT"
6969
value: "443"
70-
- name: LOG_LEVEL
71-
value: info
72-
- name: production
70+
- name: "LOG_LEVEL"
71+
value: "info"
72+
- name: "production"
7373
variables:
74-
- name: DATABASE_URL
75-
value: postgres://prod-db.internal:5432/api
76-
- name: API_HOST
77-
value: api.my-org.com
78-
- name: API_PORT
74+
- name: "DATABASE_URL"
75+
value: "postgres://prod-db.internal:5432/api"
76+
- name: "API_HOST"
77+
value: "api.my-org.com"
78+
- name: "API_PORT"
7979
value: "443"
80-
- name: LOG_LEVEL
81-
value: warn
80+
- name: "LOG_LEVEL"
81+
value: "warn"
8282
tasks:
8383
- type: Confirm
8484
message: "Point API at production database?"
8585
- type: Shell
86-
cmd: ./scripts/rotate-api-key.sh
86+
cmd: "./scripts/rotate-api-key.sh"
8787
```
8888

8989
```yaml title="~/dev/frontend/raid.yaml"
9090
environments:
91-
- name: local
91+
- name: "local"
9292
variables:
93-
- name: VITE_API_URL
94-
value: http://localhost:3000
95-
- name: VITE_ENV
96-
value: local
97-
- name: staging
93+
- name: "VITE_API_URL"
94+
value: "http://localhost:3000"
95+
- name: "VITE_ENV"
96+
value: "local"
97+
- name: "staging"
9898
variables:
99-
- name: VITE_API_URL
100-
value: https://api.staging.my-org.com
101-
- name: VITE_ENV
102-
value: staging
103-
- name: production
99+
- name: "VITE_API_URL"
100+
value: "https://api.staging.my-org.com"
101+
- name: "VITE_ENV"
102+
value: "staging"
103+
- name: "production"
104104
variables:
105-
- name: VITE_API_URL
106-
value: https://api.my-org.com
107-
- name: VITE_ENV
108-
value: production
105+
- name: "VITE_API_URL"
106+
value: "https://api.my-org.com"
107+
- name: "VITE_ENV"
108+
value: "production"
109109
tasks:
110110
- type: Confirm
111111
message: "Point frontend at production APIs?"
@@ -132,21 +132,21 @@ If local values differ between developers (ports, paths, credentials), use `Prom
132132

133133
```yaml title="~/dev/api/raid.yaml"
134134
environments:
135-
- name: local
135+
- name: "local"
136136
tasks:
137137
- type: Prompt
138-
var: DB_PORT
138+
var: "DB_PORT"
139139
message: "Local database port"
140140
default: "5432"
141141
- type: Prompt
142-
var: API_PORT
142+
var: "API_PORT"
143143
message: "Local API port"
144144
default: "3000"
145145
- type: Template
146-
src: ./envs/local.env.tmpl
147-
dest: ~/dev/api/.env
146+
src: "./envs/local.env.tmpl"
147+
dest: "~/dev/api/.env"
148148
- type: Shell
149-
cmd: docker-compose up -d db
149+
cmd: "docker-compose up -d db"
150150
```
151151

152152
```bash title="~/dev/api/envs/local.env.tmpl"

0 commit comments

Comments
 (0)