Skip to content
Snippets Groups Projects
Commit 6700dcbb authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Add triggering of prod deployment.

parent 02fbbf7a
No related branches found
No related tags found
1 merge request!58Add triggering of prod deployment.
Pipeline #1414 passed
......@@ -206,11 +206,11 @@ async function main() {
)
await commitAndPushWithUpdatedVersions(nextVersionObject)
await triggerDevDeployPipeline()
// await triggerProdDeployPipeline();
await triggerProdDeployPipeline()
}
await triggerDevDeployPipeline()
// await triggerProdDeployPipeline()
await triggerProdDeployPipeline()
} else {
console.log(
`Unhandled event "${CI_PIPELINE_SOURCE}" in branch "${CI_COMMIT_BRANCH}".`,
......@@ -383,31 +383,31 @@ async function triggerDevDeployPipeline() {
)
}
// async function triggerProdDeployPipeline() {
// const url = new URL(
// `/api/v4/projects/29/trigger/pipeline`,
// CI_SERVER_URL
// ).toString();
// console.log(
// "Triggering LexImpact socio-fiscal Prod Deploy pipeline on master branch…"
// );
// const response = await fetch(url, {
// body: new URLSearchParams({
// ref: "master",
// token: CI_JOB_TOKEN!,
// }).toString(),
// headers: {
// "Content-Type": "application/x-www-form-urlencoded",
// },
// method: "POST",
// });
// assert(
// response.ok,
// `Unexpected response from ${url}: ${response.status} ${
// response.statusText
// }\n${await response.text()}`
// );
// }
async function triggerProdDeployPipeline() {
const url = new URL(
`/api/v4/projects/29/trigger/pipeline`,
CI_SERVER_URL,
).toString()
console.log(
"Triggering LexImpact socio-fiscal Prod Deploy pipeline on master branch…",
)
const response = await fetch(url, {
body: new URLSearchParams({
ref: "master",
token: CI_JOB_TOKEN!,
}).toString(),
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
method: "POST",
})
assert(
response.ok,
`Unexpected response from ${url}: ${response.status} ${
response.statusText
}\n${await response.text()}`,
)
}
function versionFromObject({ major, minor, patch }: VersionObject): string {
return `${major}.${minor}.${patch}`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment