Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit d090296

Browse files
authored
updates to support flexible options (microsoft/vscode-remote-release#5442) (#1076)
1 parent ed6d6fd commit d090296

File tree

2 files changed

+126
-31
lines changed

2 files changed

+126
-31
lines changed

script-library/container-features/src/feature-scripts.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ _VSC_INSTALL_DOCKER_IN_DOCKER="docker-in-docker-debian.sh true automatic ${_BUIL
22
_VSC_INSTALL_DOCKER_FROM_DOCKER="docker-debian.sh true /var/run/docker-host.sock /var/run/docker.sock automatic ${_BUILD_ARG_DOCKER_FROM_DOCKER_MOBY:-true}"
33
_VSC_INSTALL_KUBECTL_HELM_MINIKUBE="kubectl-helm-debian.sh ${_BUILD_ARG_KUBECTL_HELM_MINIKUBE_VERSION:-latest} ${_BUILD_ARG_KUBECTL_HELM_MINIKUBE_HELM:-latest} ${_BUILD_ARG_KUBECTL_HELM_MINIKUBE_MINIKUBE:-latest}"
44
_VSC_INSTALL_TERRAFORM="terraform-debian.sh ${_BUILD_ARG_TERRAFORM_VERSION:-latest} ${_BUILD_ARG_TERRAFORM_TFLINT:-latest} ${_BUILD_ARG_TERRAFORM_TERRAGRUNT:-latest}"
5-
_VSC_INSTALL_GIT="git-from-src-debian.sh latest true"
5+
_VSC_INSTALL_GIT="git-from-src-debian.sh ${_BUILD_ARG_GIT_VERSION:-latest} ${_BUILD_ARG_GIT_PPA:-true}"
66
_VSC_INSTALL_GIT_LFS=git-lfs-debian.sh
7-
_VSC_INSTALL_GITHUB_CLI=github-debian.sh
7+
_VSC_INSTALL_GITHUB_CLI=github-debian.sh ${_BUILD_ARG_GITHUB_CLI_VERSION:-latest}
88
_VSC_INSTALL_AZURE_CLI=azcli-debian.sh
99
_VSC_INSTALL_SSH=sshd-debian.sh
1010
_VSC_INSTALL_HOMEBREW=homebrew-debian.sh

script-library/container-features/src/features.json

Lines changed: 124 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,19 @@
44
{
55
"id": "docker-in-docker",
66
"name": "Docker (Moby) support (Docker-in-Docker)",
7-
"type": "option",
8-
"default": false,
7+
"options": {
8+
"version": {
9+
"type": "string",
10+
"enum": ["latest"],
11+
"default": "latest",
12+
"description": "Currently unused."
13+
},
14+
"moby": {
15+
"type": "boolean",
16+
"default": true,
17+
"description": "Install OSS Moby build instead of Docker CE"
18+
}
19+
},
920
"buildArg": "_VSC_INSTALL_DOCKER_IN_DOCKER",
1021
"entrypoint": "/usr/local/share/docker-init.sh",
1122
"privileged": true,
@@ -51,8 +62,14 @@
5162
{
5263
"id": "docker-from-docker",
5364
"name": "Docker (Moby) support, reuse host Docker Engine (Docker-from-Docker)",
54-
"type": "option",
55-
"default": false,
65+
"options": {
66+
"version": {
67+
"type": "string",
68+
"enum": ["latest"],
69+
"default": "latest",
70+
"description": "Currently unused."
71+
}
72+
},
5673
"buildArg": "_VSC_INSTALL_DOCKER_FROM_DOCKER",
5774
"entrypoint": "/usr/local/share/docker-init.sh",
5875
"init": true,
@@ -93,7 +110,6 @@
93110
"python-3-postgres"
94111
]
95112
},
96-
// Problem #3 - there's three versions here and they go together as a unit, and no ability to pin to a version
97113
{
98114
"id": "kubectl-helm-minikube",
99115
"name": "Kubectl, Helm, and Minkube",
@@ -103,9 +119,20 @@
103119
"proposals": ["latest", "1.22", "1.21", "1.20"],
104120
"default": "latest",
105121
"description": "Select or enter a Kubernetes version to install"
122+
},
123+
"helm": {
124+
"type": "string",
125+
"proposals": ["latest"],
126+
"default": "latest",
127+
"description": "Select or enter a Helm version to install"
128+
},
129+
"minikube": {
130+
"type": "string",
131+
"proposals": ["latest"],
132+
"default": "latest",
133+
"description": "Select or enter a Minikube version to install"
106134
}
107135
},
108-
// Expects: helm, minikube
109136
"init": true,
110137
"buildArg": "_VSC_INSTALL_KUBECTL_HELM_MINIKUBE",
111138
"extensions": [
@@ -143,7 +170,6 @@
143170
"python-3-postgres"
144171
]
145172
},
146-
// Problem #3 - Terraform also involves three versions here and they go together as a unit, and no ability to pin to a version
147173
{
148174
"id": "terraform",
149175
"name": "Terraform, tflint, and TFGrunt",
@@ -153,9 +179,20 @@
153179
"proposals": ["latest", "1.0", "0.15"],
154180
"default": "latest",
155181
"description": "Terraform version"
182+
},
183+
"tflint": {
184+
"type": "string",
185+
"proposals": ["latest"],
186+
"default": "latest",
187+
"description": "Tflint version"
188+
},
189+
"terragrunt": {
190+
"type": "string",
191+
"proposals": ["latest"],
192+
"default": "latest",
193+
"description": "Terragrunt version"
156194
}
157195
},
158-
// Expects versions for: tflint, terragrunt
159196
"init": true,
160197
"buildArg": "_VSC_INSTALL_TERRAFORM",
161198
"extensions": [
@@ -197,8 +234,19 @@
197234
{
198235
"id": "git",
199236
"name": "Git (latest version - may require compilation)",
200-
"type": "option",
201-
"default": false,
237+
"options": {
238+
"version": {
239+
"type": "string",
240+
"enum": ["latest"],
241+
"default": "latest",
242+
"description": "Currently unused."
243+
},
244+
"ppa": {
245+
"type": "boolean",
246+
"default": true,
247+
"description": "Install from PPA if available"
248+
}
249+
},
202250
"init": true,
203251
"buildArg": "_VSC_INSTALL_GIT",
204252
"include": [
@@ -232,8 +280,14 @@
232280
{
233281
"id": "git-lfs",
234282
"name": "Git Large File Support (LFS)",
235-
"type": "option",
236-
"default": false,
283+
"options": {
284+
"version": {
285+
"type": "string",
286+
"enum": ["latest"],
287+
"default": "latest",
288+
"description": "Currently unused."
289+
}
290+
},
237291
"init": true,
238292
"buildArg": "_VSC_INSTALL_GIT_LFS",
239293
"include": [
@@ -267,8 +321,14 @@
267321
{
268322
"id": "github-cli",
269323
"name": "GitHub CLI",
270-
"type": "option",
271-
"default": false,
324+
"options": {
325+
"version": {
326+
"type": "string",
327+
"proposals": ["latest"],
328+
"default": "latest",
329+
"description": "Select version of the GitHub CLI, if not latest."
330+
}
331+
},
272332
"init": true,
273333
"buildArg": "_VSC_INSTALL_GITHUB_CLI",
274334
"include": [
@@ -304,8 +364,14 @@
304364
{
305365
"id": "azure-cli",
306366
"name": "Azure CLI",
307-
"type": "option",
308-
"default": false,
367+
"options": {
368+
"version": {
369+
"type": "string",
370+
"enum": ["latest"],
371+
"default": "latest",
372+
"description": "Currently unused."
373+
}
374+
},
309375
"init": true,
310376
"buildArg": "_VSC_INSTALL_AZURE_CLI",
311377
"extensions": [
@@ -341,8 +407,14 @@
341407
{
342408
"id": "sshd",
343409
"name": "SSH server",
344-
"type": "option",
345-
"default": false,
410+
"options": {
411+
"version": {
412+
"type": "string",
413+
"enum": ["latest"],
414+
"default": "latest",
415+
"description": "Currently unused."
416+
}
417+
},
346418
"init": true,
347419
"buildArg": "_VSC_INSTALL_SSH",
348420
"include": [
@@ -378,8 +450,14 @@
378450
{
379451
"id": "desktop-lite",
380452
"name": "Light-weight desktop (Fluxbox)",
381-
"type": "option",
382-
"default": false,
453+
"options": {
454+
"version": {
455+
"type": "string",
456+
"enum": ["latest"],
457+
"default": "latest",
458+
"description": "Currently unused."
459+
}
460+
},
383461
"init": true,
384462
"buildArg": "_VSC_INSTALL_DESKTOP_LITE",
385463
"include": [
@@ -415,8 +493,14 @@
415493
{
416494
"id": "homebrew",
417495
"name": "Homebrew",
418-
"type": "option",
419-
"default": false,
496+
"options": {
497+
"version": {
498+
"type": "string",
499+
"enum": ["latest"],
500+
"default": "latest",
501+
"description": "Currently unused."
502+
}
503+
},
420504
"init": true,
421505
"buildArg": "_VSC_INSTALL_HOMEBREW",
422506
"containerEnv": {
@@ -459,7 +543,7 @@
459543
"options": {
460544
"version": {
461545
"type": "string",
462-
"proposals": [ "lts","latest","16", "14", "12" ],
546+
"proposals": [ "lts", "latest", "16", "14", "12" ],
463547
"default": "lts",
464548
"description": "Select or enter a Node.js version to install"
465549
}
@@ -496,13 +580,12 @@
496580
"options": {
497581
"version": {
498582
"type": "string",
499-
"enum": ["latest", "3.9", "3.8", "3.7", "3.6"],
583+
"enum": [ "latest", "3.9", "3.8", "3.7", "3.6" ],
500584
"default": "latest",
501585
"description": "Select a Python version to install"
502586
}
503587
},
504588
"init": true,
505-
"default": false,
506589
"buildArg": "_VSC_INSTALL_PYTHON",
507590
"extensions": [
508591
"ms-python.python",
@@ -813,8 +896,14 @@
813896
{
814897
"id": "rust",
815898
"name": "Rust",
816-
"type": "option",
817-
"default": false,
899+
"options": {
900+
"version": {
901+
"type": "string",
902+
"enum": ["latest"],
903+
"default": "latest",
904+
"description": "Currently unused."
905+
}
906+
},
818907
"init": true,
819908
"buildArg": "_VSC_INSTALL_RUST",
820909
"extensions": [
@@ -871,8 +960,14 @@
871960
{
872961
"id": "powershell",
873962
"name": "PowerShell",
874-
"type": "option",
875-
"default": false,
963+
"options": {
964+
"version": {
965+
"type": "string",
966+
"enum": ["latest"],
967+
"default": "latest",
968+
"description": "Currently unused."
969+
}
970+
},
876971
"init": true,
877972
"buildArg": "_VSC_INSTALL_POWERSHELL",
878973
"include": [

0 commit comments

Comments
 (0)