Skip to main content

Define Jenkins jobs from repository

Project description

CI Status Version on PyPI

Define jobs from project

Render Jenkins job and execute commands from jenkins.yml. These two steps are completely independant.

jenkins_yml provide a python API to render a Jenkins job XML config from a YAML payload. It does not manage Jenkins I/O to effectively create the job. See Jenkins EPO to create jobs and schedule builds from GitHub.

Finally, jenkins_yml provide a simple yet pluggable CLI script to executes de tests commands from jenkins.yml.

Jenkins Job features

The purpose of Jenkins YML is not to expose all Jenkins features, but to setup a sane default set of features you expect from a CI, and ask you the question you value.

  • Define parameters and default values.

  • Define matrix job axis.

  • Define periodic job.

  • Target Jenkins node per build.

  • Search git clone reference in /var/lib/jenkins/references/<owner>/<repository>/. It’s up to you to create a mirror clone here or not.

  • Set GitHub commit status to pending.

  • Parameterized revision.

  • Define after_script, always runned after build, even on abort.

  • Collect arctefacts from _ci/ directory. Full path is available in CI_ARTEFACTS env var.

  • Reads XUnit XML from _ci/xunit*.xml.

  • Reads coverage report from coverage.xml.

  • Globally disable jobs from Jenkins.

Setup

On your Jenkins executor, pip3 install jenkins-yml and then use jenkins-yml-runner as shell command.

jenkins.yml format

Put a jenkins.yml file at the root of the project. This file contains a mapping of JOB_NAME to scripts. For example:

app-lint: |
  flake8 app/

app-tests:
  axis:
    TOXENV: [py27, py34, py35]
  script: |
    tox -r

app-doc:
  script: |
    tox -e sphinx -r

To test a job, simply run:

JOB_NAME=app-test jenkins-yml-runner

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jenkins-yml-2.27.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

jenkins_yml-2.27-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file jenkins-yml-2.27.tar.gz.

File metadata

  • Download URL: jenkins-yml-2.27.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jenkins-yml-2.27.tar.gz
Algorithm Hash digest
SHA256 d51235c2421de8fc67cff0ad14afa3b9a7667f2d805e94054bdccd91b4668186
MD5 532c51dc9624a754983eb02bab88625c
BLAKE2b-256 d8d7e4f48b81e334d5023e90c1afe27728a94b3f91b6671f2a8bf74987324c31

See more details on using hashes here.

Provenance

File details

Details for the file jenkins_yml-2.27-py3-none-any.whl.

File metadata

File hashes

Hashes for jenkins_yml-2.27-py3-none-any.whl
Algorithm Hash digest
SHA256 abae014555bb1dfba1afeccf7487821c4042c8b47eeccb5147fa61d43ddf68d2
MD5 ffa0d1d1bb8d0974a3d445bc72090801
BLAKE2b-256 e7fd4095c44a778ce8700e34917fb16a2797aa689882507cfc981852163392fa

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page