You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/environments.md
+39-33Lines changed: 39 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,67 +11,70 @@ Environments let you define named configurations — sets of variables and tasks
11
11
Environments are defined at the **top level of the profile**, as a list. Each environment has a `name`, optional `variables`, and optional `tasks`.
12
12
13
13
```yaml title="profile.yaml"
14
-
name: platform
14
+
name: "platform"
15
15
16
16
environments:
17
-
- name: local
17
+
- name: "local"
18
18
variables:
19
-
- name: LOG_LEVEL
20
-
value: debug
19
+
- name: "LOG_LEVEL"
20
+
value: "debug"
21
21
tasks:
22
22
- type: Shell
23
-
cmd: docker-compose up -d db
24
-
- name: staging
23
+
cmd: "docker-compose up -d db"
24
+
- name: "staging"
25
25
variables:
26
-
- name: LOG_LEVEL
27
-
value: info
26
+
- name: "LOG_LEVEL"
27
+
value: "info"
28
28
tasks:
29
29
- type: Print
30
30
message: "Switched to staging"
31
-
- name: production
31
+
- name: "production"
32
32
variables:
33
-
- name: LOG_LEVEL
34
-
value: warn
33
+
- name: "LOG_LEVEL"
34
+
value: "warn"
35
35
tasks:
36
36
- type: Confirm
37
37
message: "Switch to production?"
38
38
39
39
repositories:
40
-
- name: api
41
-
url: git@github.com:my-org/api.git
42
-
path: ~/dev/api
40
+
- name: "api"
41
+
url: "git@github.com:my-org/api.git"
42
+
path: "~/dev/api"
43
43
```
44
44
45
45
Individual repositories can also define their own environments in their `raid.yaml`. These are merged with the profile-level environments when applied.
46
46
47
47
```yaml title="~/dev/api/raid.yaml"
48
+
name: "api"
49
+
branch: "main"
50
+
48
51
environments:
49
-
- name: local
52
+
- name: "local"
50
53
variables:
51
-
- name: DATABASE_URL
52
-
value: postgres://localhost:5432/api_dev
53
-
- name: API_PORT
54
+
- name: "DATABASE_URL"
55
+
value: "postgres://localhost:5432/api_dev"
56
+
- name: "API_PORT"
54
57
value: "3000"
55
58
tasks:
56
59
- type: Shell
57
-
cmd: docker-compose up -d db
58
-
- name: staging
60
+
cmd: "docker-compose up -d db"
61
+
- name: "staging"
59
62
variables:
60
-
- name: DATABASE_URL
61
-
value: postgres://staging-db.internal:5432/api
62
-
- name: API_PORT
63
+
- name: "DATABASE_URL"
64
+
value: "postgres://staging-db.internal:5432/api"
65
+
- name: "API_PORT"
63
66
value: "443"
64
-
- name: production
67
+
- name: "production"
65
68
variables:
66
-
- name: DATABASE_URL
67
-
value: postgres://prod-db.internal:5432/api
68
-
- name: API_PORT
69
+
- name: "DATABASE_URL"
70
+
value: "postgres://prod-db.internal:5432/api"
71
+
- name: "API_PORT"
69
72
value: "443"
70
73
tasks:
71
74
- type: Confirm
72
75
message: "Point API at production database?"
73
76
- type: Shell
74
-
cmd: ./scripts/rotate-api-key.sh
77
+
cmd: "./scripts/rotate-api-key.sh"
75
78
```
76
79
77
80
| Field | Description |
@@ -105,18 +108,21 @@ raid env list
105
108
**Use `Prompt` and `Template` for developer-specific values.** If values differ per developer (e.g. local ports), prompt for them at apply-time.
Copy file name to clipboardExpand all lines: docs/examples/custom-commands.md
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ commands:
21
21
path: "./scripts/deploy.sh staging"
22
22
- type: Print
23
23
message: "Deployed."
24
-
color: green
24
+
color: "green"
25
25
```
26
26
27
27
```bash
@@ -74,12 +74,12 @@ install:
74
74
- type: Shell
75
75
cmd: "brew install postgresql"
76
76
condition:
77
-
platform: darwin
77
+
platform: "darwin"
78
78
cmd: "! which psql"
79
79
- type: Shell
80
80
cmd: "sudo apt-get install -y postgresql"
81
81
condition:
82
-
platform: linux
82
+
platform: "linux"
83
83
cmd: "! which psql"
84
84
- type: Shell
85
85
cmd: "createdb api_dev"
@@ -116,7 +116,7 @@ commands:
116
116
concurrent: true
117
117
- type: Print
118
118
message: "All tests passed"
119
-
color: green
119
+
color: "green"
120
120
```
121
121
122
122
```bash
@@ -149,7 +149,7 @@ commands:
149
149
usage: "Pull all repos and reinstall dependencies"
150
150
tasks:
151
151
- type: Group
152
-
ref: pull-all
152
+
ref: "pull-all"
153
153
- type: Shell
154
154
cmd: "npm install"
155
155
path: "~/dev/frontend"
@@ -158,7 +158,7 @@ commands:
158
158
usage: "Pull latest and deploy"
159
159
tasks:
160
160
- type: Group
161
-
ref: pull-all
161
+
ref: "pull-all"
162
162
- type: Shell
163
163
cmd: "./scripts/deploy.sh"
164
164
```
@@ -170,12 +170,15 @@ commands:
170
170
Commands can also live in individual repository `raid.yaml` files, scoped to that service. They are automatically available when the profile is loaded.
Copy file name to clipboardExpand all lines: docs/examples/environments.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,10 +18,10 @@ Profile-level environments define shared variables and tasks that apply across a
18
18
name: "platform"
19
19
20
20
repositories:
21
-
- name: api
21
+
- name: "api"
22
22
url: "git@github.com:my-org/api.git"
23
23
path: "~/dev/api"
24
-
- name: frontend
24
+
- name: "frontend"
25
25
url: "git@github.com:my-org/frontend.git"
26
26
path: "~/dev/frontend"
27
27
@@ -45,6 +45,9 @@ environments:
45
45
Each repo defines its own environment variables and additional tasks in its `raid.yaml`:
46
46
47
47
```yaml title="~/dev/api/raid.yaml"
48
+
name: "api"
49
+
branch: "main"
50
+
48
51
environments:
49
52
- name: "local"
50
53
variables:
@@ -58,7 +61,7 @@ environments:
58
61
value: "debug"
59
62
tasks:
60
63
- type: Shell
61
-
cmd: docker-compose up -d db
64
+
cmd: "docker-compose up -d db"
62
65
- name: "staging"
63
66
variables:
64
67
- name: "DATABASE_URL"
@@ -87,6 +90,9 @@ environments:
87
90
```
88
91
89
92
```yaml title="~/dev/frontend/raid.yaml"
93
+
name: "frontend"
94
+
branch: "main"
95
+
90
96
environments:
91
97
- name: "local"
92
98
variables:
@@ -131,6 +137,9 @@ For production, the `Confirm` tasks in the profile and each repo's `raid.yaml` w
131
137
If local values differ between developers (ports, paths, credentials), use `Prompt` and `Template` tasks instead of hardcoded `variables` to generate values at apply-time:
0 commit comments