I’ve got a single webhook configured to receive pipeline events. I have a pipeline that builds, and then publishes to GitLab pages.
For every run of the pipeline, I receive two webhook triggers with a ‘success’ status. Once for the finishing of the build, and once for the finishing of the deploy to GitLab pages.
There doesn’t seem to be any way to differentiate these, so I know when the deploy is actually finished? The only difference in the content of the webhook body is the ‘finished_at’ time is later on the second ‘success’ event.
It feels like a bug to me, as it shouldn’t be firing with ‘success’ until the deploy is completed?
.gitlab-ci.yml:
image: node:12.16.1
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
pages:
script:
- yarn install
- yarn build
artifacts:
paths:
- public
only:
- master
deploy screen:
Note that the time it takes to deploy corresponds with the different ‘finished_at’ times in the webhook content below.
webhook ‘success’ event 1:
[
{
"object_kind": "pipeline",
"object_attributes": {
"id": 203438692,
"ref": "master",
"tag": false,
"sha": "XXX",
"before_sha": "0000000000000000000000000000000000000000",
"source": "web",
"status": "success",
"detailed_status": "passed",
"stages": [
"test",
"deploy"
],
"created_at": "2020-10-16 08:07:55 UTC",
"finished_at": "2020-10-16 08:09:22 UTC",
"duration": 82,
"variables": []
},
"merge_request": null,
"user": { ... },
"project": {
"id": 17386209,
"name": "XXX",
"description": "",
"web_url": "XXXi",
"avatar_url": null,
"git_ssh_url": "XXX",
"git_http_url": "XXX",
"namespace": "XXX",
"visibility_level": 0,
"path_with_namespace": "XXX",
"default_branch": "master",
"ci_config_path": null
},
"commit": {
"id": "XXX",
"message": "Add event logo to the API\n",
"title": "Add event logo to the API",
"timestamp": "2020-10-16T14:49:28+10:00",
"url": "XXX",
"author": {
"name": "James Crowley",
"email": "XXX"
}
},
"builds": [
{
"id": 794535019,
"stage": "test",
"name": "pages",
"status": "success",
"created_at": "2020-10-16 08:07:55 UTC",
"started_at": "2020-10-16 08:07:59 UTC",
"finished_at": "2020-10-16 08:09:22 UTC",
"when": "on_success",
"manual": false,
"allow_failure": false,
"user": { ... },
"runner": {
"id": 44028,
"description": "shared-runners-manager-3.gitlab.com",
"active": true,
"is_shared": true
},
"artifacts_file": {
"filename": "artifacts.zip",
"size": 5204717
}
}
]
}
]
webhook success event 2:
[
{
"object_kind": "pipeline",
"object_attributes": {
"id": 203438692,
"ref": "master",
"tag": false,
"sha": "XXX",
"before_sha": "0000000000000000000000000000000000000000",
"source": "web",
"status": "success",
"detailed_status": "passed",
"stages": [
"test",
"deploy"
],
"created_at": "2020-10-16 08:07:55 UTC",
"finished_at": "2020-10-16 08:09:40 UTC",
"duration": 82,
"variables": []
},
"merge_request": null,
"user": { ... },
"project": {
"id": 17386209,
"name": "XXX",
"description": "",
"web_url": "XXX",
"avatar_url": null,
"git_ssh_url": "XXX",
"git_http_url": "XXX",
"namespace": "XXX",
"visibility_level": 0,
"path_with_namespace": "XXX",
"default_branch": "master",
"ci_config_path": null
},
"commit": {
"id": "XXX",
"message": "Add event logo to the API\n",
"title": "Add event logo to the API",
"timestamp": "2020-10-16T14:49:28+10:00",
"url": "XXX",
"author": {
"name": "James Crowley",
"email": "XXX"
}
},
"builds": [
{
"id": 794535019,
"stage": "test",
"name": "pages",
"status": "success",
"created_at": "2020-10-16 08:07:55 UTC",
"started_at": "2020-10-16 08:07:59 UTC",
"finished_at": "2020-10-16 08:09:22 UTC",
"when": "on_success",
"manual": false,
"allow_failure": false,
"user": { ... },
"runner": {
"id": 44028,
"description": "shared-runners-manager-3.gitlab.com",
"active": true,
"is_shared": true
},
"artifacts_file": {
"filename": "artifacts.zip",
"size": 5204717
}
}
]
}
]