showpane 0.4.11 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -247,41 +247,85 @@ for item in json.load(sys.stdin).get(\"missing\", []):
|
|
|
247
247
|
fi
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
### Cloud Step 7:
|
|
250
|
+
### Cloud Step 7: Start the staged deployment
|
|
251
251
|
|
|
252
252
|
```bash
|
|
253
253
|
PORTAL_COUNT=$(cd "$APP_PATH" && NODE_PATH="$APP_PATH/node_modules" npx tsx --tsconfig "$APP_PATH/tsconfig.json" "$SKILL_DIR/bin/list-portals.ts" \
|
|
254
254
|
| python3 -c "import sys,json; print(len(json.load(sys.stdin).get('portals', [])))")
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
INIT_RESPONSE=$(curl -s -X POST "$CLOUD_API_BASE/api/deployments" \
|
|
257
257
|
-H "Authorization: Bearer $CLOUD_API_TOKEN" \
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
-F "app_path=$APP_PATH" \
|
|
261
|
-
-F "portalCount=$PORTAL_COUNT" \
|
|
262
|
-
-F "runtimeData=@$RUNTIME_DATA_PATH;type=application/json")
|
|
258
|
+
-H "Content-Type: application/json" \
|
|
259
|
+
--data-binary '{}')
|
|
263
260
|
|
|
264
|
-
echo "$
|
|
261
|
+
echo \"$INIT_RESPONSE\" | python3 -c "
|
|
265
262
|
import sys, json
|
|
266
263
|
d = json.load(sys.stdin)
|
|
267
264
|
if 'error' in d:
|
|
268
265
|
print('ERROR: ' + str(d['error']))
|
|
269
266
|
sys.exit(1)
|
|
270
|
-
print('Deployment
|
|
271
|
-
print('ID: ' + d.get('deploymentId',
|
|
267
|
+
print('Deployment initialized')
|
|
268
|
+
print('ID: ' + d.get('deploymentId', 'unknown'))
|
|
272
269
|
print('Status: ' + d.get('status', 'unknown'))
|
|
273
270
|
"
|
|
274
271
|
```
|
|
275
272
|
|
|
276
|
-
Extract the deployment ID from the response. If the API returns an error, show it and stop.
|
|
273
|
+
Extract the deployment ID and the presigned artifact upload URL from the response. If the API returns an error, show it and stop.
|
|
277
274
|
|
|
278
|
-
### Cloud Step 8:
|
|
275
|
+
### Cloud Step 8: Upload the artifact directly to storage
|
|
279
276
|
|
|
280
|
-
|
|
277
|
+
```bash
|
|
278
|
+
DEPLOY_ID=$(echo "$INIT_RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('deploymentId',''))")
|
|
279
|
+
ARTIFACT_UPLOAD_URL=$(echo "$INIT_RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('artifactUploadUrl',''))")
|
|
280
|
+
|
|
281
|
+
if [ -z "$DEPLOY_ID" ] || [ -z "$ARTIFACT_UPLOAD_URL" ]; then
|
|
282
|
+
echo "ERROR: Missing deploymentId or artifact upload URL"
|
|
283
|
+
exit 1
|
|
284
|
+
fi
|
|
285
|
+
|
|
286
|
+
curl -s -X PUT "$ARTIFACT_UPLOAD_URL" \
|
|
287
|
+
-H "Content-Type: application/zip" \
|
|
288
|
+
--data-binary @"$ARTIFACT_PATH" \
|
|
289
|
+
>/dev/null
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Cloud Step 9: Finalize the deployment
|
|
281
293
|
|
|
282
294
|
```bash
|
|
283
|
-
|
|
295
|
+
FINALIZE_PAYLOAD="/tmp/showpane-deploy-finalize-${DEPLOY_ID}.json"
|
|
296
|
+
python3 - <<'PY' "$RUNTIME_DATA_PATH" "$PORTAL_COUNT" > "$FINALIZE_PAYLOAD"
|
|
297
|
+
import json, sys
|
|
298
|
+
runtime_path = sys.argv[1]
|
|
299
|
+
portal_count = int(sys.argv[2])
|
|
300
|
+
payload = {
|
|
301
|
+
"portalCount": portal_count,
|
|
302
|
+
"runtimeData": json.load(open(runtime_path)),
|
|
303
|
+
}
|
|
304
|
+
print(json.dumps(payload))
|
|
305
|
+
PY
|
|
306
|
+
|
|
307
|
+
FINALIZE_RESPONSE=$(curl -s -X POST "$CLOUD_API_BASE/api/deployments/$DEPLOY_ID/finalize" \
|
|
308
|
+
-H "Authorization: Bearer $CLOUD_API_TOKEN" \
|
|
309
|
+
-H "Content-Type: application/json" \
|
|
310
|
+
--data-binary @"$FINALIZE_PAYLOAD")
|
|
284
311
|
|
|
312
|
+
echo "$FINALIZE_RESPONSE" | python3 -c "
|
|
313
|
+
import sys, json
|
|
314
|
+
d = json.load(sys.stdin)
|
|
315
|
+
if 'error' in d:
|
|
316
|
+
print('ERROR: ' + str(d['error']))
|
|
317
|
+
sys.exit(1)
|
|
318
|
+
print('Deployment accepted')
|
|
319
|
+
print('ID: ' + d.get('deploymentId', 'unknown'))
|
|
320
|
+
print('Status: ' + d.get('status', 'unknown'))
|
|
321
|
+
"
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Cloud Step 10: Wait for cloud publish to finish
|
|
325
|
+
|
|
326
|
+
Poll Showpane Cloud until the deployment reaches `live` or `failed`:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
285
329
|
echo "Waiting for deployment to go live..."
|
|
286
330
|
for i in $(seq 1 60); do
|
|
287
331
|
sleep 5
|
|
@@ -314,7 +358,7 @@ fi
|
|
|
314
358
|
|
|
315
359
|
The publish typically takes 15-60 seconds. Poll every 5 seconds for up to 5 minutes.
|
|
316
360
|
|
|
317
|
-
### Cloud Step
|
|
361
|
+
### Cloud Step 11: Post-deploy verification
|
|
318
362
|
|
|
319
363
|
Once the deployment is live, verify the portal is accessible:
|
|
320
364
|
|
|
@@ -333,7 +377,7 @@ Also check the API health endpoint:
|
|
|
333
377
|
curl -s -o /dev/null -w "%{http_code}" "$PORTAL_URL/api/health"
|
|
334
378
|
```
|
|
335
379
|
|
|
336
|
-
### Cloud Step
|
|
380
|
+
### Cloud Step 12: Deployment summary
|
|
337
381
|
|
|
338
382
|
Print a clear summary:
|
|
339
383
|
|
|
@@ -351,7 +395,7 @@ Cloud deploy complete!
|
|
|
351
395
|
Deploy ID: dep_xxxxxxxxxxxx
|
|
352
396
|
```
|
|
353
397
|
|
|
354
|
-
### Cloud Step
|
|
398
|
+
### Cloud Step 13: Record deployment
|
|
355
399
|
|
|
356
400
|
Log the cloud deployment for operational memory:
|
|
357
401
|
|
|
@@ -359,7 +403,7 @@ Log the cloud deployment for operational memory:
|
|
|
359
403
|
echo '{"skill":"portal-deploy","key":"deploy","insight":"Cloud deploy to '$CLOUD_ORG_SLUG'.showpane.com. Migrations: <count>. Portals: <count> active. Deploy ID: '$DEPLOY_ID'.","confidence":10,"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' >> "$HOME/.showpane/learnings.jsonl"
|
|
360
404
|
```
|
|
361
405
|
|
|
362
|
-
### Cloud Step
|
|
406
|
+
### Cloud Step 14: Clean up
|
|
363
407
|
|
|
364
408
|
Remove the temporary artifact:
|
|
365
409
|
|
|
@@ -367,6 +411,7 @@ Remove the temporary artifact:
|
|
|
367
411
|
rm -f "$ARTIFACT_PATH"
|
|
368
412
|
rm -f "$RUNTIME_DATA_PATH"
|
|
369
413
|
rm -f "$FILE_MANIFEST_PATH"
|
|
414
|
+
rm -f "$FINALIZE_PAYLOAD"
|
|
370
415
|
[ -n "${TMP_SYNC_DIR:-}" ] && rm -rf "$TMP_SYNC_DIR"
|
|
371
416
|
```
|
|
372
417
|
|
|
@@ -448,9 +493,9 @@ If the Showpane Cloud API returns 401/403 during pre-flight or publish:
|
|
|
448
493
|
- **409 organization_required**: The user authenticated but has no org yet. Send them to Showpane Cloud checkout to start the trial, then re-run `showpane login`.
|
|
449
494
|
|
|
450
495
|
### Cloud: Artifact upload failure
|
|
451
|
-
If the
|
|
452
|
-
- **400 Bad Request**: The
|
|
453
|
-
- **
|
|
496
|
+
If the deployment init or finalize call fails:
|
|
497
|
+
- **400 Bad Request**: The runtime payload is missing or malformed. Rebuild locally and retry.
|
|
498
|
+
- **409 Conflict**: The deployment was not initialized, the artifact was not uploaded yet, or the org has no hosted project provisioned.
|
|
454
499
|
- **422 Validation Error**: The cloud control plane rejected the deploy metadata. Show the response body directly.
|
|
455
500
|
|
|
456
501
|
### Cloud: File sync failure
|
|
@@ -482,6 +527,7 @@ echo '{"skill":"portal-deploy","event":"completed","ts":"'$(date -u +%Y-%m-%dT%H
|
|
|
482
527
|
- Show the full deployment summary with portal count, migration status, and health
|
|
483
528
|
- If this is the first deploy, suggest running `/portal credentials` for all portals before deploying so clients can actually log in
|
|
484
529
|
- For Cloud deploys: build locally, upload the artifact to Showpane Cloud, and let the control plane publish it
|
|
530
|
+
- For Cloud deploys: upload the artifact directly to storage using the presigned URL, not through the deployment function body
|
|
485
531
|
- For Cloud deploys: always wait for the deployment to reach `live` before declaring success
|
|
486
532
|
- For Cloud deploys: the portal URL is `https://{org}.showpane.com` — verify it returns 200 after deploy
|
|
487
533
|
- For Cloud deploys: clean up the temporary artifact after deploy completes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "showpane",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "CLI for Showpane
|
|
3
|
+
"version": "0.4.12",
|
|
4
|
+
"description": "CLI for Showpane — AI-generated client portals",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"showpane": "./dist/index.js"
|