Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
leximpact-socio-fiscal-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leximpact
Simulateur socio-fiscal
leximpact-socio-fiscal-ui
Commits
6700dcbb
Commit
6700dcbb
authored
3 years ago
by
Emmanuel Raviart
Browse files
Options
Downloads
Patches
Plain Diff
Add triggering of prod deployment.
parent
02fbbf7a
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!58
Add triggering of prod deployment.
Pipeline
#1414
passed
3 years ago
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
gitlab-ci/src/gitlab-ci.ts
+27
-27
27 additions, 27 deletions
gitlab-ci/src/gitlab-ci.ts
with
27 additions
and
27 deletions
gitlab-ci/src/gitlab-ci.ts
+
27
−
27
View file @
6700dcbb
...
@@ -206,11 +206,11 @@ async function main() {
...
@@ -206,11 +206,11 @@ async function main() {
)
)
await
commitAndPushWithUpdatedVersions
(
nextVersionObject
)
await
commitAndPushWithUpdatedVersions
(
nextVersionObject
)
await
triggerDevDeployPipeline
()
await
triggerDevDeployPipeline
()
//
await triggerProdDeployPipeline()
;
await
triggerProdDeployPipeline
()
}
}
await
triggerDevDeployPipeline
()
await
triggerDevDeployPipeline
()
//
await triggerProdDeployPipeline()
await
triggerProdDeployPipeline
()
}
else
{
}
else
{
console
.
log
(
console
.
log
(
`Unhandled event "
${
CI_PIPELINE_SOURCE
}
" in branch "
${
CI_COMMIT_BRANCH
}
".`
,
`Unhandled event "
${
CI_PIPELINE_SOURCE
}
" in branch "
${
CI_COMMIT_BRANCH
}
".`
,
...
@@ -383,31 +383,31 @@ async function triggerDevDeployPipeline() {
...
@@ -383,31 +383,31 @@ async function triggerDevDeployPipeline() {
)
)
}
}
//
async function triggerProdDeployPipeline() {
async
function
triggerProdDeployPipeline
()
{
//
const url = new URL(
const
url
=
new
URL
(
//
`/api/v4/projects/29/trigger/pipeline`,
`/api/v4/projects/29/trigger/pipeline`
,
//
CI_SERVER_URL
CI_SERVER_URL
,
//
).toString()
;
).
toString
()
//
console.log(
console
.
log
(
//
"Triggering LexImpact socio-fiscal Prod Deploy pipeline on master branch…"
"
Triggering LexImpact socio-fiscal Prod Deploy pipeline on master branch…
"
,
//
)
;
)
//
const response = await fetch(url, {
const
response
=
await
fetch
(
url
,
{
//
body: new URLSearchParams({
body
:
new
URLSearchParams
({
//
ref: "master",
ref
:
"
master
"
,
//
token: CI_JOB_TOKEN!,
token
:
CI_JOB_TOKEN
!
,
//
}).toString(),
}).
toString
(),
//
headers: {
headers
:
{
//
"Content-Type": "application/x-www-form-urlencoded",
"
Content-Type
"
:
"
application/x-www-form-urlencoded
"
,
//
},
},
//
method: "POST",
method
:
"
POST
"
,
//
})
;
})
//
assert(
assert
(
//
response.ok,
response
.
ok
,
//
`Unexpected response from ${url}: ${response.status} ${
`Unexpected response from
${
url
}
:
${
response
.
status
}
${
//
response.statusText
response
.
statusText
//
}\n${await response.text()}`
}
\n
${
await
response
.
text
()}
`
,
//
)
;
)
//
}
}
function
versionFromObject
({
major
,
minor
,
patch
}:
VersionObject
):
string
{
function
versionFromObject
({
major
,
minor
,
patch
}:
VersionObject
):
string
{
return
`
${
major
}
.
${
minor
}
.
${
patch
}
`
return
`
${
major
}
.
${
minor
}
.
${
patch
}
`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment