-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathscalingo.schema.json
274 lines (274 loc) · 12.3 KB
/
scalingo.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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "scalingo.json schema https://doc.scalingo.com/platform/app/app-manifest",
"description": "Extracted from https://developers.scalingo.com/scalingo-json-schema/",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": { "type": "string" },
"name": {
"description": "Complete name of the project",
"type": "string",
"default": "NameOfMyApp"
},
"description": {
"type": "string",
"description": "Description in one or two sentences of the app"
},
"website": {
"type": "string",
"description": "Official website of the application if any"
},
"logo": {
"type": "string",
"description": "URL to the logo of the project"
},
"repository": {
"type": "string",
"description": "Location of the GIT repository of the project"
},
"ref": {
"type": "string",
"description": "Branch name or commit ID of the code to use"
},
"stack": {
"description": "Name of the stack to use : https://doc.scalingo.com/platform/internals/stacks/stacks",
"type": "string",
"enum": ["scalingo-22", "scalingo-20", "scalingo-18", "scalingo-14"],
"default": "scalingo-22"
},
"copy_parent_database_urls": {
"enum": ["true", "false", true, false],
"description": "Copy database credentials from parent app"
},
"formation": {
"$ref": "#/definitions/formation",
"default": {
"web": { "amount": 1, "size": "S" }
}
},
"env": {
"$ref": "#/definitions/env",
"default": {
"APP_VAR1": {
"description": "Some custom variable",
"value": "some value"
},
"APP_VAR2": {
"description": "Example of a variable from a template",
"generator": "template",
"template": "Pull Request Number %PR_NUMBER%"
},
"APP_SECRET": {
"description": "Example of a generated secret",
"generator": "secret"
},
"APP_URL": {
"description": "Example of a generated URL",
"generator": "url"
}
}
},
"scripts": {
"description": "The scripts.postdeploy key is now deprecated in favor of postdeploy hook in the Procfile.\n\nMore information on the dedicated page : https://doc.scalingo.com/platform/app/review-apps#run-a-task-after-the-first-deployment-of-a-review-app",
"type": "object",
"additionalProperties": false,
"properties": {
"first-deploy": {
"description": "Job to run as postdeploy hook at the first deployment of a review app or one-click deployed app",
"type": "string"
}
},
"required": [],
"default": {
"first-deploy": "bundle exec rake db:deploy db:seed"
}
},
"addons": {
"$ref": "#/definitions/addons",
"default": [
{
"plan": "postgresql:postgresql-sandbox"
}
]
}
},
"required": ["name"],
"definitions": {
"addons": {
"description": "If no addons key is specified, the default behaviour is to duplicate the addons from the parent application.\n\nThe addons field contains an array of object describing the addons you need to deploy for your review app.\n\nSee https://doc.scalingo.com/addons",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"plan": {
"description": "The plan uses the format addon-name:plan-id. E.g. mongodb:mongo-starter-256 or redis:redis-sandbox.\n\nSee https://doc.scalingo.com/addons",
"type": "string",
"examples": [
"postgresql:postgresql-sandbox",
"postgresql:postgresql-starter-256",
"postgresql:postgresql-starter-512",
"postgresql:postgresql-starter-1024",
"redis:redis-sandbox",
"redis:redis-starter-256",
"redis:redis-starter-512",
"mongodb:mongo-sandbox",
"mongodb:mongo-starter-256",
"mongodb:mongo-starter-256"
]
},
"options": {
"description": "The only options field is version which contains the version to deploy (e.g. 4.0.16-1).",
"type": "object",
"additionalProperties": true,
"properties": {
"version": {
"description": "The version to deploy (e.g. 4.0.16-1)",
"type": "string",
"examples": ["4.0.16-1"]
}
}
}
},
"required": ["plan"]
}
},
"formation": {
"description": "Formation of containers when an app is created\n\nThe formation is the definition of the container which will be started once the application is deployed. (Either coming from a one-click deployment button, or a review app from the GitHub integration)\n\nSee https://doc.scalingo.com/platform/app/scaling",
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"amount": {
"description": "Number of containers to start once the application is deployed",
"type": "number"
},
"size": {
"description": "Container size name. see https://doc.scalingo.com/platform/internals/container-sizes",
"enum": ["S", "M", "L", "XL", "2XL"]
}
},
"required": ["amount", "size"]
}
},
"env": {
"description": "The keys of the environment object are the name of the variables you want to add.\n\nNote: supplying null or an empty string to value will remove the variable from the environment.\n\nIt can be used to delete environment variables present in the parent app.\n\nSee https://doc.scalingo.com/platform/app/environment",
"markdownDescription": "The keys of the environment object are the name of the variables you want to add.\n\nNote: supplying null or an empty string to value will remove the variable from the environment.\n\nIt can be used to delete environment variables present in the parent app.\n\nSee https://doc.scalingo.com/platform/app/environment",
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "object",
"description": "Name of the env variable",
"additionalProperties": false,
"properties": {
"description": {
"description": "Description of the variable to explain what it does",
"type": "string"
},
"generator": {
"description": "Generates a unique token as a default value of the variable\n\nUseful for instance when one need to generate a unique encryption seed key, example: `90ffea2d3071e8d86cafb89ff5060883`.",
"markdownDescription": "Generates a unique token as a default value of the variable\n\nUseful for instance when one need to generate a unique encryption seed key, example: `90ffea2d3071e8d86cafb89ff5060883`.",
"const": "secret"
},
"required": {
"description": "Mandatory to fill the value before deploying the one-click",
"enum": ["true", "false", true, false]
}
},
"required": ["generator"]
},
{
"type": "object",
"description": "Name of the env variable",
"additionalProperties": false,
"properties": {
"description": {
"description": "Description of the variable to explain what it does",
"type": "string"
},
"generator": {
"description": "Automatically inserts the URL of the application after its deployment.\n\nWhen this generator is used, the template property is taken into account, the token `%URL%` can be used to be replaced by the created app URL",
"markdownDescription": "Automatically inserts the URL of the application after its deployment.\n\nWhen this generator is used, the template property is taken into account, the token `%URL%` can be used to be replaced by the created app URL",
"const": "url"
},
"template": {
"description": "Template to generate value from\n\nGenerates an environment variable based on the content of the template field.\n\nThe following tokens are substituted dynamically by the expected values when surrounded by %: `APP, PARENT_APP, PR_NUMBER, URL`",
"markdownDescription": "Template to generate value from\n\nGenerates an environment variable based on the content of the template field.\n\nThe following tokens are substituted dynamically by the expected values when surrounded by %: `APP, PARENT_APP, PR_NUMBER, URL`",
"examples": ["Pull Request Number %PR_NUMBER%"],
"type": "string"
},
"required": {
"description": "Mandatory to fill the value before deploying the one-click",
"enum": ["true", "false", true, false]
}
},
"required": ["generator"]
},
{
"type": "object",
"description": "Name of the env variable",
"additionalProperties": false,
"properties": {
"description": {
"description": "Description of the variable to explain what it does",
"type": "string"
},
"value": {
"description": "Default value of the variable",
"type": "string"
},
"required": {
"description": "Mandatory to fill the value before deploying the one-click",
"enum": ["true", "false", true, false]
}
},
"required": ["value"]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"description": {
"description": "Description of the variable to explain what it does",
"type": "string"
},
"generator": {
"description": "Use a template, see template property\n\n`url`: automatically inserts the URL of the application after its deployment. When this generator is used, the template property is taken into account, the token `%URL%` can be used to be replaced by the created app URL",
"markdownDescription": "Use a template, see template property\n\n`url`: automatically inserts the URL of the application after its deployment. When this generator is used, the template property is taken into account, the token `%URL%` can be used to be replaced by the created app URL",
"const": "template"
},
"template": {
"description": "(if generator is `url` or `template`) Template to generate value from\n\nGenerates an environment variable based on the content of the template field.\n\nThe following tokens are substituted dynamically by the expected values when surrounded by %: `APP, PARENT_APP, PR_NUMBER`",
"markdownDescription": "(if generator is `url` or `template`) Template to generate value from\n\nGenerates an environment variable based on the content of the template field.\n\nThe following tokens are substituted dynamically by the expected values when surrounded by %: `APP, PARENT_APP, PR_NUMBER`",
"examples": ["Pull Request Number %PR_NUMBER%"],
"type": "string"
},
"required": {
"description": "Mandatory to fill the value before deploying the one-click",
"enum": ["true", "false", true, false]
}
},
"required": ["generator", "template"]
}
],
"examples": [
{
"description": "Some text variable",
"value": "some value"
},
{
"description": "Some generated token",
"generator": "secret"
},
{
"description": "Some template",
"generator": "template",
"template": "Pull Request Number %PR_NUMBER%"
}
]
}
}
}
}