File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed
Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change 1+ jenkins.model.Jenkins . theInstance. getProjects(). each { job ->
2+ if (! job. name. contains(' bootstrap' ) && ! job. name. contains(' Jenkins' )) {
3+ job. delete()
4+ }
5+ }
6+
7+ job(' job-dsl-checkout' ) {
8+
9+ scm {
10+ github(' Sonal0409/DevOpsClassCodes' , ' master' )
11+ }
12+
13+ publishers {
14+ downstream ' job-dsl-compile' , ' SUCCESS'
15+ }
16+
17+ }
18+
19+ mavenJob(' job-dsl-compile' ){
20+
21+ customWorkspace(' /var/lib/jenkins/workspace/job-dsl-checkout' )
22+ mavenInstallation(' Maven 3.3.9' )
23+ goals(' compile' )
24+
25+ publishers {
26+ downstream ' job-dsl-package' , ' SUCCESS'
27+ }
28+ }
29+
30+ mavenJob(' job-dsl-package' ){
31+ customWorkspace(' /var/lib/jenkins/workspace/job-dsl-checkout' )
32+ mavenInstallation(' Maven 3.3.9' )
33+ goals(' package' )
34+
35+ publishers {
36+ downstream ' job-dsl-deploy' , ' SUCCESS'
37+ }
38+ }
39+
40+ job(' job-dsl-deploy' ) {
41+ description ' Deploy app to the demo server'
42+
43+ steps{
44+ shell ' sshpass -p "123456" scp /var/lib/jenkins/workspace/job-dsl-checkout/target/addressbook.war release@10.12.108.11:/opt/tomcat/webapps/'
45+ }
46+ }
47+
48+ listView(' List View DSLs' ) {
49+ jobs {
50+ regex(' job-dsl-.+' )
51+ }
52+ columns {
53+ status()
54+ name()
55+ lastSuccess()
56+ lastFailure()
57+ lastDuration()
58+ buildButton()
59+ }
60+ }
61+
62+ deliveryPipelineView(' job-dsl delivery pipeline' ) {
63+ showAggregatedPipeline true
64+ enableManualTriggers true
65+ pipelineInstances 5
66+ pipelines {
67+ component(' job-dsl delivery pipeline' , ' job-dsl-checkout' )
68+ }
69+ }
You can’t perform that action at this time.
0 commit comments