Job groups are a great tool to configure categories of jobs together at the same time. Below the example are some starting point job-groups but we recommend creating your own to ensure that the jobs configured reflect the project’s needs.
An example project:
- job-group:
name: odl-maven-jobs
jobs:
- gerrit-maven-clm
- gerrit-maven-merge
- gerrit-maven-release
- gerrit-maven-verify
- gerrit-maven-verify-dependencies:
build-timeout: 180
mvn-version: mvn35
- project:
name: aaa
jobs:
- odl-maven-jobs
In this example we are using the job-group to assign a list of common jobs to
the aaa project. The job-group also hardcodes mvn-version
to mvn35 and
build-timeout
to 180 for all projects using this job-group.
A benefit of this method is for example disabling entire category of jobs by
modifying the job-group, insert disable-job: true
parameter
against the jobs to disable.
Below is a list of Maven job groups:
---
- job-group:
name: '{project-name}-python-jobs'
# This job group contains all the recommended jobs that should be deployed
# for any project ci that is using Gerrit.
jobs:
- gerrit-python-xc-clm
- gerrit-tox-verify
- job-group:
name: '{project-name}-github-python-jobs'
# This job group contains all the recommended jobs that should be deployed
# for any project ci that is using GitHub.
jobs:
- github-python-xc-clm
- github-tox-verify
Run CLM scanning against a Python project.
Required Parameters: | |||||
---|---|---|---|---|---|
|
Install Tox into a virtualenv.
Required Parameters: | |||
---|---|---|---|
|
Runs Sonar scanning against a Python project.
Required Parameters: | |||||
---|---|---|---|---|---|
|
Runs a shell script that installs tox in a Python virtualenv.
Required Parameters: | |||
---|---|---|---|
|
CLM scans for Python based repos. This job will call the Nexus IQ CLI directly to run the scans.
A new credential named “nexus-iq-xc-clm” needs to exist in the Jenkins credentials. The credential should contain the username and password to access Nexus IQ Server.
Template Names: |
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Comment Trigger: | |||||||||||||||||||||||||||||||||||||
run-clm |
|||||||||||||||||||||||||||||||||||||
Required parameters: | |||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||
Optional parameters: | |||||||||||||||||||||||||||||||||||||
|
Sonar scans for Python based repos. This job will perform a tox call which runs the coverage command to gather tests results. These test results get published back into Sonar after running the Sonar goals.
To get the Sonar coverage results, tox.ini needs to exist and configured with coverage commands to run.
The coverage commands define the code that gets executed by the test suites. It does not guarantee that the code tests executed properly, but it will help pointing out the code that is not tested at all.
For example:
[testenv:py27]
commands =
coverage run --module pytest --junitxml xunit-results.xml
coverage xml --omit=".tox/py27/*","tests/*"
coverage report --omit=".tox/py27/*","tests/*"
For more details refer to coverage and sonar documentation:
https://coverage.readthedocs.io/
https://docs.sonarqube.org/display/PLUG/Python+Coverage+Results+Import
Template Names: |
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Comment Trigger: | |||||||||||||||||||||||||||||||||||||
run-sonar |
|||||||||||||||||||||||||||||||||||||
Required parameters: | |||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||
Optional parameters: | |||||||||||||||||||||||||||||||||||||
|
Tox runner to verify a project. This job is pyenv aware so if the image contains an installation of pyenv at /opt/pyenv it will pick it up and run Python tests with the appropriate Python versions. This job will set the following pyenv variables before running.
export PYENV_ROOT="/opt/pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
Template Names: |
|
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Comment Trigger: | |||||||||||||||||||||||||||||||
recheck|reverify |
|||||||||||||||||||||||||||||||
Required Parameters: | |||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
Optional Parameters: | |||||||||||||||||||||||||||||||
|