0.0
No commit activity in last 3 years
No release in over 3 years
A CLI tool for managing Jenkins job configurations
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.14.1
~> 1.10
~> 0.10.1
~> 0.8.0
~> 10.0
~> 3.3
~> 0.42.0
~> 0.12.0

Runtime

~> 1.6
~> 1.6
~> 0.19.1
 Project Readme

leeroy_jenkins

Gem

Description

A CLI tool for managing Jenkins job configurations: bulk update, backup, and restore your Jenkins job configurations

Installation

Add this line to your application's Gemfile:

gem 'leeroy_jenkins'

And then execute:

$ bundle

Or install it yourself as:

$ gem install leeroy_jenkins

Usage

Set your LEEROY_JENKINS_USERNAME, LEEROY_JENKINS_PASSWORD, and LEEROY_JENKINS_SERVER_URL environment variables appropriately for your Jenkins. These can also be overridden with command line options. Run leeroy --help to see the available sub-commands and options:

$ leeroy --help
Commands:
  leeroy append NEW_NODE.xml      # Append to XML nodes in jenkins jobs' config.xml
  leeroy backup BACKUP_DIR_PATH   # Save the config.xml of Jenkins jobs to disk, BACKUP_DIR created if it does not exist
  leeroy delete                   # Delete XML nodes in jenkins jobs' config.xml
  leeroy help [COMMAND]           # Describe available commands or one specific command
  leeroy replace NEW_NODE.xml     # Replace XML nodes in jenkins jobs' config.xml
  leeroy restore BACKUP_DIR_PATH  # Restore config.xml files to Jenkins jobs from backups

Options:
  [--dry-run], [--no-dry-run]                    # Show what leeroy would do, without doing it
                                                 # Default: true
  [--jenkins-log-level=N]                        # Detail of the messages logged by the Jenkins API client: DEBUG (0), INFO (1), WARN (2), FATAL (3)
                                                 # Default: 3
                                                 # Possible values: 0, 1, 2, 3
  [--jenkins-log-location=JENKINS_LOG_LOCATION]  # Path to write messages logged by the Jenkins API client
                                                 # Default: /dev/stdout
  [--job-regex=JOB_REGEX]                        # Regular expression to select jobs by name
                                                 # Default: .*
  [--jobs=JOBS]                                  # Path to a file containing a job name on each line
  [--password=PASSWORD]                          # Override LEEROY_JENKINS_PASSWORD
  [--server-url=SERVER_URL]                      # Override LEEROY_JENKINS_SERVER_URL
  [--threads=N]                                  # Number of threads to use for network and disk IO
                                                 # Default: 4
  [--username=USERNAME]                          # Override LEEROY_JENKINS_USERNAME

For more specific examples and documentation of features, take a look in the features directory (the fixtures referenced there are here):

Development

After checking out the repo, run bundle install to install dependencies. Then, run bundle exec rake rspec to run the unit tests. Run bundle exec rake rubocop to lint. You can also run bundle exec bin/console to launch a pry session with all code and dependencies loaded. Run bundle exec exe/leeroy to use the gem in this directory, ignoring other installed copies of this gem.

To run the acceptance tests, run vagrant up to start your own Jenkins instance. This may take 5-10 minutes, but when finished you'll be able to access Jenkins at 192.168.50.33:8080 in your web browser. Then run bundle exec rake cucumber. bundle exec rake verify will lint, run unit tests, and run acceptance tests. This is also the default rake task.