@@ -39,242 +39,227 @@ type Config struct {
39
39
func (c * Config ) Options () serpent.OptionSet {
40
40
return serpent.OptionSet {
41
41
{
42
- Name : "Setup Script" ,
43
- Env : "SETUP_SCRIPT" ,
44
42
Flag : "setup-script" ,
43
+ Env : "SETUP_SCRIPT" ,
45
44
Value : serpent .StringOf (& c .SetupScript ),
46
- Description : `SetupScript is the script to run before the init script.
47
- It runs as the root user regardless of the user specified
48
- in the devcontainer.json file.
49
-
50
- SetupScript is ran as the root user prior to the init script.
51
- It is used to configure envbuilder dynamically during the runtime.
52
- e.g. specifying whether to start ` + "`systemd`" + ` or ` + "`tiny init`" + ` for PID 1.` ,
45
+ Description : "SetupScript is the script to run before the init script. It runs as " +
46
+ "the root user regardless of the user specified in the devcontainer.json " +
47
+ "file.\n \n SetupScript is ran as the root user prior to the init script. " +
48
+ "It is used to configure envbuilder dynamically during the runtime. e.g. " +
49
+ "specifying whether to start systemd or tiny init for PID 1." ,
53
50
},
54
51
{
55
- Name : "Init Script " ,
52
+ Flag : "init-script " ,
56
53
Env : "INIT_SCRIPT" ,
57
54
Default : "sleep infinity" ,
58
55
Value : serpent .StringOf (& c .InitScript ),
59
56
Description : "InitScript is the script to run to initialize the workspace." ,
60
57
},
61
58
{
62
- Name : "Init Command " ,
59
+ Flag : "init-command " ,
63
60
Env : "INIT_COMMAND" ,
64
61
Default : "/bin/sh" ,
65
62
Value : serpent .StringOf (& c .InitCommand ),
66
63
Description : "InitCommand is the command to run to initialize the workspace." ,
67
64
},
68
65
{
69
- Name : "Init Args " ,
66
+ Flag : "init-args " ,
70
67
Env : "INIT_ARGS" ,
71
68
Value : serpent .StringOf (& c .InitArgs ),
72
- Description : ` InitArgs are the arguments to pass to the init command.
73
- They are split according to ` + "` /bin/sh`" + ` rules with
74
- https://github.com/kballard/go-shellquote.` ,
69
+ Description : " InitArgs are the arguments to pass to the init command. They are " +
70
+ " split according to /bin/sh rules with " +
71
+ " https://github.com/kballard/go-shellquote." ,
75
72
},
76
73
{
77
- Name : "Cache Repo " ,
74
+ Flag : "cache-repo " ,
78
75
Env : "CACHE_REPO" ,
79
76
Value : serpent .StringOf (& c .CacheRepo ),
80
- Description : `CacheRepo is the name of the container registry
81
- to push the cache image to. If this is empty, the cache
82
- will not be pushed.` ,
77
+ Description : "CacheRepo is the name of the container registry to push the cache " +
78
+ "image to. If this is empty, the cache will not be pushed." ,
83
79
},
84
80
{
85
- Name : "Base Image Cache Dir " ,
81
+ Flag : "base-image-cache-dir " ,
86
82
Env : "BASE_IMAGE_CACHE_DIR" ,
87
83
Value : serpent .StringOf (& c .BaseImageCacheDir ),
88
- Description : ` BaseImageCacheDir is the path to a directory where the base
89
- image can be found. This should be a read-only directory
90
- solely mounted for the purpose of caching the base image.` ,
84
+ Description : " BaseImageCacheDir is the path to a directory where the base image " +
85
+ " can be found. This should be a read-only directory solely mounted " +
86
+ " for the purpose of caching the base image." ,
91
87
},
92
88
{
93
- Name : "Layer Cache Dir " ,
89
+ Flag : "layer-cache-dir " ,
94
90
Env : "LAYER_CACHE_DIR" ,
95
91
Value : serpent .StringOf (& c .LayerCacheDir ),
96
- Description : ` LayerCacheDir is the path to a directory where built layers
97
- will be stored. This spawns an in-memory registry to serve
98
- the layers from.` ,
92
+ Description : " LayerCacheDir is the path to a directory where built layers will " +
93
+ " be stored. This spawns an in-memory registry to serve the layers " +
94
+ " from." ,
99
95
},
100
96
{
101
- Name : "Devcontainer Dir " ,
97
+ Flag : "devcontainer-dir " ,
102
98
Env : "DEVCONTAINER_DIR" ,
103
99
Value : serpent .StringOf (& c .DevcontainerDir ),
104
- Description : `DevcontainerDir is a path to the folder containing
105
- the devcontainer.json file that will be used to build the
106
- workspace and can either be an absolute path or a path
107
- relative to the workspace folder. If not provided, defaults to
108
- ` + "`.devcontainer`" + `.` ,
100
+ Description : "DevcontainerDir is a path to the folder containing the " +
101
+ "devcontainer.json file that will be used to build the workspace " +
102
+ "and can either be an absolute path or a path relative to the " +
103
+ "workspace folder. If not provided, defaults to `.devcontainer`." ,
109
104
},
110
105
{
111
- Name : "Devcontainer JSON Path " ,
106
+ Flag : "devcontainer-json-path " ,
112
107
Env : "DEVCONTAINER_JSON_PATH" ,
113
108
Value : serpent .StringOf (& c .DevcontainerJSONPath ),
114
- Description : `DevcontainerJSONPath is a path to a devcontainer.json file
115
- that is either an absolute path or a path relative to
116
- DevcontainerDir. This can be used in cases where one wants
117
- to substitute an edited devcontainer.json file for the one
118
- that exists in the repo.` ,
109
+ Description : "DevcontainerJSONPath is a path to a devcontainer.json file that " +
110
+ "is either an absolute path or a path relative to DevcontainerDir. " +
111
+ "This can be used in cases where one wants to substitute an edited " +
112
+ "devcontainer.json file for the one that exists in the repo." ,
119
113
},
120
114
{
121
- Name : "Dockerfile Path " ,
115
+ Flag : "dockerfile-path " ,
122
116
Env : "DOCKERFILE_PATH" ,
123
117
Value : serpent .StringOf (& c .DockerfilePath ),
124
- Description : ` DockerfilePath is a relative path to the Dockerfile that
125
- will be used to build the workspace. This is an alternative
126
- to using a devcontainer that some might find simpler.` ,
118
+ Description : " DockerfilePath is a relative path to the Dockerfile that will " +
119
+ " be used to build the workspace. This is an alternative to using " +
120
+ " a devcontainer that some might find simpler." ,
127
121
},
128
122
{
129
- Name : "Build Context Path " ,
130
- Env : ` BUILD_CONTEXT_PATH` ,
123
+ Flag : "build-context-path " ,
124
+ Env : " BUILD_CONTEXT_PATH" ,
131
125
Value : serpent .StringOf (& c .BuildContextPath ),
132
- Description : `BuildContextPath can be specified when a DockerfilePath is specified outside the base WorkspaceFolder.
133
- This path MUST be relative to the WorkspaceFolder path into which the repo is cloned.` ,
126
+ Description : "BuildContextPath can be specified when a DockerfilePath is " +
127
+ "specified outside the base WorkspaceFolder. This path MUST be " +
128
+ "relative to the WorkspaceFolder path into which the repo is cloned." ,
134
129
},
135
130
{
136
- Name : "Cache TTL Days " ,
131
+ Flag : "cache-ttl-days " ,
137
132
Env : "CACHE_TTL_DAYS" ,
138
133
Value : serpent .Int64Of (& c .CacheTTLDays ),
139
- Description : ` CacheTTLDays is the number of days to use cached layers before
140
- expiring them. Defaults to 7 days.` ,
134
+ Description : " CacheTTLDays is the number of days to use cached layers before " +
135
+ " expiring them. Defaults to 7 days." ,
141
136
},
142
137
{
143
- Name : "Docker Config Base64 " ,
138
+ Flag : "docker-config-base64 " ,
144
139
Env : "DOCKER_CONFIG_BASE64" ,
145
140
Value : serpent .StringOf (& c .DockerConfigBase64 ),
146
- Description : `DockerConfigBase64 is a base64 encoded Docker config
147
- file that will be used to pull images from private
148
- container registries.` ,
141
+ Description : "DockerConfigBase64 is a base64 encoded Docker config file that " +
142
+ "will be used to pull images from private container registries." ,
149
143
},
150
144
{
151
- Name : "Fallback Image " ,
145
+ Flag : "fallback-image " ,
152
146
Env : "FALLBACK_IMAGE" ,
153
147
Value : serpent .StringOf (& c .FallbackImage ),
154
- Description : `FallbackImage specifies an alternative image to use when neither
155
- an image is declared in the devcontainer.json file nor a Dockerfile is present.
156
- If there's a build failure (from a faulty Dockerfile) or a misconfiguration,
157
- this image will be the substitute.
158
- Set ` + "`ExitOnBuildFailure`" + ` to true to halt the container if the build faces an issue.` ,
148
+ Description : "FallbackImage specifies an alternative image to use when neither " +
149
+ "an image is declared in the devcontainer.json file nor a Dockerfile " +
150
+ "is present. If there's a build failure (from a faulty Dockerfile) " +
151
+ "or a misconfiguration, this image will be the substitute. Set " +
152
+ "ExitOnBuildFailure to true to halt the container if the build " +
153
+ "faces an issue." ,
159
154
},
160
155
{
156
+ Flag : "exit-on-build-failure" ,
161
157
Env : "EXIT_ON_BUILD_FAILURE" ,
162
158
Value : serpent .BoolOf (& c .ExitOnBuildFailure ),
163
- Description : ` ExitOnBuildFailure terminates the container upon a build failure.
164
- This is handy when preferring the ` + "` FALLBACK_IMAGE`" + ` in cases where
165
- no devcontainer.json or image is provided. However, it ensures
166
- that the container stops if the build process encounters an error.` ,
159
+ Description : " ExitOnBuildFailure terminates the container upon a build failure. " +
160
+ " This is handy when preferring the FALLBACK_IMAGE in cases where " +
161
+ " no devcontainer.json or image is provided. However, it ensures " +
162
+ " that the container stops if the build process encounters an error." ,
167
163
},
168
164
{
169
- Name : "Force Safe " ,
165
+ Flag : "force-safe " ,
170
166
Env : "FORCE_SAFE" ,
171
167
Value : serpent .BoolOf (& c .ForceSafe ),
172
- Description : `ForceSafe ignores any filesystem safety checks.
173
- This could cause serious harm to your system!
174
- This is used in cases where bypass is needed
175
- to unblock customers.` ,
168
+ Description : "ForceSafe ignores any filesystem safety checks. This could cause " +
169
+ "serious harm to your system! This is used in cases where bypass " +
170
+ "is needed to unblock customers." ,
176
171
},
177
172
{
178
- Name : "Insecure " ,
173
+ Flag : "insecure " ,
179
174
Env : "INSECURE" ,
180
175
Value : serpent .BoolOf (& c .Insecure ),
181
- Description : ` Insecure bypasses TLS verification when cloning
182
- and pulling from container registries.` ,
176
+ Description : " Insecure bypasses TLS verification when cloning and pulling from " +
177
+ " container registries." ,
183
178
},
184
179
{
185
- Name : "Ignore Paths" ,
186
- Env : "IGNORE_PATHS" ,
187
- Value : serpent .StringArrayOf (& c .IgnorePaths ),
188
- // Kubernetes frequently stores secrets in /var/run/secrets, and
189
- // other applications might as well. This seems to be a sensible
190
- // default, but if that changes, it's simple to adjust.
180
+ Flag : "ignore-paths" ,
181
+ Env : "IGNORE_PATHS" ,
182
+ Value : serpent .StringArrayOf (& c .IgnorePaths ),
191
183
Default : "/var/run" ,
192
- Description : ` IgnorePaths is a comma separated list of paths
193
- to ignore when building the workspace.` ,
184
+ Description : " IgnorePaths is a comma separated list of paths to ignore when " +
185
+ " building the workspace." ,
194
186
},
195
187
{
196
- Name : "Skip Rebuild " ,
188
+ Flag : "skip-rebuild " ,
197
189
Env : "SKIP_REBUILD" ,
198
190
Value : serpent .BoolOf (& c .SkipRebuild ),
199
- Description : `SkipRebuild skips building if the MagicFile exists.
200
- This is used to skip building when a container is
201
- restarting. e.g. docker stop -> docker start
202
- This value can always be set to true - even if the
203
- container is being started for the first time.` ,
191
+ Description : "SkipRebuild skips building if the MagicFile exists. This is used " +
192
+ "to skip building when a container is restarting. e.g. docker stop -> " +
193
+ "docker start This value can always be set to true - even if the " +
194
+ "container is being started for the first time." ,
204
195
},
205
196
{
206
- Name : "Git URL" ,
207
- Env : "GIT_URL" ,
208
- Value : serpent .StringOf (& c .GitURL ),
209
- Description : `GitURL is the URL of the Git repository to clone.
210
- This is optional.` ,
197
+ Flag : "git-url" ,
198
+ Env : "GIT_URL" ,
199
+ Value : serpent .StringOf (& c .GitURL ),
200
+ Description : "GitURL is the URL of the Git repository to clone. This is optional." ,
211
201
},
212
202
{
213
- Name : "Git Clone Depth" ,
214
- Env : "GIT_CLONE_DEPTH" ,
215
- Value : serpent .Int64Of (& c .GitCloneDepth ),
216
- Description : `GitCloneDepth is the depth to use when cloning
217
- the Git repository.` ,
203
+ Flag : "git-clone-depth" ,
204
+ Env : "GIT_CLONE_DEPTH" ,
205
+ Value : serpent .Int64Of (& c .GitCloneDepth ),
206
+ Description : "GitCloneDepth is the depth to use when cloning the Git repository." ,
218
207
},
219
208
{
220
- Name : "Git Clone Single Branch" ,
221
- Env : "GIT_CLONE_SINGLE_BRANCH" ,
222
- Value : serpent .BoolOf (& c .GitCloneSingleBranch ),
223
- Description : `GitCloneSingleBranch clones only a single branch
224
- of the Git repository.` ,
209
+ Flag : "git-clone-single-branch" ,
210
+ Env : "GIT_CLONE_SINGLE_BRANCH" ,
211
+ Value : serpent .BoolOf (& c .GitCloneSingleBranch ),
212
+ Description : "GitCloneSingleBranch clones only a single branch of the Git repository." ,
225
213
},
226
214
{
227
- Name : "Git Username" ,
228
- Env : "GIT_USERNAME" ,
229
- Value : serpent .StringOf (& c .GitUsername ),
230
- Description : `GitUsername is the username to use for Git authentication.
231
- This is optional.` ,
215
+ Flag : "git-username" ,
216
+ Env : "GIT_USERNAME" ,
217
+ Value : serpent .StringOf (& c .GitUsername ),
218
+ Description : "GitUsername is the username to use for Git authentication. This is optional." ,
232
219
},
233
220
{
234
- Name : "Git Password" ,
235
- Env : "GIT_PASSWORD" ,
236
- Value : serpent .StringOf (& c .GitPassword ),
237
- Description : `GitPassword is the password to use for Git authentication.
238
- This is optional.` ,
221
+ Flag : "git-password" ,
222
+ Env : "GIT_PASSWORD" ,
223
+ Value : serpent .StringOf (& c .GitPassword ),
224
+ Description : "GitPassword is the password to use for Git authentication. This is optional." ,
239
225
},
240
226
{
241
- Name : "Git HTTP Proxy URL" ,
242
- Env : "GIT_HTTP_PROXY_URL" ,
243
- Value : serpent .StringOf (& c .GitHTTPProxyURL ),
244
- Description : `GitHTTPProxyURL is the url for the http proxy.
245
- This is optional.` ,
227
+ Flag : "git-http-proxy-url" ,
228
+ Env : "GIT_HTTP_PROXY_URL" ,
229
+ Value : serpent .StringOf (& c .GitHTTPProxyURL ),
230
+ Description : "GitHTTPProxyURL is the url for the http proxy. This is optional." ,
246
231
},
247
232
{
248
- Name : "Workspace Folder " ,
233
+ Flag : "workspace-folder " ,
249
234
Env : "WORKSPACE_FOLDER" ,
250
235
Value : serpent .StringOf (& c .WorkspaceFolder ),
251
- Description : ` WorkspaceFolder is the path to the workspace folder
252
- that will be built. This is optional.` ,
236
+ Description : " WorkspaceFolder is the path to the workspace folder that will " +
237
+ " be built. This is optional." ,
253
238
},
254
239
{
255
- Name : "SSL Cert Base64 " ,
240
+ Flag : "ssl-cert-base64 " ,
256
241
Env : "SSL_CERT_BASE64" ,
257
242
Value : serpent .StringOf (& c .SSLCertBase64 ),
258
- Description : ` SSLCertBase64 is the content of an SSL cert file.
259
- This is useful for self-signed certificates.` ,
243
+ Description : " SSLCertBase64 is the content of an SSL cert file. This is useful " +
244
+ " for self-signed certificates." ,
260
245
},
261
246
{
262
- Name : "Export Env File " ,
247
+ Flag : "export-env-file " ,
263
248
Env : "EXPORT_ENV_FILE" ,
264
249
Value : serpent .StringOf (& c .ExportEnvFile ),
265
- Description : ` ExportEnvFile is an optional file path to a .env file where
266
- envbuilder will dump environment variables from devcontainer.json and
267
- the built container image.` ,
250
+ Description : " ExportEnvFile is an optional file path to a .env file where " +
251
+ " envbuilder will dump environment variables from devcontainer.json " +
252
+ "and the built container image." ,
268
253
},
269
254
{
270
- Name : "Post Start Script Path " ,
255
+ Flag : "post-start-script-path " ,
271
256
Env : "POST_START_SCRIPT_PATH" ,
272
257
Value : serpent .StringOf (& c .PostStartScriptPath ),
273
- Description : ` PostStartScriptPath is the path to a script that will be created by
274
- envbuilder based on the ` + "` postStartCommand`" + ` in devcontainer.json, if any
275
- is specified (otherwise the script is not created). If this is set, the
276
- specified InitCommand should check for the presence of this script and
277
- execute it after successful startup.` ,
258
+ Description : " PostStartScriptPath is the path to a script that will be created " +
259
+ "by envbuilder based on the postStartCommand in devcontainer.json, " +
260
+ "if any is specified (otherwise the script is not created). If this " +
261
+ "is set, the specified InitCommand should check for the presence of " +
262
+ "this script and execute it after successful startup." ,
278
263
},
279
264
}
280
265
}
0 commit comments