forked from samrocketman/jenkins-bootstrap-shared
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins.gradle
52 lines (48 loc) · 1.31 KB
/
jenkins.gradle
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
task cleanJenkins(type: Delete) {
doFirst {
//stop jenkins just in case it's running
def stdout = new StringBuilder()
def stderr = new StringBuilder()
def process = ["${bootstrapHome}/scripts/provision_jenkins.sh", 'purge'].execute()
process.waitForProcessOutput(stdout, stderr)
println stdout.toString()
println stderr.toString()
}
delete '.gradle'
delete 'plugins'
delete 'jenkins.war.tmp'
delete 'jenkins.war.bak'
}
clean.dependsOn cleanJenkins
configurations {
getplugins {
description = 'Download Jenkins plugins .jpi files.'
transitive = false
}
getjenkins {
description = 'Download Jenkins WAR file.'
transitive = false
}
}
repositories {
maven {
name 'jenkins'
delegate.url('https://repo.jenkins-ci.org/public/')
}
mavenLocal()
}
//download and copy specific versions of plugins
task getplugins(type: Copy) {
into "${pluginsDest}/plugins"
from configurations.getplugins
include '*.hpi'
rename '(.*)-[.0-9]+.hpi$', '$1.jpi'
}
//download and copy a specific version of Jenkins
task getjenkins(type: Copy) {
//println configurations.getjenkins
into jenkinsDest
from configurations.getjenkins
include '*.war'
rename '.*', 'jenkins.war'
}