Skip to content

Commit

Permalink
Updated the README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewharmellaw committed Mar 11, 2013
1 parent 1719d40 commit 20cc0d9
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Jenkins Job DSL / Plugin
========================

The Jenkins "Job DSL / Plugin" is made up of two parts: The Domain Specific Language (DSL) that allows users to
The Jenkins "Job DSL / Plugin" is made up of two parts: The Domain Specific Language (DSL) itself that allows users to
describe Jobs using in a groovy-based language, and a Jenkins Plugin which manages the scripts and the updating of the
Jenkins jobs which are created and maintained as a result.

Expand All @@ -13,15 +13,16 @@ the common pattern in this situation is to copy jobs to create new ones, these "
diverging from their original "template" and consequently it becomes difficult to maintain consistency between these jobs.

The Jenkins job-dsl-plugin attempts to solve this problem by allowing jobs to be defined with the absolute minimum
necessary in a programmatic form, with the help of templates that are synced with the generated jobs. The goal is for
your project to be able to define all the jobs they want to be related to their project, delcaring their intent for the
jobs, leaving the common stuff up to a template that were defined earlier or hidden behind the DSL.
effort in a programmatic form, with help from templates that are then synced with the resulting generated jobs. The goal
is for your team to be able to define all the jobs they wish to be related to their project, declaring their intent
for the jobs programatically, and leaving the common elements in each of then up to a template that was defined earlier
(or hidden behind the DSL).

For example, a project might want a unit test job, a nightly sonar build, a integration test job, and a promotion job.
In this stituation, we have a job named TMPL-test that has a majority of a setup already defined (Chuck Norris plugin,
email plugin, etc). We'll reuse that job for the test-based jobs, using the "using" DSL command. The template doesn't
have our specific SCM settings, and we want to re-use the same one, so we'll define it in a variable called "gitUrl".
We'll also limit whom can run the release job.
For example, your project might require a unit test job, a nightly sonar build, a integration test job, and a promotion
job. In this situation, we have a job named TMPL-test that has a majority of the (common) setup already defined (e.g.
the Chuck Norris plugin, email plugin, etc). We then reuse that template job for the test-based jobs, via the "using"
DSL command. Note that the template doesn't have our specific SCM settings, and we want to re-use the same one, so we'll
define it in a variable called "gitUrl". We'll also limit whom can run the release job. Here's the example DSL script:

```groovy
def gitUrl = 'git://github.com/jenkinsci/job-dsl-plugin.git'
Expand Down Expand Up @@ -115,16 +116,16 @@ See the wiki for specific steps and other examples.

1. Create your set of Jenkins jobs which will serve as the templates (It is a good idea to use a naming convention for
these jobs which clearly indicates that these are templates)
2. Create a Jenkins Job using the Free-style project style to run your DSL Scripts. This is called a "Seed" job.
3. Configure the seed job, by adding a "Build Step" of type "Process Job DSLs" and paste in the body of the DSL.
4. Run the seed to generate your new jobs from your script. When successful, and the "build result" page will
list the jobs which have been successfully created.
2. Create a Jenkins Job using the Free-style project style to run your DSL Scripts. This is called a "Seed" job
3. Configure the seed job, by adding a "Build Step" of type "Process Job DSLs" and paste in the body of the DSL
4. Run the seed to generate your new jobs from your script. When successful, the "build result" page will list the jobs
which have been successfully created
5. Finally, it is good practice to organise your Jenkins UI with some new tabs so that the management and template
jobs are not the first thing a user sees when they login

Building
--------
To build:
To build the plugin from source:

./gradlew build

Expand Down

0 comments on commit 20cc0d9

Please sign in to comment.