module jenkinshelper.jenkins_helper

Short summary

module pyquickhelper.jenkinshelper.jenkins_helper

Helpers to prepare a local Jenkins server.

source on GitHub

Functions

function

truncated documentation

default_engines

Returns a dictionary with default values for Jenkins server, you should update the path if the proposed path are not …

default_jenkins_jobs

Example of a list of jobs for parameter module of function setup_jenkins_server_yml().

get_platform

Returns platform if not None, sys.platform otherwise.

jenkins_final_postprocessing

Postprocesses a job produced by Jenkins.

setup_jenkins_server_yml

Sets up many jobs on Jenkins.

Documentation

Helpers to prepare a local Jenkins server.

source on GitHub

pyquickhelper.jenkinshelper.jenkins_helper.default_engines(platform=None)[source][source]

Returns a dictionary with default values for Jenkins server, you should update the path if the proposed path are not good.

Parameters

platform – default values for which OS or get_platform(platform).

Returns

dictionary

Warning

Virtual environment with conda must be created on the same disk as the original interpreter. The other scenario is not supported by Anaconda.

It returns:

    {'Anaconda3': '/usr/local/miniconda3', 'Python37': '/usr/local/python37', 'Python36': '/usr/local/python36'}

source on GitHub

pyquickhelper.jenkinshelper.jenkins_helper.default_jenkins_jobs(platform=None, github_owner='sdpython', module_name='pyquickhelper')[source][source]

Example of a list of jobs for parameter module of function setup_jenkins_server_yml.

Parameters
  • platform – platform

  • github_owner – GitHub user

  • module_name – module name or list of modules names

Returns

tuple

It returns:

    [('yml', 'https://raw.githubusercontent.com/sdpython/pyquickhelper/master/.local.jenkins.lin.yml', 'H H(5-6) * * 0')]

source on GitHub

pyquickhelper.jenkinshelper.jenkins_helper.get_platform(platform=None)[source][source]

Returns platform if not None, sys.platform otherwise.

Parameters

platform – default values for which OS or sys.platform.

Returns

platform

This documentation was generated with a machine using the following OS (among the possible values).

<<<

from pyquickhelper.jenkinshelper.jenkins_helper import get_platform
print(get_platform())

>>>

    linux

New in version 1.8.

source on GitHub

pyquickhelper.jenkinshelper.jenkins_helper.jenkins_final_postprocessing(xml_job, py27)[source][source]

Postprocesses a job produced by Jenkins.

Parameters
  • xml_jobxml definition

  • py27 – is it for Python 27

Returns

new xml job

source on GitHub

pyquickhelper.jenkinshelper.jenkins_helper.setup_jenkins_server_yml(js, github='sdpython', modules=None, overwrite=False, location=None, prefix='', delete_first=False, disable_schedule=False, fLOG=<function noLOG>, **kwargs)[source][source]

Sets up many jobs on Jenkins.

Parameters
  • jsJenkinsExt, jenkins server

  • github – github account if it does not start with http://, the link to git repository of the project otherwise, we assume the job comes from the same repository, otherwise the function will have to called several times

  • modules – modules for which to generate the Jenkins job (see default_jenkins_jobs)

  • overwrite – do not create the job if it already exists

  • location – None for default or a local folder

  • prefix – add a prefix to the name

  • delete_first – removes all jobs before adding new ones

  • disable_schedule – disable scheduling for all jobs

  • fLOG – logging function

  • kwargs – see method setup_jenkins_server

Returns

list of created jobs

Example:

from pyquickhelper.jenkinshelper import JenkinsExt, setup_jenkins_server_yml, default_jenkins_jobs, default_engines

user = "<user>"
password = "<password>"
modules = default_jenkins_jobs()
engines = default_engines()
js = JenkinsExt('http://localhost:8080/', user, password, engines=engines)
setup_jenkins_server_yml(js, github="sdpython", modules=modules, fLOG=print,
                         overwrite=True, delete_first=False,
                         location="d:\\jenkins\\pymy")

See .local.jenkins.win.yml (Windows) or .local.jenkins.lin.yml (Linux) about the syntax of a yml job description. If modules is None, it is replaced by the results of default_jenkins_jobs. The platform is stored in srv.

source on GitHub