-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
216 lines (191 loc) · 4.78 KB
/
.gitlab-ci.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
image:
name: container-registry.softwareheritage.org/swh/infra/swh-apps/add_forge_now:20250113.1
default:
before_script:
- if [ -f build.env ]; then source build.env; fi
- export SWH_CONFIG_FILENAME="$SWH_CONFIG_FILENAME"
- source .gitlab-ci/bash-functions.sh
- print_date Started
tags:
- AddForgeNowRequest
after_script:
- source .gitlab-ci/bash-functions.sh
- print_date Completed
variables:
STAGING_AMQP_URL: http://scheduler0.internal.staging.swh.network:15672
PRODUCTION_AMQP_URL: http://saatchi.internal.softwareheritage.org:15672
GITLAB_URL: https://gitlab.softwareheritage.org
WEBAPP_URL: https://archive.softwareheritage.org
OIDC_URL: https://auth.softwareheritage.org/auth/
OIDC_REALM: SoftwareHeritage
STAGING_CONFIG_FILENAME: /etc/swh/scheduler-staging.yml
PRODUCTION_CONFIG_FILENAME: /etc/swh/scheduler-production.yml
LISTING_DELAY: 900
PROJECT_ID: 474
PROJECT_NAME: add-forge-now-requests
MILESTONE_ID: 53
INGESTION_SUCCESS_LIMIT: 30
# STAGES
stages:
- staging_list_origins
- staging_ingest_origins
- staging_set_status
- production_list-origins
- production_ingest-origins
- production_set_status
# TEMPLATES
.artifacts:
artifacts:
untracked: true
expire_in: 14 days
paths:
- "build.env"
.on_success_status:
rules:
- if: $CI_PIPELINE_SOURCE == "trigger"
when: on_success
.on_failure_status:
rules:
- if: $CI_PIPELINE_SOURCE == "trigger"
when: on_failure
.production_dependencies:
needs:
- job: 1p_register-lister
artifacts: true
# JOBS
01_create_issue_and_register:
stage: .pre
script:
- gitlab_create_issue
- register_vars staging
extends:
- .artifacts
rules:
- if: $CI_PIPELINE_SOURCE == "trigger"
02_check_ports_and_token:
stage: .pre
script:
- check_network_ports
- webapp_check_token
extends:
- .on_success_status
03_comment_request:
stage: .pre
script:
- webapp_comment_and_status
extends:
- .on_success_status
needs:
- job: 01_create_issue_and_register
artifacts: true
- job: 02_check_ports_and_token
1s_register_lister:
stage: staging_list_origins
script:
- scheduler_register_lister
extends:
- .on_success_status
2s_check_listed_origins:
stage: staging_list_origins
script:
- scheduler_check_listed_origins
extends:
- .on_success_status
needs:
- job: 01_create_issue_and_register
artifacts: true
- job: 1s_register_lister
3s_schedule_first_visits:
stage: staging_ingest_origins
script:
- scheduler_schedule_first_visits
extends:
- .on_success_status
4s_check_ingested_origins:
stage: staging_ingest_origins
script:
- scheduler_check_ingested_origins
- scheduler_check_success_rate
extends:
- .on_success_status
needs:
- job: 01_create_issue_and_register
artifacts: true
- job: 3s_schedule_first_visits
staging_status_successful:
stage: staging_set_status
script:
- webapp_comment_and_status SCHEDULED
- gitlab_update_issue success
- register_vars production
extends:
- .artifacts
- .on_success_status
staging_status_unsuccessful:
stage: staging_set_status
script:
- gitlab_update_issue failure
- register_vars production
extends:
- .artifacts
- .on_failure_status
1p_register-lister:
stage: production_list-origins
script:
- scheduler_register_lister
extends:
- .artifacts
- .on_success_status
dependencies:
- "staging_status_successful"
2p_check-listed-origins:
stage: production_list-origins
script:
- scheduler_check_listed_origins
extends:
- .on_success_status
- .production_dependencies
3p_schedule-first-visits:
stage: production_ingest-origins
script:
- scheduler_schedule_first_visits
extends:
- .on_success_status
needs:
- job: 1p_register-lister
artifacts: true
- job: 2p_check-listed-origins
4p_check-ingested-origins:
stage: production_ingest-origins
script:
- scheduler_check_ingested_origins
- scheduler_check_success_rate
extends:
- .on_success_status
needs:
- job: 1p_register-lister
artifacts: true
- job: 3p_schedule-first-visits
production_status_successful:
stage: production_set_status
script:
- webapp_comment_and_status FIRST_ORIGIN_LOADED
- gitlab_update_issue success
- gitlab_close_issue
- gitlab_commit_readme_history successful
extends:
- .on_success_status
needs:
- job: 1p_register-lister
artifacts: true
- job: 4p_check-ingested-origins
production_status_unsuccessful:
stage: production_set_status
script:
- gitlab_update_issue failure
# - webapp_comment_and_status UNSUCCESSFUL
- gitlab_commit_readme_history unsuccessful
extends:
- .on_failure_status
dependencies:
- "staging_status_successful"