Skip to content

Instantly share code, notes, and snippets.

@jamesggraf
jamesggraf / installJJB.sh
Created March 17, 2015 20:45
Install Jenkins Job Builder
#!/usr/bin/env bash
git clone git@github.com:openstack-infra/jenkins-job-builder.git
cd jenkins-job-builder
python setup.py install
pip install pbr
@jamesggraf
jamesggraf / jenkins_jobs.ini
Created March 17, 2015 21:01
Configure Jenkins Job Builder
[job_builder]
ignore_cache=True
keep_descriptions=False
include_path=.
recursive=False
allow_duplicates=False
[jenkins]
user=YOUR_USER_NAME
password=YOUR_PASSWORD_OR_API_KEY
@jamesggraf
jamesggraf / hello_world.yml
Last active January 14, 2016 20:08
Example Hello World Jenkins Job Builder Definition
---
- job:
name: my_hello_world_job
parameters:
- string:
name: Message
default: Hello World
description: A message to echo
builders:
- shell: "echo $Message"
@jamesggraf
jamesggraf / jjb_execution.sh
Created March 17, 2015 21:10
Execute your jenkins job builder job
#!/usr/bin/env bash
sudo jenkins-jobs update hello_world.yml
@jamesggraf
jamesggraf / hello-world.dsl
Created April 6, 2015 15:25
Job DSL Hello World
job {
name 'hello-world'
steps {
shell('echo "Hello World!"')
}
}
//IMPORTANT NOTE!!!: Name this file "job-generation.dsl". Github's gist tool uses the file extension to establish syntax highlighting rules
@GrabResolver(name="repo.jenkins-ci.org",root='http://repo.jenkins-ci.org/public/')
@Grapes([
@Grab(group='org.kohsuke', module='github-api', version='1.59')
])
import static hudson.security.ACL.SYSTEM
import com.cloudbees.plugins.credentials.CredentialsProvider
@jamesggraf
jamesggraf / job-generator.yml
Created April 6, 2015 16:43
Jenkins Job Builder with Job DSL
---
- job:
name: job-generator
builders:
- dsl:
script-text:
!include-raw hello-world.dsl