{"id":29791775,"url":"https://github.com/paraself/fc-deploy","last_synced_at":"2025-07-28T00:34:31.113Z","repository":{"id":296894906,"uuid":"994818051","full_name":"paraself/fc-deploy","owner":"paraself","description":"阿里云函数计算自动部署","archived":false,"fork":false,"pushed_at":"2025-06-24T11:13:32.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-24T12:33:01.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paraself.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-02T14:25:25.000Z","updated_at":"2025-06-24T11:13:35.000Z","dependencies_parsed_at":"2025-06-03T06:41:07.462Z","dependency_job_id":"1bfbe66b-540b-4ce0-b32b-766c78e55c48","html_url":"https://github.com/paraself/fc-deploy","commit_stats":null,"previous_names":["paraself/fc-deploy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paraself/fc-deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraself%2Ffc-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraself%2Ffc-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraself%2Ffc-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraself%2Ffc-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paraself","download_url":"https://codeload.github.com/paraself/fc-deploy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraself%2Ffc-deploy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267446949,"owners_count":24088563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-28T00:34:30.592Z","updated_at":"2025-07-28T00:34:31.106Z","avatar_url":"https://github.com/paraself.png","language":"TypeScript","readme":"# fc-deploy\n\n阿里云函数计算自动部署\n\n### 安装\n\n```bash\nnpm i fc-deploy\n```\n\n### 使用\n\n```ts\nimport { deploy } from \"fc-deploy\";\n/** 一组函数名称 */\nconst funcs = [\n  \"chat\",\n  \"msgfile\",\n  \"msgfile_large\",\n  \"recog\",\n  \"group\",\n  \"wemeeting\",\n] as const;\n\ndeploy({\n  /** 项目名称 */\n  name: \"wecom-chat\",\n  /** FC客户端设置 */\n  fcConfigs: funcs.map((f) =\u003e ({\n    accessKeyId: process.env.ALIYUN_ACCESS_KEY!,\n    accessKeySecret: process.env.ALIYUN_SECRET_ACCESS_KEY!,\n    fcEndpoint: \"xxxxxxxx.cn-beijing.fc.aliyuncs.com\",\n    fcRegionId: \"cn-beijing\",\n    fcFunction: f,\n    fcService: \"服务名称\",\n  })),\n  /** 层设置 */\n  layerConfig: {\n    layerName: \"wecom-chat\",\n    /** 层描述 */\n    layerDescription: \"\",\n    /** 层兼容哪些运行时 */\n    compatibleRuntime: [\"nodejs20\"],\n    /** 定义如何获取各个函数的依赖hash */\n    getHash: async (params) =\u003e {\n      const redis = getUpstashRedis(\"dk\");\n      const data = await redis.get\u003cstring\u003e(`fcd:hash:${params.funcName}`);\n      return data || \"\";\n    },\n    /** 定义如何设置hash */\n    setHash: async (params) =\u003e {\n      const redis = getUpstashRedis(\"dk\");\n      const res = await redis.set(`fcd:hash:${params.funcName}`, params.hash);\n      if (res !== \"OK\") {\n        console.error(\"upstash redis cache error: \" + res);\n      }\n    },\n    /** 需要监控哪些依赖变化，可以同时监控多个依赖，任意一个变化了，都会重新创建层 */\n    packageJsonLists: [\n      path.resolve(process.cwd(), \"package.json\"),\n      path.resolve(\n        process.cwd(),\n        \"node_modules/@myrog/mylib/package.json\",\n      ),\n    ],\n  },\n  /** oss配置，用来上传层文件。 */\n  ossConfig: {\n    accessKeyId: process.env.ALIYUN_ACCESS_KEY!,\n    accessKeySecret: process.env.ALIYUN_SECRET_ACCESS_KEY!,\n    bucket: \"your_bucket\",\n    region: \"oss-cn-beijing\",\n  },\n  /** 日志回调 */\n  cbLog(msg) {\n    console.log(msg);\n    const fsClient = getFeishuClient();\n    return fsClient.im.message.create({\n      params: {\n        receive_id_type: \"chat_id\",\n      },\n      data: {\n        msg_type: \"text\",\n        receive_id: process.env.FEISHU_CHAT_ID!,\n        content: JSON.stringify({\n          text: msg,\n        }),\n      },\n    });\n  },\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaself%2Ffc-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparaself%2Ffc-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaself%2Ffc-deploy/lists"}