Skip to content

Commit 83fe4b6

Browse files
committed
progress on env.variables
1 parent f7e2074 commit 83fe4b6

37 files changed

Lines changed: 1533 additions & 45 deletions

common/schemas/entities.json

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@
2626
"required": ["id", "username", "name", "tokenHash", "createdAt"],
2727
"additionalProperties": false
2828
},
29+
"EnvironmentVariableValue": {
30+
"type": "object",
31+
"properties": {
32+
"source": {
33+
"type": "string",
34+
"enum": ["inherit", "custom"],
35+
"description": "Whether to inherit the value from the host system or use a custom value"
36+
},
37+
"customValue": {
38+
"type": "string",
39+
"description": "The custom value to use when source is 'custom'"
40+
}
41+
},
42+
"required": ["source"],
43+
"additionalProperties": false,
44+
"description": "Describes how an environment variable's value is resolved. Used in {@link StackConfig } for stack-level defaults and in {@link ServiceConfig } for per-service overrides."
45+
},
2946
"GitHubRepository": {
3047
"type": "object",
3148
"properties": {
@@ -113,14 +130,21 @@
113130
"type": "string",
114131
"description": "Absolute path to the root directory for all services in this stack"
115132
},
133+
"environmentVariables": {
134+
"type": "object",
135+
"additionalProperties": {
136+
"$ref": "#/definitions/EnvironmentVariableValue"
137+
},
138+
"description": "Stack-level environment variable values, keyed by variable name"
139+
},
116140
"createdAt": {
117141
"type": "string"
118142
},
119143
"updatedAt": {
120144
"type": "string"
121145
}
122146
},
123-
"required": ["stackName", "mainDirectory", "createdAt", "updatedAt"],
147+
"required": ["stackName", "mainDirectory", "environmentVariables", "createdAt", "updatedAt"],
124148
"additionalProperties": false,
125149
"description": "User-specific stack configuration. Contains settings unique to this installation/machine. Not included in exports - set by the user during import/installation."
126150
},
@@ -217,6 +241,13 @@
217241
"type": "boolean",
218242
"description": "Whether to automatically restart the service when new commits are fetched"
219243
},
244+
"environmentVariableOverrides": {
245+
"type": "object",
246+
"additionalProperties": {
247+
"$ref": "#/definitions/EnvironmentVariableValue"
248+
},
249+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
250+
},
220251
"createdAt": {
221252
"type": "string"
222253
},
@@ -229,6 +260,7 @@
229260
"autoFetchEnabled",
230261
"autoFetchIntervalMinutes",
231262
"autoRestartOnFetch",
263+
"environmentVariableOverrides",
232264
"createdAt",
233265
"updatedAt"
234266
],
@@ -673,6 +705,13 @@
673705
"type": "string",
674706
"description": "Absolute path to the root directory for all services in this stack"
675707
},
708+
"environmentVariables": {
709+
"type": "object",
710+
"additionalProperties": {
711+
"$ref": "#/definitions/EnvironmentVariableValue"
712+
},
713+
"description": "Stack-level environment variable values, keyed by variable name"
714+
},
676715
"createdAt": {
677716
"type": "string"
678717
},
@@ -692,7 +731,16 @@
692731
"description": "Optional description of what this stack does"
693732
}
694733
},
695-
"required": ["createdAt", "description", "displayName", "mainDirectory", "name", "stackName", "updatedAt"],
734+
"required": [
735+
"createdAt",
736+
"description",
737+
"displayName",
738+
"environmentVariables",
739+
"mainDirectory",
740+
"name",
741+
"stackName",
742+
"updatedAt"
743+
],
696744
"description": "Full stack view combining definition and config for API responses"
697745
},
698746
"ServiceView": {
@@ -745,6 +793,13 @@
745793
"type": "boolean",
746794
"description": "Whether to automatically restart the service when new commits are fetched"
747795
},
796+
"environmentVariableOverrides": {
797+
"type": "object",
798+
"additionalProperties": {
799+
"$ref": "#/definitions/EnvironmentVariableValue"
800+
},
801+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
802+
},
748803
"createdAt": {
749804
"type": "string"
750805
},
@@ -808,6 +863,7 @@
808863
"createdAt",
809864
"description",
810865
"displayName",
866+
"environmentVariableOverrides",
811867
"id",
812868
"installStatus",
813869
"prerequisiteIds",

common/schemas/services-api.json

Lines changed: 120 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,41 @@
8484
"autoRestartOnFetch": {
8585
"type": "boolean",
8686
"description": "Whether to automatically restart the service when new commits are fetched"
87+
},
88+
"environmentVariableOverrides": {
89+
"type": "object",
90+
"additionalProperties": {
91+
"$ref": "#/definitions/EnvironmentVariableValue"
92+
},
93+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
8794
}
8895
},
89-
"required": ["serviceId", "autoFetchEnabled", "autoFetchIntervalMinutes", "autoRestartOnFetch"],
96+
"required": [
97+
"serviceId",
98+
"autoFetchEnabled",
99+
"autoFetchIntervalMinutes",
100+
"autoRestartOnFetch",
101+
"environmentVariableOverrides"
102+
],
90103
"additionalProperties": false
91104
},
105+
"EnvironmentVariableValue": {
106+
"type": "object",
107+
"properties": {
108+
"source": {
109+
"type": "string",
110+
"enum": ["inherit", "custom"],
111+
"description": "Whether to inherit the value from the host system or use a custom value"
112+
},
113+
"customValue": {
114+
"type": "string",
115+
"description": "The custom value to use when source is 'custom'"
116+
}
117+
},
118+
"required": ["source"],
119+
"additionalProperties": false,
120+
"description": "Describes how an environment variable's value is resolved. Used in {@link StackConfig } for stack-level defaults and in {@link ServiceConfig } for per-service overrides."
121+
},
92122
"ServiceWritableFields": {
93123
"type": "object",
94124
"additionalProperties": false,
@@ -105,6 +135,13 @@
105135
"type": "boolean",
106136
"description": "Whether to automatically restart the service when new commits are fetched"
107137
},
138+
"environmentVariableOverrides": {
139+
"type": "object",
140+
"additionalProperties": {
141+
"$ref": "#/definitions/EnvironmentVariableValue"
142+
},
143+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
144+
},
108145
"id": {
109146
"type": "string",
110147
"description": "UUID primary key"
@@ -162,6 +199,7 @@
162199
"autoRestartOnFetch",
163200
"description",
164201
"displayName",
202+
"environmentVariableOverrides",
165203
"id",
166204
"prerequisiteIds",
167205
"prerequisiteServiceIds",
@@ -232,6 +270,13 @@
232270
"type": "boolean",
233271
"description": "Whether to automatically restart the service when new commits are fetched"
234272
},
273+
"environmentVariableOverrides": {
274+
"type": "object",
275+
"additionalProperties": {
276+
"$ref": "#/definitions/EnvironmentVariableValue"
277+
},
278+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
279+
},
235280
"createdAt": {
236281
"type": "string"
237282
},
@@ -295,6 +340,7 @@
295340
"createdAt",
296341
"description",
297342
"displayName",
343+
"environmentVariableOverrides",
298344
"id",
299345
"installStatus",
300346
"prerequisiteIds",
@@ -388,6 +434,13 @@
388434
"autoRestartOnFetch": {
389435
"type": "boolean",
390436
"description": "Whether to automatically restart the service when new commits are fetched"
437+
},
438+
"environmentVariableOverrides": {
439+
"type": "object",
440+
"additionalProperties": {
441+
"$ref": "#/definitions/EnvironmentVariableValue"
442+
},
443+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
391444
}
392445
},
393446
"required": [
@@ -396,6 +449,7 @@
396449
"autoRestartOnFetch",
397450
"description",
398451
"displayName",
452+
"environmentVariableOverrides",
399453
"prerequisiteIds",
400454
"prerequisiteServiceIds",
401455
"runCommand",
@@ -472,6 +526,13 @@
472526
"autoRestartOnFetch": {
473527
"type": "boolean",
474528
"description": "Whether to automatically restart the service when new commits are fetched"
529+
},
530+
"environmentVariableOverrides": {
531+
"type": "object",
532+
"additionalProperties": {
533+
"$ref": "#/definitions/EnvironmentVariableValue"
534+
},
535+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
475536
}
476537
},
477538
"additionalProperties": false
@@ -917,7 +978,7 @@
917978
"type": "object",
918979
"properties": {
919980
"findOptions": {
920-
"$ref": "#/definitions/FindOptions%3CServiceView%2C(%22id%22%7C%22stackName%22%7C%22displayName%22%7C%22description%22%7C%22workingDirectory%22%7C%22repositoryId%22%7C%22prerequisiteIds%22%7C%22prerequisiteServiceIds%22%7C%22installCommand%22%7C%22buildCommand%22%7C%22runCommand%22%7C%22createdAt%22%7C%22updatedAt%22%7C%22serviceId%22%7C%22autoFetchEnabled%22%7C%22autoFetchIntervalMinutes%22%7C%22autoRestartOnFetch%22%7C%22cloneStatus%22%7C%22installStatus%22%7C%22buildStatus%22%7C%22runStatus%22%7C%22lastClonedAt%22%7C%22lastInstalledAt%22%7C%22lastBuiltAt%22%7C%22lastStartedAt%22%7C%22lastFetchedAt%22)%5B%5D%3E"
981+
"$ref": "#/definitions/FindOptions%3CServiceView%2C(%22id%22%7C%22stackName%22%7C%22displayName%22%7C%22description%22%7C%22workingDirectory%22%7C%22repositoryId%22%7C%22prerequisiteIds%22%7C%22prerequisiteServiceIds%22%7C%22installCommand%22%7C%22buildCommand%22%7C%22runCommand%22%7C%22createdAt%22%7C%22updatedAt%22%7C%22serviceId%22%7C%22autoFetchEnabled%22%7C%22autoFetchIntervalMinutes%22%7C%22autoRestartOnFetch%22%7C%22environmentVariableOverrides%22%7C%22cloneStatus%22%7C%22installStatus%22%7C%22buildStatus%22%7C%22runStatus%22%7C%22lastClonedAt%22%7C%22lastInstalledAt%22%7C%22lastBuiltAt%22%7C%22lastStartedAt%22%7C%22lastFetchedAt%22)%5B%5D%3E"
921982
}
922983
},
923984
"additionalProperties": false
@@ -930,7 +991,7 @@
930991
"additionalProperties": false,
931992
"description": "Rest endpoint model for getting / querying collections"
932993
},
933-
"FindOptions<ServiceView,(\"id\"|\"stackName\"|\"displayName\"|\"description\"|\"workingDirectory\"|\"repositoryId\"|\"prerequisiteIds\"|\"prerequisiteServiceIds\"|\"installCommand\"|\"buildCommand\"|\"runCommand\"|\"createdAt\"|\"updatedAt\"|\"serviceId\"|\"autoFetchEnabled\"|\"autoFetchIntervalMinutes\"|\"autoRestartOnFetch\"|\"cloneStatus\"|\"installStatus\"|\"buildStatus\"|\"runStatus\"|\"lastClonedAt\"|\"lastInstalledAt\"|\"lastBuiltAt\"|\"lastStartedAt\"|\"lastFetchedAt\")[]>": {
994+
"FindOptions<ServiceView,(\"id\"|\"stackName\"|\"displayName\"|\"description\"|\"workingDirectory\"|\"repositoryId\"|\"prerequisiteIds\"|\"prerequisiteServiceIds\"|\"installCommand\"|\"buildCommand\"|\"runCommand\"|\"createdAt\"|\"updatedAt\"|\"serviceId\"|\"autoFetchEnabled\"|\"autoFetchIntervalMinutes\"|\"autoRestartOnFetch\"|\"environmentVariableOverrides\"|\"cloneStatus\"|\"installStatus\"|\"buildStatus\"|\"runStatus\"|\"lastClonedAt\"|\"lastInstalledAt\"|\"lastBuiltAt\"|\"lastStartedAt\"|\"lastFetchedAt\")[]>": {
934995
"type": "object",
935996
"properties": {
936997
"top": {
@@ -1012,6 +1073,10 @@
10121073
"type": "string",
10131074
"enum": ["ASC", "DESC"]
10141075
},
1076+
"environmentVariableOverrides": {
1077+
"type": "string",
1078+
"enum": ["ASC", "DESC"]
1079+
},
10151080
"cloneStatus": {
10161081
"type": "string",
10171082
"enum": ["ASC", "DESC"]
@@ -1074,6 +1139,7 @@
10741139
"autoFetchEnabled",
10751140
"autoFetchIntervalMinutes",
10761141
"autoRestartOnFetch",
1142+
"environmentVariableOverrides",
10771143
"cloneStatus",
10781144
"installStatus",
10791145
"buildStatus",
@@ -2031,6 +2097,56 @@
20312097
}
20322098
]
20332099
},
2100+
"environmentVariableOverrides": {
2101+
"anyOf": [
2102+
{
2103+
"type": "object",
2104+
"properties": {
2105+
"$eq": {
2106+
"type": "object",
2107+
"additionalProperties": {
2108+
"$ref": "#/definitions/EnvironmentVariableValue"
2109+
},
2110+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
2111+
},
2112+
"$ne": {
2113+
"type": "object",
2114+
"additionalProperties": {
2115+
"$ref": "#/definitions/EnvironmentVariableValue"
2116+
},
2117+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
2118+
}
2119+
},
2120+
"additionalProperties": false
2121+
},
2122+
{
2123+
"type": "object",
2124+
"properties": {
2125+
"$in": {
2126+
"type": "array",
2127+
"items": {
2128+
"type": "object",
2129+
"additionalProperties": {
2130+
"$ref": "#/definitions/EnvironmentVariableValue"
2131+
},
2132+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
2133+
}
2134+
},
2135+
"$nin": {
2136+
"type": "array",
2137+
"items": {
2138+
"type": "object",
2139+
"additionalProperties": {
2140+
"$ref": "#/definitions/EnvironmentVariableValue"
2141+
},
2142+
"description": "Per-service environment variable overrides, keyed by variable name. Overrides stack-level defaults."
2143+
}
2144+
}
2145+
},
2146+
"additionalProperties": false
2147+
}
2148+
]
2149+
},
20342150
"cloneStatus": {
20352151
"anyOf": [
20362152
{
@@ -2528,6 +2644,7 @@
25282644
"autoFetchEnabled",
25292645
"autoFetchIntervalMinutes",
25302646
"autoRestartOnFetch",
2647+
"environmentVariableOverrides",
25312648
"cloneStatus",
25322649
"installStatus",
25332650
"buildStatus",

0 commit comments

Comments
 (0)