Skip to content

Commit 1394162

Browse files
author
R. Tyler Croy
authored
Merge pull request #275 from rtyler/jenkinsfile
Add a simple Jenkinsfile
2 parents aa03efb + 900fc4a commit 1394162

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

Jenkinsfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env groovy
2+
3+
node('docker') {
4+
stage 'Checkout source'
5+
checkout scm
6+
7+
stage 'Build and test'
8+
List<String> javas = ['7', '8']
9+
List<String> plugins = ['base', 'war', 'jar']
10+
Map parallelSteps = [:]
11+
12+
for (int j = 0; j < javas.size(); j++) {
13+
for (int i = 0; i < plugins.size(); i++) {
14+
def javaVersion = "${javas.get(j)}-jdk"
15+
def plugin = "jruby-gradle-${plugins.get(i)}-plugin"
16+
parallelSteps["${javaVersion}-${plugin}"] = {
17+
node('docker') {
18+
checkout scm
19+
try {
20+
docker.image("openjdk:${javaVersion}").inside {
21+
timeout(45) {
22+
sh "./gradlew -Si ${plugin}:check ${plugin}:gradleTest ${plugin}:assemble"
23+
}
24+
}
25+
}
26+
finally {
27+
junit '**/build/test-results/**/*.xml'
28+
archiveArtifacts artifacts: '**/build/libs/*.jar,build/*.zip', fingerprint: true
29+
}
30+
}
31+
}
32+
}
33+
}
34+
parallel(parallelSteps)
35+
}

jruby-gradle-base-plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ dependencies {
6565

6666
// NOTE: Leave this at .11 as it must be an older version. if
6767
// you change it here you will also need to update JRubyExecIntegrationSpec
68-
integrationTestGems "org.jruby:jruby-complete:1.7.11"
68+
integrationTestGems "org.jruby:jruby-complete:1.7.19"
6969

7070
// NOTE: older jruby versions needs this for exec to work properly
7171
integrationTestGems "rubygems:jar-dependencies:0.1.15"

jruby-gradle-base-plugin/src/integTest/groovy/com/github/jrubygradle/JRubyExecExtensionIntegrationSpec.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class JRubyExecExtensionIntegrationSpec extends Specification {
9393
}
9494

9595
then:
96-
outputBuffer == "[\"${new File(TEST_JARS_DIR, 'org/bouncycastle/bcprov-jdk15on/1.46/bcprov-jdk15on-1.46.jar').toURL()}\"]"
96+
def outputFile = new File(TEST_JARS_DIR, 'org/bouncycastle/bcprov-jdk15on/1.46/bcprov-jdk15on-1.46.jar')
97+
outputBuffer == "[\"${outputFile.toURI().toURL()}\"]"
9798
}
9899

99100
def "Running a script that requires a gem, a separate jRuby and a separate configuration"() {

jruby-gradle-base-plugin/src/integTest/groovy/com/github/jrubygradle/JRubyExecIntegrationSpec.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class JRubyExecIntegrationSpec extends Specification {
4444
given: "Version is set on the task"
4545
Configuration config
4646
final String configName = 'integ-exec-config'
47-
final String newVersion = '1.7.11'
47+
final String newVersion = '1.7.19'
4848
Pattern pattern = Pattern.compile(/.*(jruby-complete-.+.jar)/)
4949

5050
when:
@@ -160,7 +160,7 @@ class JRubyExecIntegrationSpec extends Specification {
160160

161161
def "Running a script that requires a gem, a separate JRuby and a separate configuration"() {
162162
given:
163-
final String newVersion = '1.7.11'
163+
final String newVersion = '1.7.19'
164164
assert project.jruby.execVersion != newVersion
165165
project.with {
166166
configurations.create('RubyWax')
@@ -191,7 +191,7 @@ class JRubyExecIntegrationSpec extends Specification {
191191
* least one version of JRuby installed
192192
*/
193193
jruby {
194-
execVersion '1.7.11'
194+
execVersion '1.7.19'
195195
defaultRepositories false
196196
}
197197

0 commit comments

Comments
 (0)