Skip to content

Commit 3028896

Browse files
Update server
1 parent 994914a commit 3028896

4 files changed

Lines changed: 44 additions & 32 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
"postStartCommand": {
1313
"app": "USE_DESIGNER=true USE_SPARK_AGENT=true npm run dev",
1414
"ports": "gh cs ports visibility 5000:public -c $CODESPACE_NAME",
15+
"spark-proxy": "proxy.js",
1516
"server": "spark-server",
1617
"spark-agent": "spark-agent",
17-
// "spark-designer": "spark-designer",
18-
"spark-file-syncer": "file-syncer.js 13000 >> /tmp/.spark-file-syncer.log 2>&1"
18+
"spark-designer": "spark-designer",
19+
"spark-file-syncer": "spark-file-syncer 13000 >> /tmp/.spark-file-syncer.log 2>&1"
1920
},
2021
"forwardPorts": [4000, 5000, 9000, 13000],
2122
"features": {

.devcontainer/onCreate.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ sudo mv ./spark-sdk-dist/server.js /usr/local/bin/spark-server
2828
sudo mv ./spark-sdk-dist/designer.js /usr/local/bin/spark-designer
2929
sudo mv ./spark-sdk-dist/file-syncer.js /usr/local/bin/spark-file-syncer
3030
sudo mv ./spark-sdk-dist/spark-agent.js /usr/local/bin/spark-agent
31+
sudo cp ./spark-sdk-dist/proxy.js /workspaces/proxy.js
32+
sudo mv ./spark-sdk-dist/proxy.js /usr/local/bin/proxy.js
33+
3134

3235
tar -xzf ./spark-sdk-dist/spark-tools.tgz
3336

app.package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "app",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"type": "module",
6+
"scripts": {
7+
"start": "node proxy.js"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"description": ""
12+
}

deploy.sh

100644100755
Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,41 @@ echo "Compiling frontend..."
1313
npm install -f # force because there is a known mismatch of shadcn and react 19 - https://ui.shadcn.com/docs/react-19
1414
npm run build
1515

16-
# Build the backend
17-
echo "Compiling backend..."
18-
npm --prefix server install
19-
npm --prefix server run build
20-
2116
echo "Copying extra files..."
22-
cp ./server/package.json ./dist/package.json
17+
cp /workspaces/proxy.js ./dist/proxy.js
18+
cp ./app.package.json ./dist/package.json
2319

2420
echo "[--Build: Complete--]"
2521
echo "Executing the deployment upload script"
2622
echo "[--Deployment: Started--]"
2723

28-
# Check if GITHUB_RUNTIME_PERMANENT_NAME is empty.
29-
# This will be set when you run with the `copilot_workbench_kv_aca` flag.
30-
if [ -z "$GITHUB_RUNTIME_PERMANENT_NAME" ]; then
31-
echo "GITHUB_RUNTIME_PERMANENT_NAME is empty. Falling back to CODESPACE_NAME."
24+
# # Check if GITHUB_RUNTIME_PERMANENT_NAME is empty.
25+
# # This will be set when you run with the `copilot_workbench_kv_aca` flag.
26+
# if [ -z "$GITHUB_RUNTIME_PERMANENT_NAME" ]; then
27+
# echo "GITHUB_RUNTIME_PERMANENT_NAME is empty. Falling back to CODESPACE_NAME."
3228

33-
GITHUB_RUNTIME_PERMANENT_NAME=${CODESPACE_NAME}
34-
size=${#GITHUB_RUNTIME_PERMANENT_NAME}
35-
# if size is > 20, then truncate the name.
36-
# this is a limitation that's also enforced by the dotcom API
37-
# but I'd rather ensure that the command succeeds.
38-
if [ $size -gt 20 ]; then
39-
GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME:0:20}
40-
fi
41-
fi
29+
# GITHUB_RUNTIME_PERMANENT_NAME=${CODESPACE_NAME}
30+
# size=${#GITHUB_RUNTIME_PERMANENT_NAME}
31+
# # if size is > 20, then truncate the name.
32+
# # this is a limitation that's also enforced by the dotcom API
33+
# # but I'd rather ensure that the command succeeds.
34+
# if [ $size -gt 20 ]; then
35+
# GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME:0:20}
36+
# fi
37+
# fi
4238

43-
echo "Deploying as ${GITHUB_USER} to ${GITHUB_RUNTIME_PERMANENT_NAME}"
39+
# echo "Deploying as ${GITHUB_USER} to ${GITHUB_RUNTIME_PERMANENT_NAME}"
4440

45-
gh runtime create \
46-
--app ${GITHUB_RUNTIME_PERMANENT_NAME} \
47-
--env "GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME}" \
48-
--secret "GITHUB_TOKEN=${GITHUB_TOKEN}" \
41+
# gh runtime create \
42+
# --app ${GITHUB_RUNTIME_PERMANENT_NAME} \
43+
# --env "GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME}" \
44+
# --secret "GITHUB_TOKEN=${GITHUB_TOKEN}" \
4945

50-
gh runtime deploy \
51-
--app ${GITHUB_RUNTIME_PERMANENT_NAME} \
52-
--dir dist
46+
# gh runtime deploy \
47+
# --app ${GITHUB_RUNTIME_PERMANENT_NAME} \
48+
# --dir dist
5349

54-
DEPLOYED_URL="$(gh runtime get --app ${GITHUB_RUNTIME_PERMANENT_NAME})"
50+
# DEPLOYED_URL="$(gh runtime get --app ${GITHUB_RUNTIME_PERMANENT_NAME})"
5551

56-
echo "[--URL-App=[https://${DEPLOYED_URL}]--]"
57-
echo "[--Deployment: Complete--]"
52+
# echo "[--URL-App=[https://${DEPLOYED_URL}]--]"
53+
# echo "[--Deployment: Complete--]"

0 commit comments

Comments
 (0)