@@ -28,27 +28,51 @@ if [ ! "$(ls -A /app)" ]; then
28
28
# Generate root ssh key
29
29
ssh-keygen -A;
30
30
31
- progress " Pulling code" ;
32
-
33
- git init --initial-branch=main
34
- git config credential.helper ' !diploi-credential-helper' ;
35
- git remote add --fetch origin $REPOSITORY_URL ;
36
- if [ -z " $REPOSITORY_TAG " ]; then
37
- git checkout -f $REPOSITORY_BRANCH ;
31
+ if [ " $REPOSITORY_URL " = " https://github.com/diploi/astro-template-demo.git" ]; then
32
+ # Using quick launch cached initial files
33
+ progress " Using quick launch cache start" ;
34
+ find /app-quick-launch/ -mindepth 1 -maxdepth 1 -exec mv -t /app -- {} +
35
+ rmdir /app-quick-launch
36
+ progress " Using quick launch cache done" ;
38
37
else
39
- git checkout -f -q $REPOSITORY_TAG ;
40
- git checkout -b main
41
- git branch --set-upstream-to=origin/main main
38
+ progress " Pulling code" ;
39
+ git init --initial-branch=main
40
+ git config credential.helper ' !diploi-credential-helper' ;
41
+ git remote add --fetch origin $REPOSITORY_URL ;
42
+ if [ -z " $REPOSITORY_TAG " ]; then
43
+ git checkout -f $REPOSITORY_BRANCH ;
44
+ else
45
+ git checkout -f -q $REPOSITORY_TAG ;
46
+ git checkout -b main
47
+ git branch --set-upstream-to=origin/main main
48
+ fi
49
+ git remote set-url origin " $REPOSITORY_URL " ;
50
+ git config --unset credential.helper;
51
+
52
+ progress " Installing" ;
53
+ npm install;
42
54
fi
43
- git remote set-url origin " $REPOSITORY_URL " ;
44
- git config --unset credential.helper;
45
55
46
56
# Configure VSCode
47
57
mkdir -p /root/.local/share/code-server/User
48
58
cp /usr/local/etc/diploi-vscode-settings.json /root/.local/share/code-server/User/settings.json
49
-
50
- progress " Installing" ;
51
- npm install;
59
+ # TODO: How to update these if env changes?
60
+ cat > /app/.vscode/settings.json << EOL
61
+ {
62
+ "sqltools.connections": [
63
+ {
64
+ "previewLimit": 50,
65
+ "server": "$POSTGRES_HOST ",
66
+ "port": $POSTGRES_PORT ,
67
+ "driver": "PostgreSQL",
68
+ "name": "PostgreSQL",
69
+ "database": "$POSTGRES_DB ",
70
+ "username": "$POSTGRES_USER ",
71
+ "password": "$POSTGRES_PASSWORD ",
72
+ }
73
+ ]
74
+ }
75
+ EOL
52
76
53
77
fi
54
78
@@ -59,6 +83,7 @@ update-ca-certificates
59
83
env >> /etc/environment
60
84
61
85
# Now that everything is initialized, start all services
86
+ progress " Starting services" ;
62
87
supervisorctl start www
63
88
supervisorctl start code-server
64
89
0 commit comments