File tree Expand file tree Collapse file tree 4 files changed +45
-28
lines changed Expand file tree Collapse file tree 4 files changed +45
-28
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ RUN npm run install:debugger
22
22
23
23
WORKDIR /app
24
24
USER root
25
- RUN npm install -g nodemon
25
+ RUN npm install -g nodemon vercel
26
26
RUN mkdir -p /app
27
27
28
28
COPY out/ /app/extension
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Check if VERCEL_TOKEN is set
4
+ if [ -z " $VERCEL_TOKEN " ]; then
5
+ echo " Error: VERCEL_TOKEN is not set"
6
+ exit 1
7
+ fi
8
+ if [ -z " $VERCEL_ORG_ID " ]; then
9
+ echo " Error: VERCEL_ORG_ID is not set"
10
+ exit 1
11
+ fi
12
+ if [ -z " $VERCEL_PROJECT_ID " ]; then
13
+ echo " Error: VERCEL_PROJECT_ID is not set"
14
+ exit 1
15
+ fi
16
+
17
+ # Create .vercel directory if it doesn't exist
18
+ cd /app
19
+ mkdir -p .vercel
20
+ echo " {
21
+ \" orgId\" : \" $VERCEL_ORG_ID \" ,
22
+ \" projectId\" : \" $VERCEL_PROJECT_ID \"
23
+ }" > .vercel/project.json
24
+
25
+ # Fetch Vercel environment variables
26
+ vercel env pull --environment=production --token=$VERCEL_TOKEN .env.cloud
27
+ echo " Vercel environment variables fetched successfully"
28
+
29
+ # Merge .env.cloud into .env.production
30
+ touch .env.production # Create if it doesn't exist
31
+ while IFS= read -r line || [[ -n " $line " ]]; do
32
+ if [[ ! " $line " =~ ^# && -n "$line" ]]; then
33
+ # Extract key (everything before the first =)
34
+ key= " ${line%% =* } "
35
+ if [ -n " $key " ]; then
36
+ # Remove the key and its value from .env.production if it exists
37
+ sed -i " /^$key =/d" .env.production
38
+ # Append the line from .env.cloud to .env.production
39
+ echo " $line " >> .env.production
40
+ fi
41
+ fi
42
+ done < .env.cloud
43
+ echo " Environment variables merged into .env.production successfully"
Original file line number Diff line number Diff line change 2
2
3
3
if [[ " $@ " == * --cloud* ]]; then
4
4
echo " Starting in cloud environment"
5
- bash /app/scripts/fetch-vercel-envs.sh
6
- bash /app/scripts/pull-envs-for-all-packages.sh
5
+ bash /app/server/scripts/fetch-vercel-envs.sh
7
6
fi
8
7
9
8
dumb-init -- node /app/server/kill-server.js $@ &
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments