-
Notifications
You must be signed in to change notification settings - Fork 1
feat: allow customizing workspace directory #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
1b861c5
fac790d
dbd1b6f
4c45deb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .PHONY: test | ||
| test: | ||
| devcontainer features test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,12 +17,18 @@ do | |
| code-server --install-extension "$extension" | ||
| done | ||
|
|
||
| CODE_SERVER_WORKSPACE="$_REMOTE_USER_HOME" | ||
|
|
||
| if [ -n "$WORKSPACE" ]; then | ||
DanielleMaywood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| CODE_SERVER_WORKSPACE="$WORKSPACE" | ||
| fi | ||
|
|
||
| cat > /usr/local/bin/code-server-entrypoint \ | ||
| << EOF | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| su $_REMOTE_USER -c 'code-server --bind-addr "$HOST:$PORT" \$ARGS' | ||
| su $_REMOTE_USER -c 'code-server --bind-addr "$HOST:$PORT" $ARGS "$CODE_SERVER_WORKSPACE"' | ||
|
||
| EOF | ||
|
|
||
| chmod +x /usr/local/bin/code-server-entrypoint | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||
| #!/bin/bash | ||||||||
| set -e | ||||||||
|
|
||||||||
| # Optional: Import test library bundled with the devcontainer CLI | ||||||||
| source dev-container-features-test-lib | ||||||||
|
|
||||||||
| # Feature-specific tests | ||||||||
| check "code-server version" code-server --version | ||||||||
| check "code-server running" pgrep -f 'code-server/lib/node.*/code-server' | ||||||||
| check "code-server listening" lsof -i "@127.0.0.1:8080" | ||||||||
|
|
||||||||
| entrypoint=$(cat /usr/local/bin/code-server-entrypoint) | ||||||||
DanielleMaywood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
| check "code-server workspace" grep $'\'code-server.*"/home"\'' <<<"$entrypoint" | ||||||||
|
||||||||
| entrypoint=$(cat /usr/local/bin/code-server-entrypoint) | |
| check "code-server workspace" grep $'\'code-server.*"/home"\'' <<<"$entrypoint" | |
| check "code-server workspace" grep $'\'code-server.*"/home"\'' < /usr/local/bin/code-server-entrypoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each separate feature test could do their own verifications of this yeah (my next PR is using this approach).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$_REMOTE_USER_HOMEshould always be set