salt.modules.jenkins module

Module for controlling Jenkins

2016.3.0 新版功能.

configuration:

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
salt.modules.jenkins.build_job(name=None, parameters=None)

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
salt.modules.jenkins.create_job(name=None, config_xml=None, saltenv='base')

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'
salt.modules.jenkins.delete_job(name=None)

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
salt.modules.jenkins.disable_job(name=None)

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
salt.modules.jenkins.enable_job(name=None)

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
salt.modules.jenkins.get_job_config(name=None)

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
salt.modules.jenkins.get_job_info(name=None)

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
salt.modules.jenkins.get_jobs()

Return the currently configured jobs.

返回:The currently configured jobs.

CLI Example:

salt '*' jenkins.get_jobs
salt.modules.jenkins.get_version()

Return version of Jenkins

返回:The version of Jenkins

CLI Example:

salt '*' jenkins.get_version
salt.modules.jenkins.job_exists(name=None)

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
salt.modules.jenkins.job_status(name=None)

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
salt.modules.jenkins.update_job(name=None, config_xml=None, saltenv='base')

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'