-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjobs
84 lines (67 loc) · 2.02 KB
/
jobs
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
job('job_dsl_example'){
description('This is an example job created using DSL')
parameters{
stringParam('Param1', defaultValue='One', description='This is first parameter')
choiceParam('Param2', ['Option 1', 'Option 2'])
booleanParam('FLAG', true)
}
scm {
git('https://github.com/mav3n/simple-java-maven-app', 'master')
}
// triggers {
// cron('H 5 * * 7')
// }
steps {
shell("echo 'Hello World'")
shell("echo 'Running Job'")
}
publishers {
mailer('jenkins-test@mailinator.com', true, true)
}
}
job('ansible-users-db-dsl') {
description('This updates the User Table (on jenkins.local:80) with the specified age')
parameters {
choiceParam('AGE', ['20', '21', '22','23','24','25', '26','27','28','29','30','31','32','33','34','35'])
}
wrappers {
colorizeOutput(colorMap = 'xterm')
}
steps {
ansiblePlaybook('/var/jenkins_home/ansible/people.yml') {
inventoryPath('/var/jenkins_home/ansible/hosts')
colorizedOutput(true)
extraVars {
extraVar("PEOPLE_AGE", '${AGE}', false)
}
}
}
}
job('maven_job_dsl') {
description('Maven DSL Job')
scm {
git('https://github.com/mav3n/simple-java-maven-app.git', 'master', {node -> node / 'extensions' << '' })
}
triggers {
githubPush()
}
steps {
maven {
mavenInstallation('jenkins-maven')
goals('-B -DskipTests clean package')
}
maven {
mavenInstallation('jenkins-maven')
goals('test')
}
shell('''
echo ************RUNNING THE JAR************************
java -jar /var/jenkins_home/workspace/maven_job_dsl/target/my-app-1.0-SNAPSHOT.jar
''')
}
publishers {
archiveArtifacts('target/*.jar')
archiveJunit('target/surefire-reports/*.xml')
mailer('jenkins-test@mailinator.com', true, true)
}
}