-
Notifications
You must be signed in to change notification settings - Fork 46
/
schema.json
236 lines (236 loc) · 7.33 KB
/
schema.json
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Dip Configuration Schema",
"description": "Schema for the dip.yml configuration file",
"type": "object",
"additionalProperties": false,
"definitions": {
"environment_vars": {
"type": "object",
"description": "Defines environment variables",
"additionalProperties": {
"type": ["string", "boolean", "number"]
},
"examples": [
{ "RAILS_ENV": "development" },
{ "DATABASE_URL": "postgres://user:password@db:5432/myapp_development" },
{ "PORT": "${PORT:-3000}" }
]
},
"interaction_command": {
"type": "object",
"description": "Configuration for an interaction command",
"additionalProperties": false,
"properties": {
"description": {
"type": "string",
"description": "Describes the command",
"examples": ["Run Rails commands", "Connect to PostgreSQL database"]
},
"service": {
"type": "string",
"description": "Specifies the service associated with the command",
"examples": ["web", "frontend", "db"]
},
"command": {
"type": "string",
"description": "Represents the command to be executed",
"examples": ["bundle exec rails", "npm", "psql -h db -U user myapp_development"]
},
"default_args": {
"type": "string",
"description": "Default arguments for the command",
"examples": ["server -p 3000 -b 0.0.0.0"]
},
"environment": {
"$ref": "#/definitions/environment_vars"
},
"compose": {
"type": "object",
"description": "Allows specifying Docker Compose options",
"additionalProperties": false,
"properties": {
"method": {
"type": "string",
"description": "Specifies the Docker Compose method (e.g., up, run)",
"examples": ["run", "up"]
},
"compose_method": {
"type": "string",
"description": "Specifies an alternative Docker Compose method to use in compose commands",
"examples": ["up"]
},
"run_options": {
"type": "array",
"items": {
"type": "string"
},
"description": "Options to pass to the 'docker-compose run' command",
"examples": [["service-ports", "rm"]]
},
"profiles": {
"type": "array",
"items": {
"type": "string"
},
"description": "Docker Compose profiles to use",
"examples": [["web", "development"], ["frontend"], ["test"]]
}
}
},
"shell": {
"type": "boolean",
"description": "Enables or disables shell interpolation"
},
"entrypoint": {
"type": "string",
"description": "Specifies the command entrypoint"
},
"runner": {
"type": "string",
"description": "Specifies the runner (e.g., docker_compose, kubectl)"
},
"pod": {
"type": "string",
"description": "Specifies the pod for the kubectl runner"
},
"compose_run_options": {
"type": "array",
"items": {
"type": "string"
},
"description": "DEPRECATED: Options to pass to the 'docker-compose run' command",
"examples": [["service-ports", "rm"]]
},
"subcommands": {
"type": "object",
"description": "Contains subcommands with the same structure as main commands",
"patternProperties": {
"^[\\w\\-.:/\\s]+$": {
"$ref": "#/definitions/interaction_command"
}
},
"minProperties": 1,
"additionalProperties": false
}
}
}
},
"properties": {
"version": {
"type": "string",
"description": "Specifies the minimum required version of Dip",
"examples": ["8.1.0"]
},
"compose": {
"type": "object",
"description": "Contains Docker Compose configuration",
"properties": {
"files": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of strings representing paths to Docker Compose files",
"examples": [["docker-compose.yml", "docker-compose.override.yml"]]
},
"project_name": {
"type": "string",
"description": "Specifies the project name for Docker Compose",
"examples": ["app"]
},
"command": {
"type": "string",
"description": "Specifies an alternative Docker Compose command",
"examples": ["docker compose"]
},
"method": {
"type": "string",
"description": "Specifies the Docker Compose method to use"
}
}
},
"interaction": {
"type": "object",
"description": "Defines the commands and their configurations",
"patternProperties": {
"^[\\w\\-.:/\\s]+$": {
"$ref": "#/definitions/interaction_command"
}
},
"additionalProperties": false
},
"provision": {
"type": "array",
"items": {
"type": "string"
},
"description": "Lists the commands to be executed for provisioning",
"examples": [
[
"dip compose down --volumes",
"dip compose build",
"dip rails db:migrate",
"dip npm install"
]
]
},
"environment": {
"$ref": "#/definitions/environment_vars"
},
"kubectl": {
"type": "object",
"description": "Contains Kubernetes configuration",
"additionalProperties": false,
"properties": {
"namespace": {
"type": "string",
"description": "Specifies the Kubernetes namespace to use",
"examples": ["app"]
}
}
},
"modules": {
"type": "array",
"items": {
"type": "string"
},
"description": "Paths to module configuration files",
"examples": [["production"]]
},
"infra": {
"type": "object",
"description": "Contains infrastructure services configuration",
"additionalProperties": false,
"patternProperties": {
"^[\\w\\-.:/\\s]+$": {
"type": "object",
"additionalProperties": false,
"properties": {
"git": {
"type": "string",
"pattern": "^(git@|git://|https?://)[\\w\\d.@:/\\-]+$",
"description": "Git repository URL for the infrastructure component",
"examples": ["https://github.com/mycompany/redis-config.git"]
},
"ref": {
"type": "string",
"description": "Specifies the Git reference (branch, tag, or commit) to use",
"examples": ["main"]
},
"path": {
"type": "string",
"description": "Local path to the infrastructure component",
"examples": ["./infra/elasticsearch"]
}
},
"oneOf": [
{ "required": ["git"] },
{ "required": ["path"] }
]
}
}
}
},
"required": ["version"]
}