anaconda-graveyard / conda-concourse-ci

Conda-driven Concourse CI for package building
BSD 3-Clause "New" or "Revised" License
13 stars 29 forks source link

Jinja2 support. #169

Closed mingwandroid closed 3 years ago

mingwandroid commented 3 years ago

cc @bkreider, @myancy-anaconda

This allows the use of jinija2 in build platform definitions. An example is:

{% set platform = 'osx' %}
label: {{ platform }}
platform: {{ platform }}
arch: 64
pool_name: {{ platform }}
prefix_commands:
  - echo "Hello from $(hostname), cwd is ${PWD}"
  - rsync-build-pack/loner_conda_{{ platform }}.exe create -p ./build_env -y conda conda-verify
  - source build_env/bin/activate
  - source build_env/etc/profile.d/conda.sh
  - conda config --env --set add_pip_as_python_dependency False
  - conda install -y git
{% if github_conda %}
  - git clone https://github.com/{{ github_user_conda }}/conda.git -b {{ github_branch_conda }}
  - pushd conda
  - ./dev/start
  - popd
{% endif %}
{% if github_conda_build %}
  - conda install -y --only-deps conda-build
  - git clone https://github.com/{{ github_user_conda_build }}/conda-build.git -b {{ github_branch_conda_build }}
  - pushd conda-build
  - python setup.py develop
  - popd
{% else %}
  - conda install -y conda-build
{% endif %}
  - python -m conda remove -y git
  - conda-build --version
  - conda install -y -c conda-canary conda conda-package-handling=1.7.2
  - conda info
build_suffix_commands:
  - --skip-existing --error-overlinking --error-overdepending --debug

alongside a file build-config.yml:

github_user_conda: conda
github_branch_conda: master
github_user_conda_build: conda
github_branch_conda_build: master
github_conda: true
github_conda_build: true

.. this gives us a similar level of flexibility we enjoy in conda recipes in these build configs. The specific goal that caused me to want to add this feature is to allow me to test my WIP branches of conda and conda-build in a real build scenario across all platforms before I commit to a release.

I also found out why --platform doesn't work like you'd expect and fixed that too.