mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
ci: deploy dev workers in anomaly-dev (#63379)
This commit is contained in:
@@ -12,6 +12,10 @@ set +x
|
||||
|
||||
url=${CLOUDFLARE_TOKEN_URL:-https://kjivkui2evldapbok5fhrrl6oy0fctkp.lambda-url.us-east-1.on.aws/}
|
||||
account=${CLOUDFLARE_ACCOUNT_ID:-15d29c8639fd3733b1b5486a2acfd968}
|
||||
if [[ $# == 1 ]]; then
|
||||
. "$(dirname "$0")/lib.sh"
|
||||
account=$(stage_account "$1")
|
||||
fi
|
||||
|
||||
# One argv value, never a line in curl's config: a newline in an override must not be able to
|
||||
# inject curl options or move the AWS credentials into Basic auth.
|
||||
|
||||
@@ -32,7 +32,8 @@ done
|
||||
|
||||
: "${CLOUDFLARE_API_TOKEN:?Set CLOUDFLARE_API_TOKEN}"
|
||||
# Pinned in targets/ and in the token issuer's config (anomalyco/secrets).
|
||||
export CLOUDFLARE_ACCOUNT_ID=15d29c8639fd3733b1b5486a2acfd968
|
||||
CLOUDFLARE_ACCOUNT_ID=$(stage_account "$mode")
|
||||
export CLOUDFLARE_ACCOUNT_ID
|
||||
|
||||
unexpected=$(cd "$src" && find . ! -type d ! -type f -o -type f ! -path ./SHA256SUMS \
|
||||
! -path ./v0/config.json \
|
||||
|
||||
@@ -24,7 +24,8 @@ target="$release/targets/files/$mode/wrangler.json"
|
||||
|
||||
: "${CLOUDFLARE_API_TOKEN:?Set CLOUDFLARE_API_TOKEN}"
|
||||
# Pinned in targets/ and in the token issuer's config (anomalyco/secrets).
|
||||
export CLOUDFLARE_ACCOUNT_ID=15d29c8639fd3733b1b5486a2acfd968
|
||||
CLOUDFLARE_ACCOUNT_ID=$(stage_account "$mode")
|
||||
export CLOUDFLARE_ACCOUNT_ID
|
||||
|
||||
unexpected=$(cd "$src" && find . ! -type d ! -type f -o -type f ! -path ./SHA256SUMS ! -path ./index.js)
|
||||
[ -z "$unexpected" ] || die "Unexpected files in the files artifact: $unexpected"
|
||||
|
||||
@@ -24,7 +24,8 @@ target="$release/targets/legacy/$mode"
|
||||
|
||||
: "${CLOUDFLARE_API_TOKEN:?Set CLOUDFLARE_API_TOKEN}"
|
||||
# Pinned in targets/ and in the token issuer's config (anomalyco/secrets).
|
||||
export CLOUDFLARE_ACCOUNT_ID=15d29c8639fd3733b1b5486a2acfd968
|
||||
CLOUDFLARE_ACCOUNT_ID=$(stage_account "$mode")
|
||||
export CLOUDFLARE_ACCOUNT_ID
|
||||
|
||||
unexpected=$(cd "$src" && find . ! -type d ! -type f -o -type f ! -path ./SHA256SUMS \
|
||||
! -path ./v0/config.json \
|
||||
|
||||
@@ -24,7 +24,8 @@ target="$release/targets/site/$mode"
|
||||
|
||||
: "${CLOUDFLARE_API_TOKEN:?Set CLOUDFLARE_API_TOKEN}"
|
||||
# Pinned in targets/ and in the token issuer's config (anomalyco/secrets).
|
||||
export CLOUDFLARE_ACCOUNT_ID=15d29c8639fd3733b1b5486a2acfd968
|
||||
CLOUDFLARE_ACCOUNT_ID=$(stage_account "$mode")
|
||||
export CLOUDFLARE_ACCOUNT_ID
|
||||
|
||||
unexpected=$(cd "$src" && find . ! -type d ! -type f -o -type f ! -path ./SHA256SUMS \
|
||||
! -path ./v0/config.json \
|
||||
|
||||
@@ -23,6 +23,14 @@ dry_run() {
|
||||
[ "${OPENCODE_DRY_RUN:-false}" = true ]
|
||||
}
|
||||
|
||||
stage_account() {
|
||||
case "$1" in
|
||||
dev) echo d8e944f537ceef3f06a5bd3aec1d7a53 ;;
|
||||
production) echo 15d29c8639fd3733b1b5486a2acfd968 ;;
|
||||
*) die "Unknown Cloudflare stage: $1" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
sha256() {
|
||||
if command -v sha256sum > /dev/null; then sha256sum "$@"; else shasum -a 256 "$@"; fi
|
||||
}
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
"compatibilityDate": "2026-07-25",
|
||||
"compatibilityFlags": ["nodejs_compat"],
|
||||
"triggers": [
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/en/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/zh/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/zht/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/ko/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/de/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/es/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/fr/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/it/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/da/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/ja/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/pl/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/ru/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/uk/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/ar/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/no/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/br/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/th/data*", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/tr/data*", "zone": "opencode.ai" }
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/en/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/zh/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/zht/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/ko/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/de/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/es/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/fr/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/it/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/da/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/ja/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/pl/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/ru/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/uk/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/ar/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/no/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/br/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/th/data*", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/tr/data*", "zone": "dev.opencode.ai" }
|
||||
],
|
||||
"observability": { "enabled": true },
|
||||
"workersDev": false,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"accountId": "15d29c8639fd3733b1b5486a2acfd968",
|
||||
"accountId": "d8e944f537ceef3f06a5bd3aec1d7a53",
|
||||
"buildContext": { "isPreview": false, "mode": "dev" }
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "opencode-dev-files",
|
||||
"account_id": "d8e944f537ceef3f06a5bd3aec1d7a53",
|
||||
"main": "index.js",
|
||||
"no_bundle": true,
|
||||
"compatibility_date": "2026-08-01",
|
||||
"workers_dev": false,
|
||||
"preview_urls": false,
|
||||
"vars": { "STAGE": "dev" },
|
||||
"routes": [{ "pattern": "dev.opencode.ai/files/*", "zone_name": "opencode.ai" }],
|
||||
"routes": [{ "pattern": "dev.opencode.ai/files/*", "zone_name": "dev.opencode.ai" }],
|
||||
"r2_buckets": [{ "binding": "FILES", "bucket_name": "opencode-dev-files" }]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"accountId": "15d29c8639fd3733b1b5486a2acfd968",
|
||||
"accountId": "d8e944f537ceef3f06a5bd3aec1d7a53",
|
||||
"buildContext": { "isPreview": false, "mode": "dev" }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"compatibilityDate": "2026-07-25",
|
||||
"compatibilityFlags": ["nodejs_compat"],
|
||||
"domains": ["dev.opncd.ai", "api.dev.opencode.ai"],
|
||||
"logpush": true,
|
||||
"logpush": false,
|
||||
"observability": { "enabled": true },
|
||||
"workersDev": false,
|
||||
"previewUrls": false,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"accountId": "15d29c8639fd3733b1b5486a2acfd968",
|
||||
"accountId": "d8e944f537ceef3f06a5bd3aec1d7a53",
|
||||
"buildContext": { "isPreview": false, "mode": "dev" }
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
},
|
||||
"domains": ["dev.opencode.ai", "docs.dev.opencode.ai"],
|
||||
"triggers": [
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai", "zone": "opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/*", "zone": "opencode.ai" }
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai", "zone": "dev.opencode.ai" },
|
||||
{ "type": "fetch", "pattern": "dev.opencode.ai/*", "zone": "dev.opencode.ai" }
|
||||
],
|
||||
"observability": { "enabled": true },
|
||||
"workersDev": false,
|
||||
|
||||
Reference in New Issue
Block a user