Module for controlling Jenkins
python-jenkins
New in version 2016.3.0.
python-jenkins Python module (not to be confused with jenkins)
This module can be used by either passing an api key and version directly or by specifying both in a configuration profile in the salt master/minion config.
For example:
jenkins:
api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15
Initiate a build for the provided job.
name -- The name of the job is check if it exists.
parameters -- Parameters to send to the job.
True is successful, otherwise raise an exception.
CLI Example:
salt '*' jenkins.build_job jobname
Return the configuration file.
name -- The name of the job is check if it exists.
config_xml -- The configuration file to use to create the job.
saltenv -- The environment to look for the file in.
The configuration file used for the job.
CLI Example:
salt '*' jenkins.create_job jobname
salt '*' jenkins.create_job jobname config_xml='salt://jenkins/config.xml'
Return true is job is deleted successfully.
name -- The name of the job to delete.
Return true if job is deleted successfully.
CLI Example:
salt '*' jenkins.delete_job jobname
Return true is job is disabled successfully.
name -- The name of the job to disable.
Return true if job is disabled successfully.
CLI Example:
salt '*' jenkins.disable_job jobname
Return true is job is enabled successfully.
name -- The name of the job to enable.
Return true if job is enabled successfully.
CLI Example:
salt '*' jenkins.enable_job jobname
Return the current job configuration for the provided job.
name -- The name of the job to return the configuration for.
The configuration for the job specified.
CLI Example:
salt '*' jenkins.get_job_config jobname
Return information about the Jenkins job.
name -- The name of the job is check if it exists.
Information about the Jenkins job.
CLI Example:
salt '*' jenkins.get_job_info jobname
Return the currently configured jobs.
The currently configured jobs.
CLI Example:
salt '*' jenkins.get_jobs
Return version of Jenkins
The version of Jenkins
CLI Example:
salt '*' jenkins.get_version
Check whether the job exists in configured Jenkins jobs.
name -- The name of the job is check if it exists.
True if job exists, False if job does not exist.
CLI Example:
salt '*' jenkins.job_exists jobname
Return the current status, enabled or disabled, of the job.
name -- The name of the job to return status for
Return true if enabled or false if disabled.
CLI Example:
salt '*' jenkins.job_status jobname
New in version 2016.11.0.
Return if the plugin is installed for the provided plugin name.
name -- The name of the parameter to confirm installation.
True if plugin exists, False if plugin does not exist.
CLI Example:
salt '*' jenkins.plugin_installed pluginName
New in version 2017.7.0.
Execute a script on the jenkins master
script -- The script
CLI Example:
salt '*' jenkins.run 'Jenkins.instance.doSafeRestart()'
Return the updated configuration file.
name -- The name of the job is check if it exists.
config_xml -- The configuration file to use to create the job.
saltenv -- The environment to look for the file in.
The configuration file used for the job.
CLI Example:
salt '*' jenkins.update_job jobname
salt '*' jenkins.update_job jobname config_xml='salt://jenkins/config.xml'