module jenkinshelper.jenkins_helper
¶
Short summary¶
module pyquickhelper.jenkinshelper.jenkins_helper
Helpers to prepare a local Jenkins server.
Functions¶
function |
truncated documentation |
---|---|
Returns a dictionary with default values for Jenkins server, you should update the path if the proposed path are not … |
|
Example of a list of jobs for parameter module of function |
|
Returns platform if not None, |
|
Postprocesses a job produced by Jenkins. |
|
Sets up many jobs on Jenkins. |
Documentation¶
Helpers to prepare a local Jenkins server.
- pyquickhelper.jenkinshelper.jenkins_helper.default_engines(platform=None)[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', 'Python39': '/usr/local/python39', 'Python38': '/usr/local/python38', 'Python37': '/usr/local/python37', 'Python36': '/usr/local/python36', 'WinPython39': 'ERROR', 'WinPython38': 'ERROR', 'WinPython37': 'ERROR'}
- pyquickhelper.jenkinshelper.jenkins_helper.default_jenkins_jobs(platform=None, github_owner='sdpython', module_name='pyquickhelper')[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')]
- pyquickhelper.jenkinshelper.jenkins_helper.get_platform(platform=None)[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
- pyquickhelper.jenkinshelper.jenkins_helper.jenkins_final_postprocessing(xml_job, py27)[source]¶
Postprocesses a job produced by Jenkins.
- 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]¶
Sets up many jobs on Jenkins.
- Parameters:
js –
JenkinsExt
, jenkins servergithub – 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.