-
-
Save cvvs/c5dfd8cc27a2a0b7f017bc21405c980e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'groovy' | |
apply plugin: 'maven' | |
apply plugin: 'idea' | |
ext { | |
jobDslVersion = '1.48' | |
jenkinsVersion = '1.658' | |
} | |
sourceSets { | |
jobs { | |
groovy { | |
srcDirs 'jobs' | |
} | |
} | |
} | |
repositories { | |
jcenter() | |
maven { | |
url 'https://repo.jenkins-ci.org/public/' | |
} | |
mavenCentral() | |
maven { url "https://jitpack.io" } | |
maven { url "http://repo.jenkins-ci.org/releases/" } | |
} | |
configurations { | |
testPlugins {} | |
jenkinsPlugins {} | |
} | |
dependencies { | |
compile 'org.codehaus.groovy:groovy-all:2.3.11' | |
testCompile('org.spockframework:spock-core:0.7-groovy-2.0') | |
{ | |
exclude module: 'groovy-all' | |
} | |
// Jenkins test harness dependencies | |
testCompile 'org.jenkins-ci.main:jenkins-test-harness:2.8' | |
testCompile "org.jenkins-ci.main:jenkins-war:${jenkinsVersion}" | |
testCompile "org.jenkins-ci.main:jenkins-war:${jenkinsVersion}:war-for-test@jar" | |
testCompile 'com.github.cfpb:jenkins-automation:-SNAPSHOT' | |
// Job DSL plugin including plugin dependencies | |
testCompile "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}" | |
testCompile "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}@jar" | |
testCompile 'org.jenkins-ci.plugins:structs:1.2@jar' | |
// Test Plugins | |
testPlugins 'org.jenkins-ci.plugins:slack:2.0.1' | |
} | |
task resolveTestPlugins(type: Copy) { | |
from configurations.testPlugins | |
into new File(sourceSets.test.output.resourcesDir, 'test-dependencies') | |
include '*.hpi' | |
include '*.jpi' | |
doLast { | |
def baseNames = source.collect { it.name[0..it.name.lastIndexOf('.')-1] } | |
new File(destinationDir, 'index').setText(baseNames.join('\n'), 'UTF-8') | |
} | |
} | |
test { | |
dependsOn tasks.resolveTestPlugins | |
inputs.files sourceSets.jobs.groovy.srcDirs | |
// set build directory for Jenkins test harness, JENKINS-26331 | |
systemProperty 'buildDirectory', project.buildDir.absolutePath | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment