Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.mvn/wrapper Initial commit Jun 6, 2017
src/main Openjdk12 May 14, 2019
.gitignore Initial commit Jun 6, 2017
.settings.xml Initial commit Jun 6, 2017
LICENSE Initial commit Jun 6, 2017
README.adoc Updated docs Jun 6, 2017
circle.yml Initial commit Jun 6, 2017
mvnw Initial commit Jun 6, 2017
mvnw.cmd Initial commit Jun 6, 2017
pom.xml Going back to snapshots May 14, 2019

README.adoc

Common Jenkins DSL

The repository contains common building blocks for jobs that use Jenkins Job DSL in the Spring projects.

How to build it

./mvnw clean install

How to use it in Jenkins?

It’s more than probable that you’ll be using a Gradle to build your scripts. It’s enough for you to set the following values in your buildscript.

apply plugin: 'groovy'

repositories {
	// for jenkins-common
	maven { url "http://repo.spring.io/snapshot" }
	maven { url "http://repo.spring.io/milestone" }
	maven { url "http://repo.spring.io/release" }
	// for jenkins-job-dsl plugin
	maven { url 'http://repo.jenkins-ci.org/releases/' }
}

configurations {
	libs
	compile.extendsFrom libs
}

dependencies {
	libs "org.springframework.internal:jenkins-common:${jenkinsCommonVersion}"
}

task libs(type: Copy) {
	into 'build/lib'
	from configurations.libs
}

build.dependsOn libs

We will be uploading the library artifacts to the repo.spring.io so we need to add it to the list of repos.

That way you’ll use the jenkins-common as a compile dependency but also it will get unpacked to build/lib folder.

Important
Remember to pass the build/lib/*.jar as additional classpath element of your seed job

Example:

job('spring-cloud-seed') {
    triggers {
        githubPush()
    }
    scm {
        git {
            remote {
                github('spring-io/build-scripts')
            }
            branch('master')
        }
    }
    steps {
        gradle("clean build")
        dsl {
            external('jobs/springcloud/*.groovy')
            removeAction('DISABLE')
            removeViewAction('DELETE')
            ignoreExisting(false)
            additionalClasspath([
                    'src/main/groovy', 'src/main/resources', 'build/lib/*.jar'
            ].join("\n"))
        }
    }
}
You can’t perform that action at this time.