mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-27 07:38:51 +00:00
Some checks are pending
bot-nix-hashes / hash (blacksmith-4vcpu-ubuntu-2404, x86_64-linux) (push) Waiting to run
bot-nix-hashes / hash (blacksmith-4vcpu-ubuntu-2404-arm, aarch64-linux) (push) Waiting to run
bot-nix-hashes / hash (macos-latest, aarch64-darwin) (push) Waiting to run
bot-nix-hashes / compute (push) Blocked by required conditions
bot-nix-hashes / publish (push) Blocked by required conditions
check-nix / nix-eval (push) Waiting to run
Process daemon / Miri (callback ownership) (push) Waiting to run
Process daemon / Core (macos-15) (push) Waiting to run
Process daemon / Core (ubuntu-22.04) (push) Waiting to run
Process daemon / Windows (arm64) (push) Waiting to run
Process daemon / Windows (x64) (push) Waiting to run
check / typecheck (push) Waiting to run
deploy-files / files-build (push) Waiting to run
deploy-files / files-deploy (push) Blocked by required conditions
deploy-site / site-build (push) Waiting to run
deploy-site / site-deploy (push) Blocked by required conditions
deploy / legacy-build (push) Waiting to run
deploy / legacy-deploy (push) Blocked by required conditions
deploy / data-build (push) Waiting to run
deploy / data-deploy (push) Blocked by required conditions
22 lines
791 B
TypeScript
22 lines
791 B
TypeScript
// The stage a `--mode` deploys. Only `dev` and `production` are stages: anything else, including no mode at all, throws,
|
|
// so a typo or a bare `cf deploy` can never fall through to production.
|
|
const hosts = {
|
|
dev: "dev.opencode.ai",
|
|
production: "opencode.ai",
|
|
} as const
|
|
|
|
export type Stage = keyof typeof hosts
|
|
|
|
export function stage(mode: string | undefined): Stage {
|
|
if (mode === "dev" || mode === "production") return mode
|
|
throw new Error(`Unknown mode ${JSON.stringify(mode)}; pass --mode dev or --mode production`)
|
|
}
|
|
|
|
// The host the stage's site is served from.
|
|
export function stageHost(value: Stage) {
|
|
return hosts[value]
|
|
}
|
|
|
|
export function stageAccount(value: Stage) {
|
|
return value === "dev" ? "d8e944f537ceef3f06a5bd3aec1d7a53" : "15d29c8639fd3733b1b5486a2acfd968"
|
|
}
|