-
Notifications
You must be signed in to change notification settings - Fork 1
/
cypress.groovy
82 lines (69 loc) · 2.77 KB
/
cypress.groovy
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
class JobConfig {
static final String JENKINS_CREDENTIALS_FOR_GITHUB = "chitsgithub"
static
def basicPipeline(job, repo, includeBranches = "master PR-*", ignoreOnPush = false, buildPR = true, jenkinsfilePath = "Jenkinsfile", interval = 0) {
job.with {
configure {
it / factory(class: 'org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory') {
owner(class: 'org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject', reference: '../..')
scriptPath(jenkinsfilePath)
}
it / sources(class: 'jenkins.branch.MultiBranchProject$BranchSourceList') / 'data' / "jenkins.branch.BranchSource" {
source(class: "org.jenkinsci.plugins.github_branch_source.GitHubSCMSource") {
id(UUID.randomUUID())
credentialsId(JENKINS_CREDENTIALS_FOR_GITHUB)
repoOwner('chit787')
repository(repo)
ignoreOnPushNotifications(false)
traits {
'org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait' {
strategyId('1')
}
if (buildPR) {
'org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait' {
strategyId('1')
}
}
'jenkins.scm.impl.trait.WildcardSCMHeadFilterTrait' {
includes(includeBranches)
excludes()
}
'org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait' {
credentialsId(JENKINS_CREDENTIALS_FOR_GITHUB)
}
'jenkins.plugins.git.traits.CloneOptionTrait' {
extension(class: "hudson.plugins.git.extensions.impl.CloneOption") {
shallow("false")
noTags("false")
depth("0")
honorRefspec("false")
}
}
if (ignoreOnPush) {
'jenkins.plugins.git.traits.IgnoreOnPushNotificationTrait'()
}
}
}
strategy(class: "jenkins.branch.DefaultBranchPropertyStrategy") {
properties(class: "empty-list")
}
}
}
orphanedItemStrategy {
discardOldItems {
daysToKeep(1)
}
}
triggers {
if (interval > 0) {
periodic(interval)
}
}
}
}
}
folder('Cypress Development')
def cypressPipeline = multibranchPipelineJob('Cypress Development/cypress Pipeline')
JobConfig.basicPipeline(cypressPipeline, repo = "cypress", includeBranches="master PR-*")
def cypressPipeline2 = multibranchPipelineJob('Cypress Development/cypress Pipeline FR')
JobConfig.basicPipeline(cypressPipeline2, repo = "cypress", includeBranches="master PR-*")