-
Notifications
You must be signed in to change notification settings - Fork 38
/
base_notify_github_stage.yml
58 lines (52 loc) · 1.23 KB
/
base_notify_github_stage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
# feature-branches deployments
# these jobs interact with the GitHub API to post the deployment URL and status to the pull-request
#
#
.notify_stage: ¬ify_stage
image: ghcr.io/socialgouv/docker/git-deploy:6.65.0
allow_failure: true
stage: .post
dependencies: []
rules:
- if: "$AUTO_DEVOPS_NOTIFY_DISABLED"
when: never
- when: always
.base_notify_pending_stage:
extends:
- .notify_stage
script:
#
- create-deployment
- cat /tmp/deploy_payload.json
#
- extract-deploy-id
- echo "GitHub deployment id '$(cat DEPLOY_ID)'"
artifacts:
expire_in: 1 week
paths:
- DEPLOY_ID
.resolve_deploy_environment: &resolve_deploy_environment |
set -x
if [[ -n "${PRODUCTION+x}" ]]; then
export ENVIRONMENT="production"
else
export ENVIRONMENT=${ENVIRONMENT:-"staging"}
fi
.base_notify_fail_stage:
extends:
- .notify_stage
allow_failure: true
rules:
- when: on_failure
script:
- *resolve_deploy_environment
- update-deployment $(cat DEPLOY_ID) "${HOST}" failure
.base_notify_success_stage:
extends:
- .notify_stage
rules:
- when: on_success
script:
- *resolve_deploy_environment
- update-deployment $(cat DEPLOY_ID) "${HOST}" success