Package: devpi-jenkins
devpi-jenkins: Jenkins build trigger for devpi-serverFor use with devpi-server >= 2.2.0.Installationdevpi-jenkinsneeds to be installed alongsidedevpi-server.You can install it with:pip install devpi-jenkinsFordevpi-serverthere is no configuration needed, as it will automatically discover the plugin through calling hooks using the setuptools entry points mechanism.Details about configuration below.Configurationdevpi-jenkins can trigger Jenkins to test uploaded packages usingtox.
This needs configuration on two sides:devpi: configuring an index to send POST requests to Jenkins upon uploadJenkins: adding one or more jobs which can get triggered by devpi-jenkins.Configuring a devpi index to trigger JenkinsHere is a example command, using a/testuser/devindex
and a Jenkins server athttp://localhost:8080:# needs one Jenkins job for each name of uploaded packages
devpi index /testuser/dev uploadtrigger_jenkins=http://localhost:8080/job/{pkgname}/buildAny package which gets uploaded to/testuser/devwill now trigger
a POST request to the specified url.  The{pkgname}and{pkgversion}strings will be substituted with the name of the
uploaded package.  You don’t need to specify such substitutions,
however, if you rather want to have one generic Jenkins job which
executes all tests for all your uploads:# one generic job for all uploaded packages
devpi index /testuser/dev uploadtrigger_jenkins=http://localhost:8080/job/multijob/buildThis requires a singlemultijobon the Jenkins side whereas the prior
configuration would require a job for each package name that you possibly
upload.Note that uploading a package will succeed independently if a build job could
be submitted successfully to Jenkins.Configuring Jenkins job(s)On the Jenkins side, you need to configure one or more jobs which can
be triggered by devpi-jenkins.  Each job is configured in the same way:go to main Jenkins screenhit “New Job” and enter a name (“multijob” if you want to configure
a generic job), then select “freey style software project”, hit OK.enable “This build is parametrized” and add a “File Parameter”,
setting the file location tojobscript.py.add a buildstep “Execute Python script” (you need to have the Python
plugin installed and enabled in Jenkins) and enterexecfile("jobscript.py").hit “Save” for the new build job.You can nowdevpi uploada package to an index and see Jenkins starting
after the upload successfully returns.Behind the scenesOnce you triggered a job from devpi, you can checkout thejobscript.pyin the Jenkins workspace to see what was injected.  The injected
script roughly follows these steps:retrieves a stable virtualenv release through the devpi root/pypi
index (i.e. use its caching ability)unpack the virtualenv tar ball and run the contained “virtualenv.py”
script to create a_devpienvironmentinstall/upgradedevpi-clientinto that environmentdevpi usethe index which we were triggered fromdevpi test PKGwhere PKG is the package name that we uploaded.Changelog3.0.0 - 2023-12-19Drop support for Python <= 3.6.
[fschulze]Fix for new pluggy version.
[fschulze]Remove unused import fromdevpibootstrap.py.template.
[fschulze]2.0.0 - 2016-04-25Drop support for Python 2.6
[fschulze]fixes for devpi-server 3.0.0, older versions aren’t supported anymore
[fschulze]1.0.0 - 2015-05-13include version in testspec fordevpi testcommand
[fschulze]separated into plugin from devpi-server
[fschulze (Florian Schulze)]