Giter Club home page Giter Club logo

jenkinsxml2jobdsl's Introduction

Jenkins XML to Job DSL converter

Converts a Jenkins job's config.xml to Job DSL

Table of Contents

What is it?

This is a tool for converting a Jenkins job's config.xml to a Job DSL script

Prerequisites

The only thing you should need to get up and running with this is a valid JDK installation

Building

You can build the jar as follows:

git clone https://github.com/fergalgribben/jenkinsxml2jobdsl
cd jenkinsxml2jobdsl
./gradlew build

Running

Run the jar with the following command:

java -jar build/libs/jenkinsxml2jobdsl.jar -u <jenkins username> -a <jenkins api token> -j <jenkins server> -p <jenkins port> job1 job2 ... jobN

The converter will write the converted Job DSL scripts to the jobs/ directory

Configuration

The following command line flags are supported:

flag description
-u The username to use when connecting to the Jenkins instance
-a The API token to use when connecting to the Jenkins instance, accessible via <jenkins url>/user/<username>/configure
-j The URL of the Jenkins instance to connect to, e.g. myjenkins.myhost.com
-p The port on which the Jenkins instance is listening, defaults to 8080

The converter accepts a list of space-delimited job names as they are displayed under the "Project name" field of the job configuration page in Jenkins

Publishing

On the Jenkins instance you want to deploy the Job DSL scripts against, you need to have the Job DSL plugin installed, and a seed job created

With a seed job created, configure the job, and navigate to the build actions section of the configuration. Add the "Process Job DSLs" build step, and either paste in a generated Job DSL script, or use the file browser to point to a file on disk

Save the configuration, and then run the seed job. The Job DSL plugin will create a new Jenkins job, which will appear on the Jenkins home page.

jenkinsxml2jobdsl's People

Watchers

James Cloos 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.