mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(cli): add --id parameter to templates init command (#7116)
This PR makes the following changes: - Adds an --id parameter to coder templates init so that you can non-interactively initialize a specific example template by ID (e.g. folder name) - Updates develop.sh and lima/coder.yaml to use this parameter to select the docker example template.
This commit is contained in:
+1
-2
@@ -151,7 +151,6 @@ fatal() {
|
||||
|
||||
# If we have docker available and the "docker" template doesn't already
|
||||
# exist, then let's try to create a template!
|
||||
example_template="code-server"
|
||||
template_name="docker"
|
||||
if docker info >/dev/null 2>&1 && ! "${CODER_DEV_SHIM}" templates versions list "${template_name}" >/dev/null 2>&1; then
|
||||
# sometimes terraform isn't installed yet when we go to create the
|
||||
@@ -159,7 +158,7 @@ fatal() {
|
||||
sleep 5
|
||||
|
||||
temp_template_dir="$(mktemp -d)"
|
||||
echo "${example_template}" | "${CODER_DEV_SHIM}" templates init "${temp_template_dir}"
|
||||
"${CODER_DEV_SHIM}" templates init --id "${template_name}" "${temp_template_dir}"
|
||||
|
||||
DOCKER_HOST="$(docker context inspect --format '{{ .Endpoints.docker.Host }}')"
|
||||
printf 'docker_arch: "%s"\ndocker_host: "%s"\n' "${GOARCH}" "${DOCKER_HOST}" >"${temp_template_dir}/params.yaml"
|
||||
|
||||
Reference in New Issue
Block a user