def nightly_build(ctx, project_name, branch_name, circle_token):
url = 'https://circleci.com/api/v1/project/{}/tree/{}?circle-token={}'.format(
project_name,
branch_name,
circle_token
)
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
}
body = {
'build_parameters': {
'RUN_NIGHTLY_BUILD': "true",
}
}
response = requests.post(url, json=body, headers=headers)
print("Nightly Build queued on CircleCI: http_status={}, response={}".format(
response.status_code,
response.json()
))
评论列表
文章目录