@synteq/cli 0.2.0 → 1.1.2
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.
- package/dist/api/client.d.ts +362 -5
- package/dist/api/client.js +559 -44
- package/dist/api/client.js.map +1 -1
- package/dist/api/factory.js +5 -2
- package/dist/api/factory.js.map +1 -1
- package/dist/api/types.d.ts +892 -3
- package/dist/apps-support/deploy.d.ts +197 -0
- package/dist/apps-support/deploy.js +639 -0
- package/dist/apps-support/deploy.js.map +1 -0
- package/dist/apps-support/dotenv.d.ts +67 -0
- package/dist/apps-support/dotenv.js +136 -0
- package/dist/apps-support/dotenv.js.map +1 -0
- package/dist/apps-support/env-rollout.d.ts +18 -0
- package/dist/apps-support/env-rollout.js +52 -0
- package/dist/apps-support/env-rollout.js.map +1 -0
- package/dist/apps-support/git.d.ts +14 -0
- package/dist/apps-support/git.js +25 -0
- package/dist/apps-support/git.js.map +1 -0
- package/dist/apps-support/link.d.ts +25 -0
- package/dist/apps-support/link.js +39 -0
- package/dist/apps-support/link.js.map +1 -0
- package/dist/apps-support/log-stream.d.ts +25 -0
- package/dist/apps-support/log-stream.js +85 -0
- package/dist/apps-support/log-stream.js.map +1 -0
- package/dist/apps-support/paid-app.d.ts +64 -0
- package/dist/apps-support/paid-app.js +195 -0
- package/dist/apps-support/paid-app.js.map +1 -0
- package/dist/apps-support/plans.d.ts +44 -0
- package/dist/apps-support/plans.js +43 -0
- package/dist/apps-support/plans.js.map +1 -0
- package/dist/apps-support/resolve.d.ts +10 -0
- package/dist/apps-support/resolve.js +53 -0
- package/dist/apps-support/resolve.js.map +1 -0
- package/dist/apps-support/time.d.ts +20 -0
- package/dist/apps-support/time.js +82 -0
- package/dist/apps-support/time.js.map +1 -0
- package/dist/auth/scope.js +4 -0
- package/dist/auth/scope.js.map +1 -1
- package/dist/auth/tokens.d.ts +3 -0
- package/dist/auth/tokens.js +6 -4
- package/dist/auth/tokens.js.map +1 -1
- package/dist/base/command.d.ts +35 -0
- package/dist/base/command.js +87 -4
- package/dist/base/command.js.map +1 -1
- package/dist/commands/agents.d.ts +10 -0
- package/dist/commands/agents.js +53 -0
- package/dist/commands/agents.js.map +1 -0
- package/dist/commands/api.d.ts +0 -1
- package/dist/commands/api.js +6 -5
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/app/deployment/list.d.ts +14 -0
- package/dist/commands/app/deployment/list.js +45 -0
- package/dist/commands/app/deployment/list.js.map +1 -0
- package/dist/commands/app/deployment/rollback.d.ts +18 -0
- package/dist/commands/app/deployment/rollback.js +57 -0
- package/dist/commands/app/deployment/rollback.js.map +1 -0
- package/dist/commands/app/deployment/show.d.ts +26 -0
- package/dist/commands/app/deployment/show.js +98 -0
- package/dist/commands/app/deployment/show.js.map +1 -0
- package/dist/commands/app/domain/add.d.ts +17 -0
- package/dist/commands/app/domain/add.js +59 -0
- package/dist/commands/app/domain/add.js.map +1 -0
- package/dist/commands/app/domain/list.d.ts +14 -0
- package/dist/commands/app/domain/list.js +42 -0
- package/dist/commands/app/domain/list.js.map +1 -0
- package/dist/commands/app/domain/remove.d.ts +16 -0
- package/dist/commands/app/domain/remove.js +51 -0
- package/dist/commands/app/domain/remove.js.map +1 -0
- package/dist/commands/app/domain/verify.d.ts +15 -0
- package/dist/commands/app/domain/verify.js +39 -0
- package/dist/commands/app/domain/verify.js.map +1 -0
- package/dist/commands/app/env/add.d.ts +22 -0
- package/dist/commands/app/env/add.js +103 -0
- package/dist/commands/app/env/add.js.map +1 -0
- package/dist/commands/app/env/list.d.ts +17 -0
- package/dist/commands/app/env/list.js +40 -0
- package/dist/commands/app/env/list.js.map +1 -0
- package/dist/commands/app/env/reveal.d.ts +17 -0
- package/dist/commands/app/env/reveal.js +40 -0
- package/dist/commands/app/env/reveal.js.map +1 -0
- package/dist/commands/app/env/rm.d.ts +16 -0
- package/dist/commands/app/env/rm.js +48 -0
- package/dist/commands/app/env/rm.js.map +1 -0
- package/dist/commands/app/health.d.ts +14 -0
- package/dist/commands/app/health.js +40 -0
- package/dist/commands/app/health.js.map +1 -0
- package/dist/commands/app/index.d.ts +6 -0
- package/dist/commands/app/index.js +7 -0
- package/dist/commands/app/index.js.map +1 -0
- package/dist/commands/app/link.d.ts +22 -0
- package/dist/commands/app/link.js +31 -0
- package/dist/commands/app/link.js.map +1 -0
- package/dist/commands/app/logs.d.ts +25 -0
- package/dist/commands/app/logs.js +121 -0
- package/dist/commands/app/logs.js.map +1 -0
- package/dist/commands/app/metrics.d.ts +21 -0
- package/dist/commands/app/metrics.js +123 -0
- package/dist/commands/app/metrics.js.map +1 -0
- package/dist/commands/app/plan/change.d.ts +18 -0
- package/dist/commands/app/plan/change.js +79 -0
- package/dist/commands/app/plan/change.js.map +1 -0
- package/dist/commands/app/plan/show.d.ts +14 -0
- package/dist/commands/app/plan/show.js +40 -0
- package/dist/commands/app/plan/show.js.map +1 -0
- package/dist/commands/app/settings/set.d.ts +25 -0
- package/dist/commands/app/settings/set.js +96 -0
- package/dist/commands/app/settings/set.js.map +1 -0
- package/dist/commands/app/settings/show.d.ts +14 -0
- package/dist/commands/app/settings/show.js +48 -0
- package/dist/commands/app/settings/show.js.map +1 -0
- package/dist/commands/app/unlink.d.ts +8 -0
- package/dist/commands/app/unlink.js +25 -0
- package/dist/commands/app/unlink.js.map +1 -0
- package/dist/commands/apps/create.d.ts +26 -0
- package/dist/commands/apps/create.js +91 -0
- package/dist/commands/apps/create.js.map +1 -0
- package/dist/commands/apps/list.d.ts +17 -0
- package/dist/commands/apps/list.js +56 -0
- package/dist/commands/apps/list.js.map +1 -0
- package/dist/commands/baremetal/activity.d.ts +14 -0
- package/dist/commands/baremetal/activity.js +53 -0
- package/dist/commands/baremetal/activity.js.map +1 -0
- package/dist/commands/baremetal/bandwidth.d.ts +10 -0
- package/dist/commands/baremetal/bandwidth.js +86 -0
- package/dist/commands/baremetal/bandwidth.js.map +1 -0
- package/dist/commands/baremetal/console.d.ts +20 -0
- package/dist/commands/baremetal/console.js +72 -0
- package/dist/commands/baremetal/console.js.map +1 -0
- package/dist/commands/baremetal/details.d.ts +11 -0
- package/dist/commands/baremetal/details.js +116 -0
- package/dist/commands/baremetal/details.js.map +1 -0
- package/dist/commands/baremetal/index.d.ts +5 -0
- package/dist/commands/baremetal/index.js +6 -0
- package/dist/commands/baremetal/index.js.map +1 -0
- package/dist/commands/baremetal/install-password.d.ts +14 -0
- package/dist/commands/baremetal/install-password.js +80 -0
- package/dist/commands/baremetal/install-password.js.map +1 -0
- package/dist/commands/baremetal/list.d.ts +11 -0
- package/dist/commands/baremetal/list.js +59 -0
- package/dist/commands/baremetal/list.js.map +1 -0
- package/dist/commands/baremetal/order.d.ts +34 -0
- package/dist/commands/baremetal/order.js +394 -0
- package/dist/commands/baremetal/order.js.map +1 -0
- package/dist/commands/baremetal/power.d.ts +18 -0
- package/dist/commands/baremetal/power.js +168 -0
- package/dist/commands/baremetal/power.js.map +1 -0
- package/dist/commands/baremetal/reinstall.d.ts +21 -0
- package/dist/commands/baremetal/reinstall.js +168 -0
- package/dist/commands/baremetal/reinstall.js.map +1 -0
- package/dist/commands/config/profile/add.d.ts +11 -0
- package/dist/commands/config/profile/add.js +51 -0
- package/dist/commands/config/profile/add.js.map +1 -0
- package/dist/commands/config/profile/list.d.ts +7 -0
- package/dist/commands/config/profile/list.js +29 -0
- package/dist/commands/config/profile/list.js.map +1 -0
- package/dist/commands/config/profile/remove.d.ts +11 -0
- package/dist/commands/config/profile/remove.js +35 -0
- package/dist/commands/config/profile/remove.js.map +1 -0
- package/dist/commands/config/profile/use.d.ts +10 -0
- package/dist/commands/config/profile/use.js +44 -0
- package/dist/commands/config/profile/use.js.map +1 -0
- package/dist/commands/config/show.js +4 -1
- package/dist/commands/config/show.js.map +1 -1
- package/dist/commands/credits/add.js +2 -2
- package/dist/commands/credits/add.js.map +1 -1
- package/dist/commands/credits/index.js +5 -1
- package/dist/commands/credits/index.js.map +1 -1
- package/dist/commands/deploy.d.ts +51 -0
- package/dist/commands/deploy.js +515 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/function/create.d.ts +29 -0
- package/dist/commands/function/create.js +113 -0
- package/dist/commands/function/create.js.map +1 -0
- package/dist/commands/function/credits/add.d.ts +29 -0
- package/dist/commands/function/credits/add.js +209 -0
- package/dist/commands/function/credits/add.js.map +1 -0
- package/dist/commands/function/credits/auto-reload.d.ts +27 -0
- package/dist/commands/function/credits/auto-reload.js +107 -0
- package/dist/commands/function/credits/auto-reload.js.map +1 -0
- package/dist/commands/function/credits/index.d.ts +22 -0
- package/dist/commands/function/credits/index.js +80 -0
- package/dist/commands/function/credits/index.js.map +1 -0
- package/dist/commands/function/cron/add.d.ts +19 -0
- package/dist/commands/function/cron/add.js +74 -0
- package/dist/commands/function/cron/add.js.map +1 -0
- package/dist/commands/function/cron/list.d.ts +12 -0
- package/dist/commands/function/cron/list.js +55 -0
- package/dist/commands/function/cron/list.js.map +1 -0
- package/dist/commands/function/cron/rm.d.ts +17 -0
- package/dist/commands/function/cron/rm.js +73 -0
- package/dist/commands/function/cron/rm.js.map +1 -0
- package/dist/commands/function/cron/run.d.ts +16 -0
- package/dist/commands/function/cron/run.js +59 -0
- package/dist/commands/function/cron/run.js.map +1 -0
- package/dist/commands/function/cron/update.d.ts +21 -0
- package/dist/commands/function/cron/update.js +87 -0
- package/dist/commands/function/cron/update.js.map +1 -0
- package/dist/commands/function/delete.d.ts +23 -0
- package/dist/commands/function/delete.js +90 -0
- package/dist/commands/function/delete.js.map +1 -0
- package/dist/commands/function/deploy.d.ts +64 -0
- package/dist/commands/function/deploy.js +616 -0
- package/dist/commands/function/deploy.js.map +1 -0
- package/dist/commands/function/env/list.d.ts +12 -0
- package/dist/commands/function/env/list.js +46 -0
- package/dist/commands/function/env/list.js.map +1 -0
- package/dist/commands/function/env/reveal.d.ts +21 -0
- package/dist/commands/function/env/reveal.js +54 -0
- package/dist/commands/function/env/reveal.js.map +1 -0
- package/dist/commands/function/env/rm.d.ts +17 -0
- package/dist/commands/function/env/rm.js +62 -0
- package/dist/commands/function/env/rm.js.map +1 -0
- package/dist/commands/function/env/set.d.ts +28 -0
- package/dist/commands/function/env/set.js +124 -0
- package/dist/commands/function/env/set.js.map +1 -0
- package/dist/commands/function/index.d.ts +14 -0
- package/dist/commands/function/index.js +11 -0
- package/dist/commands/function/index.js.map +1 -0
- package/dist/commands/function/init.d.ts +48 -0
- package/dist/commands/function/init.js +277 -0
- package/dist/commands/function/init.js.map +1 -0
- package/dist/commands/function/invoke.d.ts +29 -0
- package/dist/commands/function/invoke.js +138 -0
- package/dist/commands/function/invoke.js.map +1 -0
- package/dist/commands/function/link.d.ts +23 -0
- package/dist/commands/function/link.js +80 -0
- package/dist/commands/function/link.js.map +1 -0
- package/dist/commands/function/list.d.ts +16 -0
- package/dist/commands/function/list.js +55 -0
- package/dist/commands/function/list.js.map +1 -0
- package/dist/commands/function/logs.d.ts +29 -0
- package/dist/commands/function/logs.js +171 -0
- package/dist/commands/function/logs.js.map +1 -0
- package/dist/commands/function/pause.d.ts +19 -0
- package/dist/commands/function/pause.js +50 -0
- package/dist/commands/function/pause.js.map +1 -0
- package/dist/commands/function/releases.d.ts +15 -0
- package/dist/commands/function/releases.js +62 -0
- package/dist/commands/function/releases.js.map +1 -0
- package/dist/commands/function/resume.d.ts +16 -0
- package/dist/commands/function/resume.js +47 -0
- package/dist/commands/function/resume.js.map +1 -0
- package/dist/commands/function/rollback.d.ts +18 -0
- package/dist/commands/function/rollback.js +69 -0
- package/dist/commands/function/rollback.js.map +1 -0
- package/dist/commands/function/settings/set.d.ts +23 -0
- package/dist/commands/function/settings/set.js +119 -0
- package/dist/commands/function/settings/set.js.map +1 -0
- package/dist/commands/function/show.d.ts +15 -0
- package/dist/commands/function/show.js +80 -0
- package/dist/commands/function/show.js.map +1 -0
- package/dist/commands/function/unlink.d.ts +9 -0
- package/dist/commands/function/unlink.js +34 -0
- package/dist/commands/function/unlink.js.map +1 -0
- package/dist/commands/link.d.ts +82 -0
- package/dist/commands/link.js +532 -0
- package/dist/commands/link.js.map +1 -0
- package/dist/commands/login.js +9 -0
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/order.js +3 -1
- package/dist/commands/order.js.map +1 -1
- package/dist/commands/payments/methods/delete.js +2 -2
- package/dist/commands/payments/methods/delete.js.map +1 -1
- package/dist/commands/resources.js +50 -7
- package/dist/commands/resources.js.map +1 -1
- package/dist/commands/status.d.ts +12 -0
- package/dist/commands/status.js +71 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/storage/detach.js +1 -1
- package/dist/commands/storage/detach.js.map +1 -1
- package/dist/commands/storage/list.js +6 -2
- package/dist/commands/storage/list.js.map +1 -1
- package/dist/commands/storage/order.d.ts +2 -0
- package/dist/commands/storage/order.js +100 -18
- package/dist/commands/storage/order.js.map +1 -1
- package/dist/commands/storage/resize.js +19 -6
- package/dist/commands/storage/resize.js.map +1 -1
- package/dist/commands/tickets/create.d.ts +2 -0
- package/dist/commands/tickets/create.js +40 -1
- package/dist/commands/tickets/create.js.map +1 -1
- package/dist/commands/tickets/download.d.ts +18 -0
- package/dist/commands/tickets/download.js +138 -0
- package/dist/commands/tickets/download.js.map +1 -0
- package/dist/commands/tickets/list.js +13 -7
- package/dist/commands/tickets/list.js.map +1 -1
- package/dist/commands/tickets/reply.d.ts +2 -0
- package/dist/commands/tickets/reply.js +33 -4
- package/dist/commands/tickets/reply.js.map +1 -1
- package/dist/commands/vds/order.js +72 -7
- package/dist/commands/vds/order.js.map +1 -1
- package/dist/commands/vps/console.js +14 -6
- package/dist/commands/vps/console.js.map +1 -1
- package/dist/commands/vps/details.js +7 -1
- package/dist/commands/vps/details.js.map +1 -1
- package/dist/commands/vps/ip/add.js +76 -9
- package/dist/commands/vps/ip/add.js.map +1 -1
- package/dist/commands/vps/list.js +13 -4
- package/dist/commands/vps/list.js.map +1 -1
- package/dist/commands/vps/order.d.ts +19 -0
- package/dist/commands/vps/order.js +179 -23
- package/dist/commands/vps/order.js.map +1 -1
- package/dist/commands/vps/power.js +2 -2
- package/dist/commands/vps/power.js.map +1 -1
- package/dist/commands/vps/reinstall.js +2 -2
- package/dist/commands/vps/reinstall.js.map +1 -1
- package/dist/commands/vps/resize.js +36 -13
- package/dist/commands/vps/resize.js.map +1 -1
- package/dist/commands/whoami.d.ts +5 -0
- package/dist/commands/whoami.js +8 -3
- package/dist/commands/whoami.js.map +1 -1
- package/dist/config/paths.d.ts +1 -1
- package/dist/config/paths.js +6 -1
- package/dist/config/paths.js.map +1 -1
- package/dist/config/store.d.ts +58 -0
- package/dist/config/store.js +84 -2
- package/dist/config/store.js.map +1 -1
- package/dist/functions-support/credits.d.ts +64 -0
- package/dist/functions-support/credits.js +181 -0
- package/dist/functions-support/credits.js.map +1 -0
- package/dist/functions-support/cron.d.ts +17 -0
- package/dist/functions-support/cron.js +99 -0
- package/dist/functions-support/cron.js.map +1 -0
- package/dist/functions-support/env.d.ts +23 -0
- package/dist/functions-support/env.js +44 -0
- package/dist/functions-support/env.js.map +1 -0
- package/dist/functions-support/link.d.ts +25 -0
- package/dist/functions-support/link.js +51 -0
- package/dist/functions-support/link.js.map +1 -0
- package/dist/functions-support/poll.d.ts +40 -0
- package/dist/functions-support/poll.js +109 -0
- package/dist/functions-support/poll.js.map +1 -0
- package/dist/functions-support/resolve.d.ts +3 -0
- package/dist/functions-support/resolve.js +31 -0
- package/dist/functions-support/resolve.js.map +1 -0
- package/dist/functions-support/runtime.d.ts +30 -0
- package/dist/functions-support/runtime.js +52 -0
- package/dist/functions-support/runtime.js.map +1 -0
- package/dist/functions-support/source.d.ts +92 -0
- package/dist/functions-support/source.js +343 -0
- package/dist/functions-support/source.js.map +1 -0
- package/dist/help/scope-aware-help.js +10 -1
- package/dist/help/scope-aware-help.js.map +1 -1
- package/dist/tui/App.js +10 -25
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/components/Menu.d.ts +3 -1
- package/dist/tui/components/Menu.js +7 -3
- package/dist/tui/components/Menu.js.map +1 -1
- package/dist/tui/router.d.ts +1 -1
- package/dist/tui/router.js.map +1 -1
- package/dist/tui/screens/Billing.js +56 -4
- package/dist/tui/screens/Billing.js.map +1 -1
- package/dist/tui/screens/Dashboard.js +8 -7
- package/dist/tui/screens/Dashboard.js.map +1 -1
- package/dist/tui/screens/Deploy.d.ts +2 -0
- package/dist/tui/screens/Deploy.js +912 -0
- package/dist/tui/screens/Deploy.js.map +1 -0
- package/dist/tui/screens/Order.js +359 -26
- package/dist/tui/screens/Order.js.map +1 -1
- package/dist/tui/screens/Resources.js +273 -31
- package/dist/tui/screens/Resources.js.map +1 -1
- package/dist/tui/screens/Tickets.js +18 -6
- package/dist/tui/screens/Tickets.js.map +1 -1
- package/dist/tui/screens/deployPreset.d.ts +20 -0
- package/dist/tui/screens/deployPreset.js +11 -0
- package/dist/tui/screens/deployPreset.js.map +1 -0
- package/dist/tui/screens/resources/AppDetail.d.ts +7 -0
- package/dist/tui/screens/resources/AppDetail.js +810 -0
- package/dist/tui/screens/resources/AppDetail.js.map +1 -0
- package/dist/tui/screens/resources/FunctionDetail.d.ts +7 -0
- package/dist/tui/screens/resources/FunctionDetail.js +751 -0
- package/dist/tui/screens/resources/FunctionDetail.js.map +1 -0
- package/dist/ui/attach.d.ts +15 -0
- package/dist/ui/attach.js +63 -0
- package/dist/ui/attach.js.map +1 -0
- package/dist/ui/baremetal-resolve.d.ts +10 -0
- package/dist/ui/baremetal-resolve.js +50 -0
- package/dist/ui/baremetal-resolve.js.map +1 -0
- package/dist/ui/confirm.js +1 -1
- package/dist/ui/confirm.js.map +1 -1
- package/dist/ui/cycle.d.ts +66 -0
- package/dist/ui/cycle.js +96 -0
- package/dist/ui/cycle.js.map +1 -0
- package/dist/ui/deploy-ui.d.ts +75 -0
- package/dist/ui/deploy-ui.js +243 -0
- package/dist/ui/deploy-ui.js.map +1 -0
- package/dist/ui/order-result.d.ts +4 -0
- package/dist/ui/order-result.js +32 -0
- package/dist/ui/order-result.js.map +1 -0
- package/dist/ui/payment-gate.d.ts +26 -0
- package/dist/ui/payment-gate.js +70 -0
- package/dist/ui/payment-gate.js.map +1 -0
- package/dist/ui/payment.js +10 -3
- package/dist/ui/payment.js.map +1 -1
- package/dist/ui/portal.d.ts +1 -1
- package/dist/ui/portal.js +7 -2
- package/dist/ui/portal.js.map +1 -1
- package/dist/ui/project-resolve.d.ts +25 -0
- package/dist/ui/project-resolve.js +31 -0
- package/dist/ui/project-resolve.js.map +1 -0
- package/dist/ui/render-mode.d.ts +5 -0
- package/dist/ui/render-mode.js +1 -1
- package/dist/ui/render-mode.js.map +1 -1
- package/dist/ui/resource-detail.js +0 -3
- package/dist/ui/resource-detail.js.map +1 -1
- package/dist/ui/resource-resolve.d.ts +9 -2
- package/dist/ui/resource-resolve.js +11 -4
- package/dist/ui/resource-resolve.js.map +1 -1
- package/dist/ui/spinner.d.ts +10 -1
- package/dist/ui/spinner.js +12 -3
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/table.d.ts +7 -0
- package/dist/ui/table.js +11 -0
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tax.d.ts +10 -0
- package/dist/ui/tax.js +31 -0
- package/dist/ui/tax.js.map +1 -0
- package/dist/ui/ticket-resolve.d.ts +9 -1
- package/dist/ui/ticket-resolve.js +13 -2
- package/dist/ui/ticket-resolve.js.map +1 -1
- package/dist/ui/volume-resolve.js +4 -1
- package/dist/ui/volume-resolve.js.map +1 -1
- package/dist/ui/wait.d.ts +4 -0
- package/dist/ui/wait.js +7 -2
- package/dist/ui/wait.js.map +1 -1
- package/dist/ui/wizard.d.ts +2 -1
- package/dist/ui/wizard.js +1 -1
- package/dist/ui/wizard.js.map +1 -1
- package/dist/version-check-bin.js +2 -2
- package/dist/version-check-bin.js.map +1 -1
- package/dist/version-check.d.ts +5 -0
- package/dist/version-check.js +6 -1
- package/dist/version-check.js.map +1 -1
- package/package.json +53 -6
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import { statSync, existsSync, readdirSync, rmSync } from "node:fs";
|
|
3
|
+
import { resolve, basename, dirname } from "node:path";
|
|
4
|
+
import { BaseCommand } from "../base/command.js";
|
|
5
|
+
import { resolveApp } from "../apps-support/resolve.js";
|
|
6
|
+
import { linkKind } from "../config/store.js";
|
|
7
|
+
import { clientsForLinkTeam, isAppGone, notLinkedError, staleLinkError } from "../apps-support/link.js";
|
|
8
|
+
import { statusColor, G, dim } from "../ui/glyphs.js";
|
|
9
|
+
import { isInteractive } from "../ui/wizard.js";
|
|
10
|
+
import { importDotenv } from "../apps-support/dotenv.js";
|
|
11
|
+
import Link, { createApp, resolveAppRegion, slugify } from "./link.js";
|
|
12
|
+
import { ensurePaymentMethod, PaymentMethodRequired } from "../ui/payment-gate.js";
|
|
13
|
+
import { ApiError, AuthExpiredError } from "../api/errors.js";
|
|
14
|
+
import { withSpinner } from "../ui/spinner.js";
|
|
15
|
+
import { buildProgress, deployedCard, failedCard, deployFailedCard, deploymentUrl, releaseProgress, } from "../ui/deploy-ui.js";
|
|
16
|
+
/** What the rollout checklist's last line says when the release never goes live. */
|
|
17
|
+
const RELEASE_FAIL_LABEL = {
|
|
18
|
+
start_failed: "Instance failed to start",
|
|
19
|
+
health_failed: "Health check failed",
|
|
20
|
+
superseded: "Superseded by a newer deploy",
|
|
21
|
+
};
|
|
22
|
+
import { portalUrl } from "../ui/portal.js";
|
|
23
|
+
import { buildDetail, dotenvFiles, fetchSourceTarball, humanSize, makeTarball, sourceRootEntries, pollBuild, resolveNewRelease, uploadSource, waitForReleaseOutcome, } from "../apps-support/deploy.js";
|
|
24
|
+
/**
|
|
25
|
+
* `synteq deploy` — trigger a build + deploy for an app.
|
|
26
|
+
*
|
|
27
|
+
* Two source modes:
|
|
28
|
+
* - `--image <ref>` — deploy a pre-built image reference. No build step;
|
|
29
|
+
* the operator pulls + rolls it out. Fully supported today.
|
|
30
|
+
* - `--dir <path>` — tarball a local directory, upload it (a presigned PUT
|
|
31
|
+
* straight to the object store — see apps-support/deploy.ts) and build it
|
|
32
|
+
* in the cluster. Bare `synteq deploy` is `--dir .`.
|
|
33
|
+
* - `--source-url <url>` — a .tar.gz that already exists at a URL: the CLI
|
|
34
|
+
* downloads it and uploads it like a packed directory.
|
|
35
|
+
*
|
|
36
|
+
* After triggering, the command polls GET /apps/{id}/builds and prints the
|
|
37
|
+
* build's status as it advances pending → building → pushing → succeeded.
|
|
38
|
+
*/
|
|
39
|
+
export default class Deploy extends BaseCommand {
|
|
40
|
+
static apiKeyScope = "none";
|
|
41
|
+
static description = [
|
|
42
|
+
"Deploy an app from a pre-built image or a local source directory.",
|
|
43
|
+
"",
|
|
44
|
+
"`--image` rolls out an existing image reference. `--dir` (the default:",
|
|
45
|
+
"the current directory) packs a local directory, uploads it and builds it",
|
|
46
|
+
"in the cluster; `--source-url` downloads a .tar.gz from a URL and uploads",
|
|
47
|
+
"that instead. Follows the build and prints each status transition.",
|
|
48
|
+
"",
|
|
49
|
+
"Exits 1 when the build fails or its release never goes live — in JSON",
|
|
50
|
+
"mode too, where progress goes to stderr and stdout carries the final",
|
|
51
|
+
"build as one document. `--no-wait` returns the triggered build at once.",
|
|
52
|
+
].join("\n");
|
|
53
|
+
static examples = [
|
|
54
|
+
"<%= config.bin %> deploy # first run on a TTY: set up the app, then deploy — one command",
|
|
55
|
+
"<%= config.bin %> deploy --create my-api --plan free --location dfw # scripted first run: create + link + deploy, no prompts",
|
|
56
|
+
"<%= config.bin %> deploy --create my-api --plan starter --location dfw --yes # paid plan: charges the first month to the default card",
|
|
57
|
+
"<%= config.bin %> deploy --image registry.synteq.com/acme/my-api:v3 # bare: uses this directory's `synteq link`",
|
|
58
|
+
"<%= config.bin %> deploy --app my-api --image registry.synteq.com/acme/my-api:v3",
|
|
59
|
+
"<%= config.bin %> deploy --app my-api --dir ./services/api # pack, upload and build a subdirectory",
|
|
60
|
+
"<%= config.bin %> deploy --env-file .env.production # import that file's variables onto the app first, no prompt",
|
|
61
|
+
"<%= config.bin %> deploy --app my-api --source-url https://example.com/builds/my-api.tar.gz # build a tarball from a URL",
|
|
62
|
+
"<%= config.bin %> deploy --app my-api --image ...:v3 --no-wait # fire-and-forget",
|
|
63
|
+
"<%= config.bin %> deploy --app my-api --image ...:v3 -o json # CI: follows the rollout, exit 1 on failure",
|
|
64
|
+
];
|
|
65
|
+
static flags = {
|
|
66
|
+
app: Flags.string({
|
|
67
|
+
description: "App slug (or uuid) to deploy (default: the app this directory is linked to via `synteq link`).",
|
|
68
|
+
}),
|
|
69
|
+
create: Flags.string({
|
|
70
|
+
description: "Create a new app with this slug (in --project, or the active project) and deploy to it — the scripted form of the first-run walkthrough. Pair with --plan and --location.",
|
|
71
|
+
}),
|
|
72
|
+
plan: Flags.string({
|
|
73
|
+
description: "Plan tier for --create (default: free). A tier the team is at its cap on is refused.",
|
|
74
|
+
}),
|
|
75
|
+
location: Flags.string({
|
|
76
|
+
description: "Location code for --create, e.g. dfw (default: the only placeable location, else asks).",
|
|
77
|
+
}),
|
|
78
|
+
project: Flags.string({
|
|
79
|
+
description: "Project id for --create, and to scope an --app slug lookup.",
|
|
80
|
+
}),
|
|
81
|
+
"payment-method": Flags.string({
|
|
82
|
+
description: "For a paid --plan: the saved payment method id to charge the first month to (default: the team's default card).",
|
|
83
|
+
}),
|
|
84
|
+
"apply-credits": Flags.boolean({
|
|
85
|
+
description: "For a paid --plan: apply the team's credit balance to the first month first.",
|
|
86
|
+
}),
|
|
87
|
+
yes: Flags.boolean({
|
|
88
|
+
char: "y",
|
|
89
|
+
description: "Confirm the first-month charge of a paid --plan without asking (scripts must pass this).",
|
|
90
|
+
}),
|
|
91
|
+
image: Flags.string({
|
|
92
|
+
description: "Pre-built image reference to roll out (mutually exclusive with --dir).",
|
|
93
|
+
}),
|
|
94
|
+
dir: Flags.string({
|
|
95
|
+
description: "Local directory to pack, upload and build (default: the current directory; not with --image). The packed size is capped by the app's plan — see `synteq apps plans`.",
|
|
96
|
+
}),
|
|
97
|
+
"env-file": Flags.string({
|
|
98
|
+
description: "Import this .env's KEY=VALUE lines as variables on the app before the build (runtime secrets unless a `# scope=… kind=…` comment above a line says otherwise); no question asked. A .env is never packed, and a plain deploy never asks about it.",
|
|
99
|
+
}),
|
|
100
|
+
"source-url": Flags.string({
|
|
101
|
+
description: "URL of a source tarball (.tar.gz) to build instead of packing --dir. The CLI downloads it and uploads it; the same plan size limit applies.",
|
|
102
|
+
}),
|
|
103
|
+
"no-wait": Flags.boolean({
|
|
104
|
+
description: "Return as soon as the build is triggered; don't poll for status (and don't exit 1 on a failed build).",
|
|
105
|
+
}),
|
|
106
|
+
"poll-interval": Flags.integer({
|
|
107
|
+
default: 5,
|
|
108
|
+
description: "Seconds between build-status polls (default: 5, min: 2).",
|
|
109
|
+
}),
|
|
110
|
+
timeout: Flags.integer({
|
|
111
|
+
// The API now answers the deploy-by-key call before the source is
|
|
112
|
+
// fully prepared/built (202 + background work) and a large source can
|
|
113
|
+
// sit in its first status for several minutes — a deadline under 30
|
|
114
|
+
// minutes can cut off a legitimately still-running large deploy.
|
|
115
|
+
default: 1800,
|
|
116
|
+
description: "Max seconds to wait for the build to finish (default: 1800).",
|
|
117
|
+
}),
|
|
118
|
+
};
|
|
119
|
+
async run() {
|
|
120
|
+
await this.initClients();
|
|
121
|
+
const { flags } = await this.parse(Deploy);
|
|
122
|
+
try {
|
|
123
|
+
if (flags.image && flags.dir) {
|
|
124
|
+
this.error("Pass either --image or --dir, not both.", { exit: 1 });
|
|
125
|
+
}
|
|
126
|
+
if (flags["source-url"] && (flags.image || flags.dir)) {
|
|
127
|
+
this.error("Pass --source-url on its own, not with --image or --dir.", { exit: 1 });
|
|
128
|
+
}
|
|
129
|
+
// Bare `synteq deploy` (no --image / --dir / --source-url) → build the
|
|
130
|
+
// current directory from source. Explicit flags override this default.
|
|
131
|
+
if (flags.create && flags.app) {
|
|
132
|
+
this.error("Pass either --create <slug> or --app <slug>, not both.", { exit: 1 });
|
|
133
|
+
}
|
|
134
|
+
// Zero-config path: no --app → fall back to the directory's link.
|
|
135
|
+
let appRef = flags.app;
|
|
136
|
+
let linkProjectId = flags.project;
|
|
137
|
+
if (flags.create) {
|
|
138
|
+
// The scripted first run: every input on the command line, no
|
|
139
|
+
// prompts. Creates, links this directory, and carries on into the
|
|
140
|
+
// deploy below — one command from an empty checkout to a live app.
|
|
141
|
+
const slug = slugify(flags.create);
|
|
142
|
+
const region = await resolveAppRegion(this.clients, flags.location, async (locations) => {
|
|
143
|
+
if (!isInteractive() || this.outputFormat !== "table") {
|
|
144
|
+
throw new Error(`Several locations can place this app — pass --location (${locations.map((l) => l.code).join(", ")}).`);
|
|
145
|
+
}
|
|
146
|
+
const { pickFromCatalog } = await import("../ui/wizard.js");
|
|
147
|
+
return pickFromCatalog("Primary location", locations.map((l) => ({ value: l.region, name: l.city, description: l.code })));
|
|
148
|
+
}).catch((e) => {
|
|
149
|
+
// An ApiError/AuthExpiredError (a logged-out caller, most notably)
|
|
150
|
+
// must flow to the outer catch's this.fail(err) unchanged, so it
|
|
151
|
+
// gets the standard exit code (2 for auth) and JSON envelope
|
|
152
|
+
// (status/request_id) every other command's failures get — never
|
|
153
|
+
// flattened into a bare exit-1 this.error(). Only the genuine
|
|
154
|
+
// "no locations" / "unknown location" plain Error takes that path.
|
|
155
|
+
if (e instanceof ApiError || e instanceof AuthExpiredError)
|
|
156
|
+
throw e;
|
|
157
|
+
this.error(e.message, { exit: 1 });
|
|
158
|
+
});
|
|
159
|
+
const created = await createApp(this.clients, { slug, planTier: flags.plan ?? "free", region, projectId: flags.project }, {
|
|
160
|
+
interactive: isInteractive() && this.outputFormat === "table",
|
|
161
|
+
log: (l) => this.info(l),
|
|
162
|
+
paymentMethodId: flags["payment-method"],
|
|
163
|
+
applyCredits: flags["apply-credits"],
|
|
164
|
+
yes: flags.yes,
|
|
165
|
+
}).catch((e) => {
|
|
166
|
+
// "Add a payment method" is the actionable user case (exit 1).
|
|
167
|
+
// Everything else — NetworkError (3), AuthExpiredError (2), an
|
|
168
|
+
// ApiError, a bad-input Error — flows to the outer catch's
|
|
169
|
+
// this.fail so it keeps its real exit code instead of being
|
|
170
|
+
// flattened by a `"status" in e` test.
|
|
171
|
+
if (e instanceof PaymentMethodRequired)
|
|
172
|
+
this.error(e.message, { exit: 1 });
|
|
173
|
+
throw e;
|
|
174
|
+
});
|
|
175
|
+
this.clients.config.setLink(process.cwd(), {
|
|
176
|
+
team_id: created.teamId,
|
|
177
|
+
project_id: created.projectId,
|
|
178
|
+
app_id: created.id,
|
|
179
|
+
app_slug: created.slug,
|
|
180
|
+
linked_at: new Date().toISOString(),
|
|
181
|
+
});
|
|
182
|
+
if (this.outputFormat === "table") {
|
|
183
|
+
this.log(`${G.check} Created ${created.slug} → ${created.hostname} (${created.planTier} · ${created.region}); this directory is linked to it.`);
|
|
184
|
+
}
|
|
185
|
+
appRef = created.id;
|
|
186
|
+
linkProjectId = created.projectId;
|
|
187
|
+
}
|
|
188
|
+
else if (!appRef) {
|
|
189
|
+
let link = this.clients.config.linkFor(process.cwd());
|
|
190
|
+
// Unlinked on a TTY: don't dead-end. Run the link walkthrough (pick
|
|
191
|
+
// an existing app or create one), then CONTINUE into the deploy with
|
|
192
|
+
// the fresh link — "deploy here and it just works", in one command.
|
|
193
|
+
// Scripts and pipes still get the actionable error (or use --create).
|
|
194
|
+
if (!link && isInteractive() && this.outputFormat === "table") {
|
|
195
|
+
this.log(dim("No app is linked to this directory yet — set it up, then the deploy runs."));
|
|
196
|
+
await Link.run(flags.project ? ["--project", flags.project] : [], this.config);
|
|
197
|
+
// Link wrote the link through its own ConfigStore; pick it up here.
|
|
198
|
+
this.clients.config.reload();
|
|
199
|
+
link = this.clients.config.linkFor(process.cwd());
|
|
200
|
+
if (link) {
|
|
201
|
+
this.log("");
|
|
202
|
+
this.log(dim(`Deploying ${link.app_slug} from ${basename(process.cwd())}…`));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (!link)
|
|
206
|
+
this.error(notLinkedError("--app <slug>, or --create <slug>"), { exit: 1 });
|
|
207
|
+
if (linkKind(link) === "function") {
|
|
208
|
+
// A bare `deploy` in a function-linked dir used to set appRef to the
|
|
209
|
+
// function id → apps.get 404 → the stale-link handler SILENTLY
|
|
210
|
+
// removed the link. Catch it here (like resolveLinkedApp does) and
|
|
211
|
+
// point at the right command instead of destroying the link.
|
|
212
|
+
this.error(`This directory is linked to the function "${link.app_slug}", not an app. ` +
|
|
213
|
+
"Use `synteq function deploy` here, or pass --app <slug>.", { exit: 1 });
|
|
214
|
+
}
|
|
215
|
+
appRef = link.app_id;
|
|
216
|
+
linkProjectId = link.project_id;
|
|
217
|
+
this.clients = clientsForLinkTeam(this.clients, link, flags);
|
|
218
|
+
}
|
|
219
|
+
// resolveApp's error flows on untouched: the stale-link handler below
|
|
220
|
+
// recovers only a 404 (isAppGone) and rethrows everything else to the
|
|
221
|
+
// outer catch's this.fail, which maps a bad-slug plain Error to exit 1,
|
|
222
|
+
// a NetworkError to 3, and an AuthExpiredError to 2.
|
|
223
|
+
const lookup = (ref, projectId) => resolveApp(this.clients.api, ref, projectId);
|
|
224
|
+
const app = await lookup(appRef, linkProjectId).catch(async (e) => {
|
|
225
|
+
// A STALE LINK: the directory is linked to an app the API no longer
|
|
226
|
+
// has (deleted in the portal, or linked against another environment).
|
|
227
|
+
// Not a dead end on a TTY: drop the link, run the same walkthrough an
|
|
228
|
+
// unlinked directory gets, and carry on into the deploy. Scripts get
|
|
229
|
+
// the actionable error. An explicit --app that 404s is still an error:
|
|
230
|
+
// the caller named it.
|
|
231
|
+
const staleLink = !flags.app && !flags.create ? this.clients.config.linkFor(process.cwd()) : undefined;
|
|
232
|
+
if (!staleLink || !isAppGone(e))
|
|
233
|
+
throw e;
|
|
234
|
+
this.clients.config.removeLink(process.cwd());
|
|
235
|
+
if (!isInteractive() || this.outputFormat !== "table") {
|
|
236
|
+
this.error(staleLinkError(staleLink.app_slug, "--app <slug>, or --create <slug>"), { exit: 1 });
|
|
237
|
+
}
|
|
238
|
+
this.log(dim(`The app this directory was linked to (${staleLink.app_slug}) no longer exists — pick or create one, then the deploy runs.`));
|
|
239
|
+
await Link.run(flags.project ? ["--project", flags.project] : [], this.config);
|
|
240
|
+
this.clients.config.reload();
|
|
241
|
+
const link = this.clients.config.linkFor(process.cwd());
|
|
242
|
+
if (!link)
|
|
243
|
+
this.error(notLinkedError("--app <slug>, or --create <slug>"), { exit: 1 });
|
|
244
|
+
this.log("");
|
|
245
|
+
this.log(dim(`Deploying ${link.app_slug} from ${basename(process.cwd())}…`));
|
|
246
|
+
appRef = link.app_id;
|
|
247
|
+
linkProjectId = link.project_id;
|
|
248
|
+
this.clients = clientsForLinkTeam(this.clients, link, flags);
|
|
249
|
+
return lookup(link.app_id, link.project_id);
|
|
250
|
+
});
|
|
251
|
+
// Every deploy needs a payment method on the team, free tier included.
|
|
252
|
+
// (A just-created app was already gated at create; this is the cheap
|
|
253
|
+
// re-check for a directory linked long ago.)
|
|
254
|
+
await ensurePaymentMethod({
|
|
255
|
+
api: this.clients.api,
|
|
256
|
+
apiBaseUrl: this.clients.config.get().api_base_url,
|
|
257
|
+
interactive: isInteractive() && this.outputFormat === "table",
|
|
258
|
+
log: (l) => this.info(l),
|
|
259
|
+
}).catch((e) => {
|
|
260
|
+
if (e instanceof PaymentMethodRequired)
|
|
261
|
+
this.error(e.message, { exit: 1 });
|
|
262
|
+
throw e;
|
|
263
|
+
});
|
|
264
|
+
let build;
|
|
265
|
+
if (flags.image) {
|
|
266
|
+
build = await withSpinner("Triggering deploy", () => this.clients.api.apps.deploy(app.id, { sourceKind: "image", imageRef: flags.image }));
|
|
267
|
+
}
|
|
268
|
+
else if (flags["source-url"]) {
|
|
269
|
+
// A tarball that already exists somewhere: download it here and
|
|
270
|
+
// upload it like a packed directory. The platform does not fetch
|
|
271
|
+
// customer URLs.
|
|
272
|
+
const plan = await this.appPlan(app);
|
|
273
|
+
let archive;
|
|
274
|
+
try {
|
|
275
|
+
archive = await withSpinner("Downloading source", () => fetchSourceTarball(flags["source-url"], {
|
|
276
|
+
maxBytes: plan.current?.maxSourceMb ? plan.current.maxSourceMb * 1_000_000 : undefined,
|
|
277
|
+
}));
|
|
278
|
+
}
|
|
279
|
+
catch (e) {
|
|
280
|
+
this.error(e.message, { exit: 1 });
|
|
281
|
+
}
|
|
282
|
+
try {
|
|
283
|
+
this.info(dim(`Downloaded source → ${humanSize(archive)}`));
|
|
284
|
+
build = await this.uploadArchive(app, archive, plan);
|
|
285
|
+
}
|
|
286
|
+
finally {
|
|
287
|
+
rmSync(dirname(archive), { recursive: true, force: true });
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
// --dir (or bare `synteq deploy`): tarball the dir and UPLOAD it — the
|
|
292
|
+
// portal stores it as a build Secret and the cluster builds from source.
|
|
293
|
+
const dir = resolve(!flags.dir || flags.dir === "" ? "." : flags.dir);
|
|
294
|
+
if (!existsSync(dir) || !statSync(dir).isDirectory()) {
|
|
295
|
+
this.error(`Not a directory: ${dir}`, { exit: 1 });
|
|
296
|
+
}
|
|
297
|
+
// Refuse to upload a directory with no source in it. The builder
|
|
298
|
+
// would fail anyway, but late and with a bare "could not determine
|
|
299
|
+
// how to build" — and the usual cause (a branch switch removed the
|
|
300
|
+
// tracked files, leaving only ignored build output) is fixable here.
|
|
301
|
+
if (sourceRootEntries(dir).length === 0) {
|
|
302
|
+
this.error([
|
|
303
|
+
`${dir} has no source files to build — only dependencies or build output` +
|
|
304
|
+
` (${readdirSync(dir).join(", ") || "nothing"}).`,
|
|
305
|
+
"Are you on the right branch, or in the right directory? (`git status`, `ls`)",
|
|
306
|
+
].join("\n"), { exit: 1 });
|
|
307
|
+
}
|
|
308
|
+
// --env-file imports a dotenv file BEFORE packing, so the build that
|
|
309
|
+
// follows sees the variables; the file itself is never packed. A
|
|
310
|
+
// plain deploy never asks about .env — first-time setup (the link
|
|
311
|
+
// walkthrough creating the app) did, in its place.
|
|
312
|
+
let imported = 0;
|
|
313
|
+
try {
|
|
314
|
+
imported = await importDotenv({
|
|
315
|
+
dir,
|
|
316
|
+
envFile: flags["env-file"],
|
|
317
|
+
interactive: false,
|
|
318
|
+
target: `app ${app.slug}`,
|
|
319
|
+
log: (l) => this.info(l),
|
|
320
|
+
save: (r) => this.clients.api.apps
|
|
321
|
+
.setEnv(app.id, {
|
|
322
|
+
key: r.key,
|
|
323
|
+
value: r.value,
|
|
324
|
+
scope: r.scope ?? "runtime",
|
|
325
|
+
kind: r.kind ?? "secret",
|
|
326
|
+
...(r.note ? { note: r.note } : {}),
|
|
327
|
+
rollout: false,
|
|
328
|
+
})
|
|
329
|
+
.then(() => undefined),
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
catch (e) {
|
|
333
|
+
if (e instanceof ApiError)
|
|
334
|
+
throw e;
|
|
335
|
+
this.error(e.message, { exit: 1 });
|
|
336
|
+
}
|
|
337
|
+
const archive = await makeTarball(dir);
|
|
338
|
+
try {
|
|
339
|
+
this.info(dim(`Packed ${basename(dir)} → ${humanSize(archive)}`));
|
|
340
|
+
const dotenv = dotenvFiles(dir).filter((f) => imported === 0 || f !== ".env");
|
|
341
|
+
if (dotenv.length) {
|
|
342
|
+
this.info(dim(`Not packed: ${dotenv.join(", ")} — set variables with \`synteq app env add\`, \`--env-file\`, or the Environment tab.`));
|
|
343
|
+
}
|
|
344
|
+
build = await this.uploadArchive(app, archive, await this.appPlan(app));
|
|
345
|
+
}
|
|
346
|
+
finally {
|
|
347
|
+
// The pack is a full copy of the source — an un-ignored .env
|
|
348
|
+
// included — sitting in a shared tmpdir. It goes the moment the
|
|
349
|
+
// upload settles, whichever way: success, a failed PUT, or the
|
|
350
|
+
// size-cap refusal above.
|
|
351
|
+
rmSync(dirname(archive), { recursive: true, force: true });
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (flags["no-wait"]) {
|
|
355
|
+
this.emit(build, () => this.printBuildLine(build));
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
// JSON mode follows the build like table mode — a CI job must see exit 1
|
|
359
|
+
// for a failed build or a release that never goes live (until 1.2.2 JSON
|
|
360
|
+
// returned the triggered build and exit 0, so the failure was invisible).
|
|
361
|
+
// The checklist takes an `out` stream and goes to stderr; stdout carries
|
|
362
|
+
// the final document only.
|
|
363
|
+
const out = this.outputFormat === "json" ? process.stderr : process.stdout;
|
|
364
|
+
const progress = buildProgress(`Deploying ${shortish(build.id)}`, { out });
|
|
365
|
+
const final = await pollBuild(this.clients.api, app.id, build, {
|
|
366
|
+
intervalMs: Math.max(2, flags["poll-interval"]) * 1000,
|
|
367
|
+
timeoutMs: flags.timeout * 1000,
|
|
368
|
+
onStatus: (status, b) => progress.update(status, buildDetail(b)),
|
|
369
|
+
});
|
|
370
|
+
if (final.status === "succeeded")
|
|
371
|
+
progress.done("succeeded");
|
|
372
|
+
else if (final.status === "failed")
|
|
373
|
+
progress.failed();
|
|
374
|
+
else
|
|
375
|
+
progress.failed(`Build still ${final.status}`);
|
|
376
|
+
const durationMs = final.startedAt && final.finishedAt
|
|
377
|
+
? new Date(final.finishedAt).getTime() - new Date(final.startedAt).getTime()
|
|
378
|
+
: null;
|
|
379
|
+
const apiBaseUrl = this.clients.config.get().api_base_url;
|
|
380
|
+
if (final.status === "succeeded") {
|
|
381
|
+
// Resolve the release this build produced (matched by digest) so the
|
|
382
|
+
// card shows the correct number — the app's activeRelease is stale until
|
|
383
|
+
// the status cron mints the new release a beat later.
|
|
384
|
+
const release = await resolveNewRelease(this.clients.api, app.id, final);
|
|
385
|
+
// Deep-link straight to this release's panel in the portal (opens the
|
|
386
|
+
// Deployments tab with the release drawer already open).
|
|
387
|
+
const panelUrl = release
|
|
388
|
+
? portalUrl(apiBaseUrl, `/apps/${app.id}`, {
|
|
389
|
+
tab: "deployments",
|
|
390
|
+
deployment: release.id,
|
|
391
|
+
})
|
|
392
|
+
: portalUrl(apiBaseUrl, `/apps/${app.id}`, { tab: "deployments" });
|
|
393
|
+
// A succeeded BUILD is not a succeeded DEPLOY: the release still has
|
|
394
|
+
// to start its instance and pass the health gate, and either can fail
|
|
395
|
+
// (start_failed / health_failed). Wait for the release outcome and
|
|
396
|
+
// only claim success when it is actually live.
|
|
397
|
+
// Rendered as its own checklist (Starting instance → Health check →
|
|
398
|
+
// Rolling out → Live) rather than one opaque "waiting" spinner, so
|
|
399
|
+
// the user sees which gate a slow or failing rollout is stuck on.
|
|
400
|
+
let outcome = null;
|
|
401
|
+
if (release) {
|
|
402
|
+
const rollout = releaseProgress(`Rolling out release #${release.number}`, { out });
|
|
403
|
+
outcome = await waitForReleaseOutcome(this.clients.api, app.id, release.number, 180, (s) => rollout.update(s));
|
|
404
|
+
if (outcome === "live")
|
|
405
|
+
rollout.done("live");
|
|
406
|
+
else if (outcome === "start_failed" || outcome === "health_failed" || outcome === "superseded")
|
|
407
|
+
rollout.failed(RELEASE_FAIL_LABEL[outcome]);
|
|
408
|
+
else
|
|
409
|
+
rollout.failed("Still rolling out after 180s");
|
|
410
|
+
}
|
|
411
|
+
if (!release || outcome === "live") {
|
|
412
|
+
this.emit(final, () => this.log(deployedCard({
|
|
413
|
+
appSlug: app.slug,
|
|
414
|
+
url: deploymentUrl(app.hostname),
|
|
415
|
+
release: release?.number ?? null,
|
|
416
|
+
digest: final.imageDigest,
|
|
417
|
+
durationMs,
|
|
418
|
+
panelUrl,
|
|
419
|
+
})));
|
|
420
|
+
}
|
|
421
|
+
else if (outcome === "start_failed" || outcome === "health_failed") {
|
|
422
|
+
// waitForReleaseOutcome only reports the terminal status string —
|
|
423
|
+
// fetch the release once more for its failureReason (the guest
|
|
424
|
+
// console tail, Task 7).
|
|
425
|
+
let failureReason;
|
|
426
|
+
try {
|
|
427
|
+
const releases = await this.clients.api.apps.releases(app.id);
|
|
428
|
+
failureReason = releases.find((r) => r.number === release.number)?.failureReason;
|
|
429
|
+
}
|
|
430
|
+
catch {
|
|
431
|
+
// best-effort — the failure card still renders without it
|
|
432
|
+
}
|
|
433
|
+
this.emit({ ...final, releaseStatus: outcome, failureReason }, () => this.log(deployFailedCard({
|
|
434
|
+
appSlug: app.slug,
|
|
435
|
+
release: release.number,
|
|
436
|
+
status: outcome,
|
|
437
|
+
panelUrl,
|
|
438
|
+
failureReason,
|
|
439
|
+
})));
|
|
440
|
+
this.exit(1);
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
// superseded (another deploy overtook this one) or still rolling
|
|
444
|
+
// after the wait window — report honestly, don't claim live.
|
|
445
|
+
this.emit({ ...final, releaseStatus: outcome ?? "pending" }, () => this.log(`\n${G.dot} Build succeeded; release #${release.number} is ${statusColor(outcome ?? "still rolling out")}. Watch it: ${panelUrl}`));
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
else if (final.status === "failed") {
|
|
449
|
+
// Deep-link to this build's panel so the user lands on the failed
|
|
450
|
+
// build's logs.
|
|
451
|
+
const panelUrl = portalUrl(apiBaseUrl, `/apps/${app.id}`, {
|
|
452
|
+
tab: "deployments",
|
|
453
|
+
build: final.id,
|
|
454
|
+
});
|
|
455
|
+
this.emit(final, () => this.log(failedCard({
|
|
456
|
+
appSlug: app.slug,
|
|
457
|
+
buildId: final.id,
|
|
458
|
+
panelUrl,
|
|
459
|
+
failureReason: final.failureReason,
|
|
460
|
+
})));
|
|
461
|
+
this.exit(1);
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
// Timed out while non-terminal — say so plainly and leave the exit clean
|
|
465
|
+
// (the build may still finish server-side).
|
|
466
|
+
this.emit(final, () => this.log(`\n${G.dot} Build ${shortish(final.id)} still ${statusColor(final.status)} — stopped waiting after ${flags.timeout}s.`));
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
catch (err) {
|
|
470
|
+
this.fail(err);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
/** Print a single build status line (used for --no-wait / json fallback). */
|
|
474
|
+
/** The app's plan (for its source size cap) beside the full plan list. */
|
|
475
|
+
async appPlan(app) {
|
|
476
|
+
const all = (await this.clients.api.apps.plans().catch(() => [])) ?? [];
|
|
477
|
+
return { current: all.find((p) => p.name === app.planTier), all };
|
|
478
|
+
}
|
|
479
|
+
/** Upload a source archive and start its build — a packed --dir or a
|
|
480
|
+
* downloaded --source-url, behind the same plan size check. */
|
|
481
|
+
async uploadArchive(app, archive, plan) {
|
|
482
|
+
const packedBytes = statSync(archive).size;
|
|
483
|
+
// Decimal MB, the unit the API enforces (source_deploy.MB = 1_000_000).
|
|
484
|
+
if (plan.current?.maxSourceMb && packedBytes > plan.current.maxSourceMb * 1_000_000) {
|
|
485
|
+
const upgrade = smallestPlanFor(plan.all, plan.current, packedBytes);
|
|
486
|
+
this.error([
|
|
487
|
+
`Packed source is ${(packedBytes / 1_000_000).toFixed(1)} MB; the ${plan.current.displayName ?? plan.current.name} plan allows ${plan.current.maxSourceMb} MB.`,
|
|
488
|
+
upgrade
|
|
489
|
+
? `Upgrade to ${upgrade.displayName ?? upgrade.name} (${upgrade.maxSourceMb} MB): synteq app plan change ${upgrade.name}`
|
|
490
|
+
: "No plan allows a pack this size; connect the repository and deploy from a push.",
|
|
491
|
+
"Or trim what ships: in a git checkout .gitignore decides (build output, node_modules and .env files never do); elsewhere add a .synteqignore.",
|
|
492
|
+
].join("\n"), { exit: 1 });
|
|
493
|
+
}
|
|
494
|
+
this.info(dim(`Uploading source — the platform picks Dockerfile or Railpack from what it finds.`));
|
|
495
|
+
return withSpinner("Uploading source + building", (update) => uploadSource(this.clients.api, app.id, archive, {
|
|
496
|
+
onProgress: (pct) => update(`Uploading source + building (${pct}%)`),
|
|
497
|
+
}));
|
|
498
|
+
}
|
|
499
|
+
printBuildLine(b) {
|
|
500
|
+
this.log(`${statusColor(b.status)} build ${shortish(b.id)} ${b.sourceKind}${b.commitSha ? ` ${b.commitSha.slice(0, 7)}` : ""}`);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function shortish(id) {
|
|
504
|
+
return id.length > 8 ? id.slice(0, 8) : id;
|
|
505
|
+
}
|
|
506
|
+
/** The smallest plan above `current` (by its cap — the plan list carries no
|
|
507
|
+
* rank) whose packed cap holds `packedBytes`; undefined when none does. The
|
|
508
|
+
* API's 413 names the same plan, so the pre-check and the server agree. */
|
|
509
|
+
export function smallestPlanFor(plans, current, packedBytes) {
|
|
510
|
+
return plans
|
|
511
|
+
.filter((p) => p.name !== current.name && (p.maxSourceMb ?? 0) > (current.maxSourceMb ?? 0))
|
|
512
|
+
.filter((p) => (p.maxSourceMb ?? 0) * 1_000_000 >= packedBytes)
|
|
513
|
+
.sort((a, b) => (a.maxSourceMb ?? 0) - (b.maxSourceMb ?? 0))[0];
|
|
514
|
+
}
|
|
515
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvE,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C,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;SAC3F,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,GAAG,SAAS,IAAI,WAAW,CAAC;SAC9D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseCommand } from "../../base/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* `synteq function create` — create a serverless function in the active project.
|
|
4
|
+
*
|
|
5
|
+
* Backend: POST /functions. Placement takes exactly one of `region` or
|
|
6
|
+
* `locationId`, so `--region` and `--location` are mutually exclusive; with
|
|
7
|
+
* neither, the first row of GET /functions-locations is used. The plan
|
|
8
|
+
* defaults to the first tier GET /functions-plans returns.
|
|
9
|
+
*/
|
|
10
|
+
export default class FunctionCreate extends BaseCommand {
|
|
11
|
+
static apiKeyScope: string;
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static args: {
|
|
15
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
static flags: {
|
|
18
|
+
plan: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
region: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
location: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
runtime: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
};
|
|
24
|
+
run(): Promise<void>;
|
|
25
|
+
/** The first plan the catalog offers — the backend has no "default" flag. */
|
|
26
|
+
private defaultPlan;
|
|
27
|
+
/** A location code → its id, or the first location's id when none is given. */
|
|
28
|
+
private resolveLocation;
|
|
29
|
+
}
|