这是我创建部署的方式:
;(async () => {
const repo = await octokit.repos.get({
owner: process.env.CIRCLE_PROJECT_USERNAME,
repo: process.env.CIRCLE_PROJECT_REPONAME
})
const targetUrl = buildTargetUrl(
repo.data.id,
process.env.CIRCLE_BUILD_NUM,
process.env.CIRCLE_WORKING_DIRECTORY.replace("~", process.env.HOME)
)
try {
const deployment = await octokit.repos.createDeployment({
environment: "qa",
owner: process.env.CIRCLE_PROJECT_USERNAME,
repo: process.env.CIRCLE_PROJECT_REPONAME,
ref: process.env.CIRCLE_SHA1,
required_contexts: [],
task: "deploy"
})
await octokit.repos.createDeploymentStatus({
deployment_id: deployment.data.id,
environment: "staging",
owner: process.env.CIRCLE_PROJECT_USERNAME,
repo: process.env.CIRCLE_PROJECT_REPONAME,
target_url: targetUrl,
log_url: targetUrl,
description: "Deployment has completed",
state: "success"
})
} catch (err) {
console.log(err)
process.exit(1)
}
})()
登台部署是由Now创建的。质量检查部署是使用我的代码创建的。我想念的是什么?
答案 0 :(得分:0)
我在environment_url
中缺少createDeploymentStatus
:
await octokit.repos.createDeploymentStatus({
deployment_id: deployment.data.id,
environment: "staging",
environment_url: targetUrl,
owner: process.env.CIRCLE_PROJECT_USERNAME,
repo: process.env.CIRCLE_PROJECT_REPONAME,
target_url: targetUrl,
log_url: targetUrl,
state: "success"
})