-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.groovy
52 lines (39 loc) · 874 Bytes
/
ci.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
#!groovy
// Load all the jobs for each branch case.
// Important note: to keep the project structure, all those files must have the same methods
load 'job/job.groovy'
masterJob = load 'job/masterJob.groovy'
developJob = load 'job/developJob.groovy'
aux = load 'job/aux.groovy'
/**
* Function called from Jenkinsfile to start the Job
*/
void start() {
try {
init()
} catch (ex) {
throw ex
} finally {
echo "Job Ended"
}
}
def init() {
// ENV parameters
def targetBranchName = env.TARGET_BRANCH
def job = getJob(targetBranchName)
echo job.testDad()
echo job.test()
}
def getJob(branch) {
def job
switch (branch) {
case ~/master$/:
job = masterJob
break
case ~/develop$/:
job = developJob
break
}
return job
}
return this