Skip to content

Commit c9bd37b

Browse files
authored
Add lifecycle hooks to devContainerFeature schema
With CLI v0.32.0 and devcontainers/cli#390, devcontainer-feature.json now support lifecycle hooks. Spec proposal: https://github.com/devcontainers/spec/blob/b1d19a5375f667a1bb91e86311bc37c36312996b/proposals/features-contribute-lifecycle-scripts.md
1 parent b1d19a5 commit c9bd37b

File tree

1 file changed

+101
-1
lines changed

1 file changed

+101
-1
lines changed

schemas/devContainerFeature.schema.json

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,107 @@
102102
"deprecated": {
103103
"description": "Indicates that the Feature is deprecated, and will not receive any further updates/support. This property is intended to be used by the supporting tools for highlighting Feature deprecation.",
104104
"type": "boolean"
105-
}
105+
},
106+
"onCreateCommand": {
107+
"type": [
108+
"string",
109+
"array",
110+
"object"
111+
],
112+
"description": "A command to run when creating the container. This command is run after \"initializeCommand\" and before \"updateContentCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
113+
"items": {
114+
"type": "string"
115+
},
116+
"additionalProperties": {
117+
"type": [
118+
"string",
119+
"array"
120+
],
121+
"items": {
122+
"type": "string"
123+
}
124+
}
125+
},
126+
"updateContentCommand": {
127+
"type": [
128+
"string",
129+
"array",
130+
"object"
131+
],
132+
"description": "A command to run when creating the container and rerun when the workspace content was updated while creating the container. This command is run after \"onCreateCommand\" and before \"postCreateCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
133+
"items": {
134+
"type": "string"
135+
},
136+
"additionalProperties": {
137+
"type": [
138+
"string",
139+
"array"
140+
],
141+
"items": {
142+
"type": "string"
143+
}
144+
}
145+
},
146+
"postCreateCommand": {
147+
"type": [
148+
"string",
149+
"array",
150+
"object"
151+
],
152+
"description": "A command to run after creating the container. This command is run after \"updateContentCommand\" and before \"postStartCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
153+
"items": {
154+
"type": "string"
155+
},
156+
"additionalProperties": {
157+
"type": [
158+
"string",
159+
"array"
160+
],
161+
"items": {
162+
"type": "string"
163+
}
164+
}
165+
},
166+
"postStartCommand": {
167+
"type": [
168+
"string",
169+
"array",
170+
"object"
171+
],
172+
"description": "A command to run after starting the container. This command is run after \"postCreateCommand\" and before \"postAttachCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
173+
"items": {
174+
"type": "string"
175+
},
176+
"additionalProperties": {
177+
"type": [
178+
"string",
179+
"array"
180+
],
181+
"items": {
182+
"type": "string"
183+
}
184+
}
185+
},
186+
"postAttachCommand": {
187+
"type": [
188+
"string",
189+
"array",
190+
"object"
191+
],
192+
"description": "A command to run when attaching to the container. This command is run after \"postStartCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
193+
"items": {
194+
"type": "string"
195+
},
196+
"additionalProperties": {
197+
"type": [
198+
"string",
199+
"array"
200+
],
201+
"items": {
202+
"type": "string"
203+
}
204+
}
205+
}
106206
},
107207
"required": [
108208
"id",

0 commit comments

Comments
 (0)