Jxck / mozaic.fm

8 stars 0 forks source link

Cloudflare Deploy の修正 #22

Closed Jxck closed 5 months ago

Jxck commented 5 months ago
Jxck commented 5 months ago
$ curl -X PATCH "https://api.cloudflare.com/client/v4/accounts/73488b4f0e679ea20c8705a1b0480614/pages/projects/mozaicfm" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  --data "{\"production_branch\": \"main\"}"

account id は dashboard > worker & pages > overview のここ

image

token は https://dash.cloudflare.com/profile/api-tokens で cloudflare worker の template から、 Cloudflare Pages:Edit だけ有効にしたトークンを作る。(終わったらすぐ捨てていい)

で変更したらできた。

output

{
  "result": {
    "id": "e5706e1a-c6eb-4d3a-851f-d0f0004f9862",
    "name": "mozaicfm",
    "subdomain": "mozaicfm.pages.dev",
    "domains": [
      "mozaicfm.pages.dev"
    ],
    "build_config": {
      "destination_dir": ".vercel/output/static",
      "web_analytics_tag": null,
      "web_analytics_token": null
    },
    "deployment_configs": {
      "preview": {
        "env_vars": null,
        "fail_open": true,
        "always_use_latest_compatibility_date": false,
        "compatibility_date": "2024-05-24",
        "compatibility_flags": [
          "nodejs_compat"
        ],
        "build_image_major_version": 2,
        "usage_model": "standard",
        "wrangler_config_hash": "d5ed0d0fa645ae5261e5a9aca6e812679c31d59cbdf8619cbf53d6b4d2339019"
      },
      "production": {
        "env_vars": null,
        "fail_open": true,
        "always_use_latest_compatibility_date": false,
        "compatibility_date": "2024-05-24",
        "compatibility_flags": [
          "nodejs_compat"
        ],
        "build_image_major_version": 2,
        "usage_model": "standard",
        "wrangler_config_hash": "d5ed0d0fa645ae5261e5a9aca6e812679c31d59cbdf8619cbf53d6b4d2339019"
      }
    },
    "latest_deployment": {
      "id": "e7b4a3fe-3f42-4fe2-bee9-1742682502e9",
      "short_id": "e7b4a3fe",
      "project_id": "e5706e1a-c6eb-4d3a-851f-d0f0004f9862",
      "project_name": "mozaicfm",
      "environment": "preview",
      "url": "https://e7b4a3fe.mozaicfm.pages.dev",
      "created_on": "2024-05-28T01:23:12.763401Z",
      "modified_on": "2024-05-28T01:23:15.346659Z",
      "latest_stage": {
        "name": "deploy",
        "started_on": null,
        "ended_on": "2024-05-28T01:23:15.346659Z",
        "status": "success"
      },
      "deployment_trigger": {
        "type": "ad_hoc",
        "metadata": {
          "branch": "main",
          "commit_hash": "6b4ec800941c71cd08954fb4569b10917c3944ec",
          "commit_message": "Merge pull request #18 from Jxck/nextjs\r\n\r\nNextjs 化",
          "commit_dirty": true
        }
      },
      "stages": [
        {
          "name": "queued",
          "started_on": "2024-05-28T01:23:12.763401Z",
          "ended_on": null,
          "status": "active"
        },
        {
          "name": "initialize",
          "started_on": null,
          "ended_on": null,
          "status": "idle"
        },
        {
          "name": "clone_repo",
          "started_on": null,
          "ended_on": null,
          "status": "idle"
        },
        {
          "name": "build",
          "started_on": null,
          "ended_on": null,
          "status": "idle"
        },
        {
          "name": "deploy",
          "started_on": null,
          "ended_on": "2024-05-28T01:23:15.346659Z",
          "status": "success"
        }
      ],
      "build_config": {
        "build_command": null,
        "destination_dir": ".vercel/output/static",
        "build_caching": null,
        "root_dir": null,
        "web_analytics_tag": null,
        "web_analytics_token": null
      },
      "env_vars": {},
      "compatibility_date": "2024-05-24",
      "compatibility_flags": [
        "nodejs_compat"
      ],
      "build_image_major_version": 2,
      "usage_model": "bundled",
      "aliases": [
        "https://main.mozaicfm.pages.dev"
      ],
      "is_skipped": false,
      "production_branch": "master"
    },
    "canonical_deployment": {
      "id": "49739071-1926-4039-929e-869f97c76966",
      "short_id": "49739071",
      "project_id": "e5706e1a-c6eb-4d3a-851f-d0f0004f9862",
      "project_name": "mozaicfm",
      "environment": "production",
      "url": "https://49739071.mozaicfm.pages.dev",
      "created_on": "2024-05-25T17:20:49.582087Z",
      "modified_on": "2024-05-25T17:20:51.794225Z",
      "latest_stage": {
        "name": "deploy",
        "started_on": null,
        "ended_on": "2024-05-25T17:20:51.794225Z",
        "status": "success"
      },
      "deployment_trigger": {
        "type": "ad_hoc",
        "metadata": {
          "branch": "master",
          "commit_hash": "84658f4cff8d681b43a9ccfd5903c3089d3a65da",
          "commit_message": "up",
          "commit_dirty": true
        }
      },
      "stages": [
        {
          "name": "queued",
          "started_on": "2024-05-25T17:20:49.582087Z",
          "ended_on": null,
          "status": "active"
        },
        {
          "name": "initialize",
          "started_on": null,
          "ended_on": null,
          "status": "idle"
        },
        {
          "name": "clone_repo",
          "started_on": null,
          "ended_on": null,
          "status": "idle"
        },
        {
          "name": "build",
          "started_on": null,
          "ended_on": null,
          "status": "idle"
        },
        {
          "name": "deploy",
          "started_on": null,
          "ended_on": "2024-05-25T17:20:51.794225Z",
          "status": "success"
        }
      ],
      "build_config": {
        "build_command": null,
        "destination_dir": ".vercel/output/static",
        "build_caching": null,
        "root_dir": null,
        "web_analytics_tag": null,
        "web_analytics_token": null
      },
      "env_vars": {},
      "compatibility_date": "2024-05-24",
      "compatibility_flags": [
        "nodejs_compat"
      ],
      "build_image_major_version": 2,
      "usage_model": "bundled",
      "aliases": null,
      "is_skipped": false,
      "production_branch": "master"
    },
    "created_on": "2024-05-25T17:20:03.856033Z",
    "production_branch": "main",
    "production_script_name": "pages-worker--2781728-production",
    "preview_script_name": "pages-worker--2781728-preview"
  },
  "success": true,
  "errors": [],
  "messages": []
}

で、変更できた。