feat(devcontainers-cli): support pinned and mirrored installs - #1047
feat(devcontainers-cli): support pinned and mirrored installs#1047Edd88-pixel wants to merge 3 commits into
Conversation
|
@matifali could you review this please ? |
|
@DevelopmentCats Can you retry ? |
| #!/usr/bin/env sh | ||
| # shellcheck shell=sh | ||
|
|
||
| # shellcheck disable=SC2016 # Terraform replaces this literal placeholder. |
There was a problem hiding this comment.
I wonder why we had to use this?
If you do not want terraform to replace a literal. use $${LITERAL} or $LITERAL
There was a problem hiding this comment.
These placeholders are intentionally replaced by templatefile; the base64 encoding keeps the rendered shell values safe. The SC2016 suppressions are only needed because I used single quotes.
We need Terraform’s templatefile to substitute the value while rendering the script, so using $${LITERAL} would leave the required value unset.
There was a problem hiding this comment.
I understand. If you use ${LITERAL} , Terraform's templatefile()will replace it but if you use $${LITERAL} or $LITERAL it wont.
| exit 1 | ||
| fi | ||
|
|
||
| INSTALL_PREFIX=$(dirname "$CODER_SCRIPT_BIN_DIR") |
There was a problem hiding this comment.
Should we allow provding an input to control this?
There was a problem hiding this comment.
Do you mean allowing callers to provide a custom install prefix? I currently derive it from CODER_SCRIPT_BIN_DIR so npm/Yarn install into the Coder-managed bin directory already on PATH, while pnpm uses it as PNPM_HOME. I’d prefer to keep that fixed unless there is a specific use case, but I’m happy to adjust if that’s what you meant.
There was a problem hiding this comment.
Yes. Sorry I forgot to complete what I was typing. Its not a blocker
Why
The module always installed the latest
@devcontainers/clirelease from the package manager's configured public source. That made reproducible installs and restricted-network workspaces difficult, while global installs could depend on elevated permissions.Changes
sudodevcontaineris already availablePATHType of Change
Module Information
Path:
registry/coder/modules/devcontainers-cliNew version:
v1.2.0Breaking change: [ ] Yes [x] No
Validation
terraform test— 4 passedbun test registry/coder/modules/devcontainers-cli/main.test.ts— 9 passed@devcontainers/cli@0.80.0innode:22-alpine, followed bydevcontainer --versionterraform validatetsc --noEmitRelated Issues
Related to #427 and #308.