GithubHelp home page GithubHelp logo

jenkins-common's Introduction

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"))
        }
    }
}

jenkins-common's People

Contributors

marcingrzejszczak avatar snicoll avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.