The purpose of this document is to make a how-to for having a conda package build on Jenkins. This document includes templates for accomplishing this goal. The first step is to create a conda recipe for a CSC. A template for doing so has been included on this page.

Creating the Recipe#

Create a conda folder inside the root directory CSC repository. Then copy the contents of the meta.yaml template into a meta.yaml file inside of the conda folder. Change the csc-name so that it becomes the name of the csc. Another thing is to add requirements so that they match the CSC’s. Keep in mind that the test requirements need to include test framework dependencies. It is suggested to sort dependencies as that increases readability of the recipe. To find the configuration repo, look for the get_config_pkg() in the CSC class.

{% set data= load_setup_py_data() %}

    name: csc-name
    version: {{ data.get('version') }}

    path: ../

    noarch: python
    script: {{ PYTHON }} -m pip install --no-deps --ignore-installed .

        - ts-conda-build =0.4
        - ts-idl {{ idl_version }}
        - ts-salobj {{ salobj_version }}
        - pyproject.toml
        - python
        - tests
        - pytest

        - pip
        - python {{ python }}
        - setuptools
        - setuptools_scm
        - python {{ python }}
        - setuptools
        - setuptools_scm
        - python {{ python }}
        - setuptools
        - setuptools_scm
        - ts-salobj
        # Add any other runtime dependencies here

Locally test the recipe in the develop-env:develop image by using the following

unsetup ts_config_{package} # this is required otherwise the EV will not picked up correctly by conda build
cd path/to/package/root
TS_CONFIG_PACKAGE_DIR=~/saluser/repos/ts_config_package conda build --variants "{salobj_version: '', idl_version: ''}" --no-long-test-prefix .

Creating the Jenkinsfile#

Once that is passing, move onto creating the Jenkinsfile.conda file. A template has been included below. It takes the following arguments


A list of configuration repos, can be empty, one or many.


The name of the package.


This is the namespace location for the module, for the coverage extension.


This is the architecture of the conda package to create. It can be linux-64 or noarch. It may be omitted and defaults to linux-64. When specifying noarch in the conda recipe, this argument must be set to noarch.

CondaPipeline(["configuration_repo"], "package_name", "module_namespace", "arch")

Adding the Job#

Add the job by creating a new item on the Jenkins server and selecting Multibranch Pipeline.


In Branch Sources click the github source selection and type in the path of the repo into the Respository HTTPS URL.


Then in the behaviors subsection click the add button and find the Custom GitHub Notification Context behavior.


Check the Apply Suffix box and in the label field add /conda to the end of the value.

Then in Build strategies click the add button and find the Tags strategies and leave the default values.


Then in Build Configuration add .conda to the Script Path field.


Then click Apply and Save.


If your job has a build strategy for regular branches, remove it as these jobs are not yet ready to be run on PR or branches.