[go: up one dir, main page]

ci_info 0.14.15

Provides current CI environment information.
Documentation
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
//! # config
//!
//! Predefined config of CI vendors.
//!

use crate::types::{EnvValue, Vendor, VendorConfig};

pub(crate) fn create() -> Vec<VendorConfig> {
    vec![
        VendorConfig {
            name: "Agola".to_string(),
            vendor: Vendor::Agola,
            ci_env: EnvValue::Exists("AGOLA_REPOSITORY_URL".to_string()),
            pr_env: None,
            branch_name_env: Some("AGOLA_GIT_BRANCH".to_string()),
        },
        VendorConfig {
            name: "AppCenter".to_string(),
            vendor: Vendor::AppCenter,
            ci_env: EnvValue::Exists("APPCENTER_BUILD_ID".to_string()),
            pr_env: None,
            branch_name_env: Some("APPCENTER_BRANCH".to_string()),
        },
        VendorConfig {
            name: "AppCircle".to_string(),
            vendor: Vendor::AppCircle,
            ci_env: EnvValue::Exists("AC_APPCIRCLE".to_string()),
            pr_env: None,
            branch_name_env: Some("AC_GIT_BRANCH".to_string()),
        },
        VendorConfig {
            name: "AppVeyor".to_string(),
            vendor: Vendor::AppVeyor,
            ci_env: EnvValue::Exists("APPVEYOR".to_string()),
            pr_env: Some(EnvValue::Exists("APPVEYOR_PULL_REQUEST_NUMBER".to_string())),
            branch_name_env: Some("APPVEYOR_REPO_BRANCH".to_string()),
        },
        VendorConfig {
            name: "AWS CodeBuild".to_string(),
            vendor: Vendor::AWSCodeBuild,
            ci_env: EnvValue::Exists("CODEBUILD_BUILD_ARN".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Azure Pipelines".to_string(),
            vendor: Vendor::AzurePipelines,
            ci_env: EnvValue::Exists("TF_BUILD".to_string()),
            pr_env: Some(EnvValue::Value(
                "BUILD_REASON".to_string(),
                "PullRequest".to_string(),
            )),
            branch_name_env: Some("BUILD_SOURCEBRANCHNAME".to_string()),
        },
        VendorConfig {
            name: "Bamboo".to_string(),
            vendor: Vendor::Bamboo,
            ci_env: EnvValue::Exists("bamboo_planKey".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Bitbucket Pipelines".to_string(),
            vendor: Vendor::BitbucketPipelines,
            ci_env: EnvValue::Exists("BITBUCKET_COMMIT".to_string()),
            pr_env: Some(EnvValue::Exists("BITBUCKET_PR_ID".to_string())),
            branch_name_env: Some("BITBUCKET_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Bitrise".to_string(),
            vendor: Vendor::Bitrise,
            ci_env: EnvValue::Exists("BITRISE_IO".to_string()),
            pr_env: Some(EnvValue::Exists("BITRISE_PULL_REQUEST".to_string())),
            branch_name_env: Some("BITRISE_GIT_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Buddy".to_string(),
            vendor: Vendor::Buddy,
            ci_env: EnvValue::Exists("BUDDY_WORKSPACE_ID".to_string()),
            pr_env: Some(EnvValue::Exists(
                "BUDDY_EXECUTION_PULL_REQUEST_ID".to_string(),
            )),
            branch_name_env: Some("BUDDY_EXECUTION_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Buildkite".to_string(),
            vendor: Vendor::Buildkite,
            ci_env: EnvValue::Exists("BUILDKITE".to_string()),
            pr_env: Some(EnvValue::NotEqual(
                "BUILDKITE_PULL_REQUEST".to_string(),
                "false".to_string(),
            )),
            branch_name_env: None,
        },
        VendorConfig {
            name: "CircleCI".to_string(),
            vendor: Vendor::CircleCI,
            ci_env: EnvValue::Exists("CIRCLECI".to_string()),
            pr_env: Some(EnvValue::Exists("CIRCLE_PULL_REQUEST".to_string())),
            branch_name_env: Some("CIRCLE_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Cirrus CI".to_string(),
            vendor: Vendor::CirrusCI,
            ci_env: EnvValue::Exists("CIRRUS_CI".to_string()),
            pr_env: Some(EnvValue::Exists("CIRRUS_PR".to_string())),
            branch_name_env: Some("CIRRUS_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Codefresh".to_string(),
            vendor: Vendor::Codefresh,
            ci_env: EnvValue::Exists("CF_BUILD_ID".to_string()),
            pr_env: Some(EnvValue::Exists("CF_PULL_REQUEST_ID".to_string())),
            branch_name_env: Some("CF_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Codemagic".to_string(),
            vendor: Vendor::Codemagic,
            ci_env: EnvValue::Exists("CM_BUILD_ID".to_string()),
            pr_env: Some(EnvValue::Value(
                "CM_PULL_REQUEST".to_string(),
                "true".to_string(),
            )),
            branch_name_env: Some("CM_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Codeship".to_string(),
            vendor: Vendor::Codeship,
            ci_env: EnvValue::Value("CI_NAME".to_string(), "codeship".to_string()),
            pr_env: None,
            branch_name_env: Some("CI_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Drone".to_string(),
            vendor: Vendor::Drone,
            ci_env: EnvValue::Exists("DRONE".to_string()),
            pr_env: Some(EnvValue::Value(
                "DRONE_BUILD_EVENT".to_string(),
                "pull_request".to_string(),
            )),
            branch_name_env: None,
        },
        VendorConfig {
            name: "dsari".to_string(),
            vendor: Vendor::DSARI,
            ci_env: EnvValue::Exists("DSARI".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Earthly".to_string(),
            vendor: Vendor::EARTHLY,
            ci_env: EnvValue::Exists("EARTHLY_CI".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Flow CI".to_string(),
            vendor: Vendor::FlowCI,
            ci_env: EnvValue::Exists("FLOWCI_JOB_BUILD_NUM".to_string()),
            pr_env: None,
            branch_name_env: Some("FLOWCI_GIT_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Gitea Actions".to_string(),
            vendor: Vendor::GiteaActions,
            ci_env: EnvValue::Exists("GITEA_ACTIONS".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "GitHub Actions".to_string(),
            vendor: Vendor::GitHubActions,
            ci_env: EnvValue::Exists("GITHUB_ACTIONS".to_string()),
            pr_env: Some(EnvValue::Value(
                "GITHUB_EVENT_NAME".to_string(),
                "pull_request".to_string(),
            )),
            branch_name_env: None,
        },
        VendorConfig {
            name: "GitLab CI".to_string(),
            vendor: Vendor::GitLabCI,
            ci_env: EnvValue::Exists("GITLAB_CI".to_string()),
            pr_env: Some(EnvValue::Exists("CI_MERGE_REQUEST_ID".to_string())),
            branch_name_env: Some("CI_COMMIT_REF_NAME".to_string()),
        },
        VendorConfig {
            name: "Gerrit".to_string(),
            vendor: Vendor::Gerrit,
            ci_env: EnvValue::Exists("GERRIT_PROJECT".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "GoCD".to_string(),
            vendor: Vendor::GoCD,
            ci_env: EnvValue::Exists("GO_PIPELINE_LABEL".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Google Cloud Build".to_string(),
            vendor: Vendor::GoogleCloudBuild,
            ci_env: EnvValue::Exists("BUILDER_OUTPUT".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Harness CI".to_string(),
            vendor: Vendor::HarnessCI,
            ci_env: EnvValue::Exists("HARNESS_BUILD_ID".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Heroku".to_string(),
            vendor: Vendor::Heroku,
            ci_env: EnvValue::Contains("NODE".to_string(), "heroku".to_string()),
            pr_env: None,
            branch_name_env: Some("HEROKU_TEST_RUN_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Hudson".to_string(),
            vendor: Vendor::Hudson,
            ci_env: EnvValue::Exists("HUDSON_URL".to_string()),
            pr_env: None,
            branch_name_env: Some("BRANCH_NAME".to_string()),
        },
        VendorConfig {
            name: "Jenkins".to_string(),
            vendor: Vendor::Jenkins,
            ci_env: EnvValue::AllExists(vec!["JENKINS_URL".to_string(), "BUILD_ID".to_string()]),
            pr_env: Some(EnvValue::AnyExists(vec![
                "ghprbPullId".to_string(),
                "CHANGE_ID".to_string(),
            ])),
            branch_name_env: Some("BRANCH_NAME".to_string()),
        },
        VendorConfig {
            name: "JenkinsX".to_string(),
            vendor: Vendor::JenkinsX,
            ci_env: EnvValue::AllExists(vec![
                "JX_CHART_REPOSITORY".to_string(),
                "BUILD_ID".to_string(),
            ]),
            pr_env: Some(EnvValue::Exists("PULL_NUMBER".to_string())),
            branch_name_env: Some("BRANCH_NAME".to_string()),
        },
        VendorConfig {
            name: "Layer CI".to_string(),
            vendor: Vendor::LayerCI,
            ci_env: EnvValue::Exists("LAYERCI".to_string()),
            pr_env: Some(EnvValue::Exists("LAYERCI_PULL_REQUEST".to_string())),
            branch_name_env: Some("LAYERCI_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Magnum CI".to_string(),
            vendor: Vendor::MagnumCI,
            ci_env: EnvValue::Exists("MAGNUM".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Netlify CI".to_string(),
            vendor: Vendor::NetlifyCI,
            ci_env: EnvValue::Value("NETLIFY".to_string(), "true".to_string()),
            pr_env: Some(EnvValue::NotEqual(
                "PULL_REQUEST".to_string(),
                "false".to_string(),
            )),
            branch_name_env: Some("BRANCH".to_string()),
        },
        VendorConfig {
            name: "Nevercode".to_string(),
            vendor: Vendor::Nevercode,
            ci_env: EnvValue::Exists("NEVERCODE".to_string()),
            pr_env: Some(EnvValue::NotEqual(
                "NEVERCODE_PULL_REQUEST".to_string(),
                "false".to_string(),
            )),
            branch_name_env: Some("NEVERCODE_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Prow".to_string(),
            vendor: Vendor::Prow,
            ci_env: EnvValue::Exists("PROW_JOB_ID".to_string()),
            pr_env: Some(EnvValue::NotEmpty("PULL_NUMBER".to_string())),
            branch_name_env: Some("PULL_BASE_REF".to_string()),
        },
        VendorConfig {
            name: "Render".to_string(),
            vendor: Vendor::Render,
            ci_env: EnvValue::Exists("RENDER".to_string()),
            pr_env: Some(EnvValue::Value(
                "IS_PULL_REQUEST".to_string(),
                "true".to_string(),
            )),
            branch_name_env: None,
        },
        VendorConfig {
            name: "Sail CI".to_string(),
            vendor: Vendor::SailCI,
            ci_env: EnvValue::Exists("SAILCI".to_string()),
            pr_env: Some(EnvValue::Exists("SAIL_PULL_REQUEST_NUMBER".to_string())),
            branch_name_env: None,
        },
        VendorConfig {
            name: "Screwdriver".to_string(),
            vendor: Vendor::Screwdriver,
            ci_env: EnvValue::Exists("SCREWDRIVER".to_string()),
            pr_env: Some(EnvValue::NotEmpty("SD_PULL_REQUEST".to_string())),
            branch_name_env: Some("GIT_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Semaphore".to_string(),
            vendor: Vendor::Semaphore,
            ci_env: EnvValue::Exists("SEMAPHORE".to_string()),
            pr_env: Some(EnvValue::Exists("PULL_REQUEST_NUMBER".to_string())),
            branch_name_env: Some("SEMAPHORE_GIT_BRANCH".to_string()),
        },
        VendorConfig {
            name: "SourceHut".to_string(),
            vendor: Vendor::SourceHut,
            ci_env: EnvValue::Contains("JOB_URL".to_string(), "builds.sr.ht".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Strider CD".to_string(),
            vendor: Vendor::StriderCD,
            ci_env: EnvValue::Exists("STRIDER".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "TaskCluster".to_string(),
            vendor: Vendor::TaskCluster,
            ci_env: EnvValue::AllExists(vec!["TASK_ID".to_string(), "RUN_ID".to_string()]),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "TeamCity".to_string(),
            vendor: Vendor::TeamCity,
            ci_env: EnvValue::Exists("TEAMCITY_VERSION".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Travis CI".to_string(),
            vendor: Vendor::TravisCI,
            ci_env: EnvValue::Exists("TRAVIS".to_string()),
            pr_env: Some(EnvValue::NotEqual(
                "TRAVIS_PULL_REQUEST".to_string(),
                "false".to_string(),
            )),
            branch_name_env: Some("TRAVIS_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Vela".to_string(),
            vendor: Vendor::Vela,
            ci_env: EnvValue::Exists("VELA_BUILD_NUMBER".to_string()),
            pr_env: Some(EnvValue::Exists("VELA_PULL_REQUEST".to_string())),
            branch_name_env: Some("VELA_BUILD_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Vercel".to_string(),
            vendor: Vendor::Vercel,
            ci_env: EnvValue::AnyExists(vec!["NOW_BUILDER".to_string(), "VERCEL".to_string()]),
            pr_env: Some(EnvValue::Exists("VERCEL_GIT_PULL_REQUEST_ID".to_string())),
            branch_name_env: None,
        },
        VendorConfig {
            name: "Woodpecker CI".to_string(),
            vendor: Vendor::WoodpeckerCI,
            ci_env: EnvValue::Value("CI".to_string(), "woodpecker".to_string()),
            pr_env: Some(EnvValue::NotEmpty("CI_COMMIT_PULL_REQUEST".to_string())),
            branch_name_env: Some("CI_COMMIT_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Xcode Cloud".to_string(),
            vendor: Vendor::XcodeCloud,
            ci_env: EnvValue::Exists("CI_XCODE_PROJECT".to_string()),
            pr_env: Some(EnvValue::NotEmpty("CI_PULL_REQUEST_NUMBER".to_string())),
            branch_name_env: Some("CI_BRANCH".to_string()),
        },
        VendorConfig {
            name: "Xcode Server".to_string(),
            vendor: Vendor::XcodeServer,
            ci_env: EnvValue::Exists("XCS".to_string()),
            pr_env: None,
            branch_name_env: None,
        },
        VendorConfig {
            name: "Unknown".to_string(),
            vendor: Vendor::Unknown,
            ci_env: EnvValue::AnyExists(vec![
                "CI".to_string(),
                "CONTINUOUS_INTEGRATION".to_string(),
                "BUILD_NUMBER".to_string(),
                "RUN_ID".to_string(),
            ]),
            pr_env: None,
            branch_name_env: None,
        },
    ]
}