diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index dfa4318..c9a86f0 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Lint Code Base @@ -21,18 +21,21 @@ jobs: env: DEFAULT_BRANCH: main VALIDATE_GROOVY: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + test: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - run: git switch -C "testcontainers" - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: temurin + java-version: 17 - name: Cache Gradle packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.gradle/caches diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 2f3176f..bfd8bea 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -8,14 +8,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: temurin + java-version: 17 - name: Run Documentation with Gradle run: | diff --git a/build.gradle b/build.gradle index 5d69cf6..624251b 100644 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,8 @@ plugins { group 'de.tracetronic.jenkins' description 'This is a shared library to extend Jenkins pipelines and to keep code DRY.' -sourceCompatibility = 11 -targetCompatibility = 11 +sourceCompatibility = 17 +targetCompatibility = 17 sourceSets { main { @@ -36,31 +36,44 @@ sourceSets { } repositories { - jcenter() + mavenCentral() maven { - url 'https://repo.jenkins-ci.org/releases/' + url 'https://repo.jenkins-ci.org/public/' } } dependencies { - compile 'org.codehaus.groovy:groovy-all:2.5.6' - compile 'org.jenkins-ci.main:jenkins-core:2.361.4' - compile 'org.jenkins-ci.plugins.workflow:workflow-api:1208.v0cc7c6e0da_9e@jar' - compile 'org.jenkins-ci.plugins.workflow:workflow-support:839.v35e2736cfd5c@jar' - compile 'org.jenkins-ci.plugins.pipeline-stage-view:pipeline-rest-api:2.32@jar' - compile 'com.cloudbees:groovy-cps:3659.v582dc37621d8@jar' - - testCompile 'com.lesfurets:jenkins-pipeline-unit:1.16' - testCompile 'org.testcontainers:spock:1.15.3' - testCompile 'org.hamcrest:hamcrest-core:2.2@jar' - testCompile 'org.jenkins-ci.main:jenkins-war:2.361.4' - testCompile 'org.jenkins-ci.main:jenkins-test-harness:1954.v2e3fd5465b_a_6' - testCompile 'org.jenkins-ci.plugins:structs:324.va_f5d6774f3a_d@jar' - testCompile 'org.jenkins-ci.plugins.workflow:workflow-cps:3659.v582dc37621d8@jar' - testCompile 'org.jenkins-ci.plugins.workflow:workflow-job:1292.v27d8cc3e2602@jar' - testCompile 'org.jenkins-ci.plugins.workflow:workflow-step-api:639.v6eca_cd8c04a_a_@jar' - testCompile 'org.powermock:powermock-core:2.0.9' - testCompile 'org.spockframework:spock-core:1.3-groovy-2.5' + implementation 'org.codehaus.groovy:groovy-all:2.5.23' + implementation 'org.jenkins-ci.main:jenkins-core:2.426.3' + implementation 'org.jenkins-ci.plugins.workflow:workflow-api:1291.v51fd2a_625da_7@jar' + implementation 'org.jenkins-ci.plugins.workflow:workflow-support:839.v35e2736cfd5c@jar' + implementation 'org.jenkins-ci.plugins.pipeline-stage-view:pipeline-rest-api:2.34@jar' + implementation 'com.cloudbees:groovy-cps:3659.v582dc37621d8@jar' + + testImplementation 'com.lesfurets:jenkins-pipeline-unit:1.22' + testImplementation('org.testcontainers:spock:1.15.3'){ + exclude group: 'org.spockframework', module: 'spock-core' + } + testImplementation 'org.hamcrest:hamcrest-core:2.2@jar' + testImplementation 'org.jenkins-ci.main:jenkins-war:2.426.3' + testImplementation 'org.jenkins-ci.main:jenkins-test-harness:2112.ve584e0edc63b_' + testImplementation 'org.jenkins-ci.plugins:structs:337.v1b_04ea_4df7c8@jar' + testImplementation 'org.jenkins-ci.plugins.workflow:workflow-cps:3894.3896.vca_2c931e7935@jar' + testImplementation 'org.jenkins-ci.plugins.workflow:workflow-job:1385.vb_58b_86ea_fff1@jar' + testImplementation 'org.jenkins-ci.plugins.workflow:workflow-step-api:657.v03b_e8115821b_@jar' + testImplementation 'org.powermock:powermock-core:2.0.9' + testImplementation 'org.spockframework:spock-core:1.3-groovy-2.5' +} + +configurations.configureEach { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + if (details.requested.group == 'com.google.guava' && details.requested.name == 'guava') { + /* org.jenkins-ci.main:jenkins-core:2.426.3 use com.google.guava:guava:32.1.1-jre + * which has dependency issues https://github.com/google/guava/issues/6657 + */ + details.useVersion '33.2.0-jre' + } + } } test { @@ -99,6 +112,7 @@ task postGroovyDoc(type: Copy) { from "${project.docsDir}/groovydoc" into 'docs' filter { line -> line.replaceAll('DefaultPackage', 'vars') } + dependsOn groovydoc } task deleteOldDocs(type: Delete) { @@ -113,17 +127,17 @@ task documentation(type: GradleBuild) { idea { project { vcs = 'Git' - jdkName = '11' - languageLevel = '11' + jdkName = '17' + languageLevel = '17' } module { - jdkName = '11' - languageLevel = new IdeaLanguageLevel('11') + jdkName = '17' + languageLevel = new IdeaLanguageLevel('17') downloadJavadoc = true downloadSources = true } } wrapper { - gradleVersion = '6.8' + gradleVersion = '8.9' } diff --git a/docs/vars/cmd.html b/docs/vars/cmd.html index b3eaa25..50ba77c 100644 --- a/docs/vars/cmd.html +++ b/docs/vars/cmd.html @@ -163,11 +163,7 @@

Inherited Methods Summary

class groovy.lang.Script - groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#run(), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() - - - class groovy.lang.GroovyObjectSupport - groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() + groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#run(), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#wait(long), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() diff --git a/docs/vars/log.html b/docs/vars/log.html index a83fb54..6d550d3 100644 --- a/docs/vars/log.html +++ b/docs/vars/log.html @@ -205,11 +205,7 @@

Inherited Methods Summary

class groovy.lang.Script - groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#run(), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() - - - class groovy.lang.GroovyObjectSupport - groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() + groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#run(), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#wait(long), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() diff --git a/docs/vars/maven.html b/docs/vars/maven.html index 899f617..504f956 100644 --- a/docs/vars/maven.html +++ b/docs/vars/maven.html @@ -205,11 +205,7 @@

Inherited Methods Summary

class groovy.lang.Script - groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#run(), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() - - - class groovy.lang.GroovyObjectSupport - groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() + groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#run(), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#wait(long), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() diff --git a/docs/vars/pipeline2ATX.html b/docs/vars/pipeline2ATX.html index 649336d..c46456a 100644 --- a/docs/vars/pipeline2ATX.html +++ b/docs/vars/pipeline2ATX.html @@ -298,11 +298,7 @@

Inherited Methods Summary

class groovy.lang.Script - groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#run(), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() - - - class groovy.lang.GroovyObjectSupport - groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() + groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#run(), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#wait(long), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() diff --git a/docs/vars/task.html b/docs/vars/task.html index 3ec54d7..f2b1384 100644 --- a/docs/vars/task.html +++ b/docs/vars/task.html @@ -193,11 +193,7 @@

Inherited Methods Summary

class groovy.lang.Script - groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#run(), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() - - - class groovy.lang.GroovyObjectSupport - groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() + groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#run(), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#wait(long), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index da9702f..19cfad9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/test/groovy/testSupport/PipelineTestHelper.groovy b/test/groovy/testSupport/PipelineTestHelper.groovy index dc0627d..939e88b 100644 --- a/test/groovy/testSupport/PipelineTestHelper.groovy +++ b/test/groovy/testSupport/PipelineTestHelper.groovy @@ -246,7 +246,6 @@ class PipelineTestHelper extends BasePipelineTest { case 'always': case 'cleanup': return c.call() - break case 'changed': if (currentBuild.result != previousBuild.result) { return c.call() diff --git a/test/resources/vars/docker/Dockerfile b/test/resources/vars/docker/Dockerfile index b5c2d03..afdd520 100644 --- a/test/resources/vars/docker/Dockerfile +++ b/test/resources/vars/docker/Dockerfile @@ -1,6 +1,6 @@ -FROM maven:3.6.3-adoptopenjdk-8 as maven +FROM maven:3.9-eclipse-temurin-11 as maven -FROM jenkins/jenkinsfile-runner +FROM jenkins/jenkinsfile-runner:adoptopenjdk-11-hotspot # Setup Maven COPY --from=maven /usr/share/maven/ /usr/share/maven/ @@ -20,6 +20,6 @@ COPY .git /opt/git/jenkins-library/.git ENV JAVA_OPTS="-Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true" # Pre-install plugins -COPY plugins.txt /usr/share/jenkins/ref/plugins.txt +#COPY plugins.txt /usr/share/jenkins/ref/plugins.txt RUN cd /app/jenkins && jar -cvf jenkins.war * -RUN java -jar /app/bin/jenkins-plugin-manager.jar --war /app/jenkins/jenkins.war --plugin-file /usr/share/jenkins/ref/plugins.txt && rm /app/jenkins/jenkins.war +#RUN java -jar /app/bin/jenkins-plugin-manager.jar --war /app/jenkins/jenkins.war --plugin-file /usr/share/jenkins/ref/plugins.txt && rm /app/jenkins/jenkins.war diff --git a/test/vars/Pipeline2ATXTest.groovy b/test/vars/Pipeline2ATXTest.groovy index d392fcf..bed9e95 100644 --- a/test/vars/Pipeline2ATXTest.groovy +++ b/test/vars/Pipeline2ATXTest.groovy @@ -43,7 +43,8 @@ class Pipeline2ATXTest extends PipelineSpockTestBase { addEnvVar('TEST_LEVEL', 'Unit Test') when: 'collect the build attributes' - List attributes = pipeline2ATX.getBuildAttributes(build,['GIT_URL':'https://mycustomgit/blub','TOOL_NAME':'test.tool']) + List attributes = pipeline2ATX.getBuildAttributes(build, + ['GIT_URL':'https://mycustomgit/blub','TOOL_NAME':['test.tool', 'test.tool2', 42]]) then: 'expect a attributes list with build information' @@ -56,7 +57,7 @@ class Pipeline2ATXTest extends PipelineSpockTestBase { ['key':'JENKINS_URL', 'value':'https://testurl'], ['key':'JENKINS_WORKSPACE', 'value':'C:/ws/TestBuild/build42'], ['key':'TEST_LEVEL', 'value':'Unit Test'], - ['key':'TOOL_NAME', 'value':'test.tool']] + ['key':'TOOL_NAME', 'value': ['test.tool', 'test.tool2', '42']]] } def 'Collect build attributes - missing env vars'() { @@ -87,7 +88,8 @@ class Pipeline2ATXTest extends PipelineSpockTestBase { when: 'collect the build constants' - List constants = pipeline2ATX.getBuildConstants(build,['GIT_COMMIT':'customGitCommit','TOOL_NAME':'test.tool']) + List constants = pipeline2ATX.getBuildConstants(build, + ['GIT_COMMIT':'customGitCommit','TOOL_VERSION': ['1.2.3', 42]]) then: 'expect a attributes list with build information' result == constants @@ -98,7 +100,7 @@ class Pipeline2ATXTest extends PipelineSpockTestBase { ['key':'JENKINS_BUILD_ID', 'value':'42'], ['key':'JENKINS_EXECUTOR_NUMBER', 'value':'0815'], ['key':'JENKINS_NODE_NAME', 'value':'Runner0815'], - ['key':'TOOL_NAME', 'value':'test.tool']] + ['key':'TOOL_VERSION', 'value': ['1.2.3','42']]] } def 'Calculate metric times - error free and non pushed based build'() { diff --git a/vars/pipeline2ATX.groovy b/vars/pipeline2ATX.groovy index cbb5c69..f0f8eb9 100644 --- a/vars/pipeline2ATX.groovy +++ b/vars/pipeline2ATX.groovy @@ -126,7 +126,12 @@ def getBuildAttributes(build, customAttributes) { JENKINS_URL: build.getAbsoluteUrl(), JENKINS_WORKSPACE: env.WORKSPACE, TEST_LEVEL: env.TEST_LEVEL] + customAttributes - return attributes.findAll{k,v -> v}.collect{ k, v -> [key: k, value: v.toString()]} + return attributes.findAll{k,v -> v}.collect{ k, v -> + if (v instanceof List) { + return [key: k, value: v.collect{it.toString()}] + } + return [key: k, value: v.toString()] + } } /** @@ -150,7 +155,12 @@ def getBuildConstants(build, customConstants) { JENKINS_BUILD_ID: build.id, JENKINS_EXECUTOR_NUMBER: env.EXECUTOR_NUMBER, JENKINS_NODE_NAME: env.NODE_NAME] + customConstants - return constants.findAll{k,v -> v}.collect{ k, v -> [key: k, value: v.toString()]} + return constants.findAll{k,v -> v}.collect{ k, v -> + if (v instanceof List) { + return [key: k, value: v.collect{it.toString()}] + } + return [key: k, value: v.toString()] + } } /**