-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·43 lines (35 loc) · 917 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·43 lines (35 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# set repo url
if [ -n "$1" ]; then
REPO_URL=$1
fi
if [ -n "$REPO_URL" ]; then
git clone $REPO_URL
fi
# set dotfiles
if [ -n "$DOTFILES_REPO_URL"]; then
cd ~
mkdir -p docker-vscode-dev-temporary-files && cd docker-vscode-dev-temporary-files
git clone $DOTFILES_REPO_URL
cp -p */* ..
cd .. && rm -rf docker-vscode-dev-temporary-files
. .bash_profile
cd /workspace
fi
# set git config
if [ -n "$GIT_USER_NAME"]; then
git config --global user.name "$GIT_USER_NAME"
fi
if [ -n "$GIT_USER_EMAIL"]; then
git config --global user.email "$GIT_USER_EMAIL"
fi
# set container id tunnel name
if [ -z "$TUNNEL_NAME" ]; then
TUNNEL_NAME="container-$(echo $HOSTNAME | cut -c 1-10)"
fi
# set tunnel name
if [ ! -e "/root/.vscode-cli/code_tunnel.json" ]; then
vscode-server rename --accept-server-license-terms --name $TUNNEL_NAME
fi
# launch
vscode-server --accept-server-license-terms