Skip to content
Snippets Groups Projects
build.sh 1.60 KiB
#!/usr/bin/env bash
# Wed 21 Sep 2016 13:08:05 CEST

source $(dirname ${0})/functions.sh

# Makes sure we activate the base environment if available
run_cmd source ${CONDA_ROOT}/etc/profile.d/conda.sh
run_cmd conda activate base
export_env PATH

run_cmd mkdir -p ./_ci/${OS_SLUG}/${PYTHON_VERSION}

if [ -z "${CI_COMMIT_TAG}" ]; then
  run_cmd ${CONDA_ROOT}/bin/python _ci/channel_support.py ${CONDA_BETA_CHANNEL} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION} -u --log ./_ci/${OS_SLUG}/${PYTHON_VERSION}/build_number.txt
else
  run_cmd ${CONDA_ROOT}/bin/python _ci/channel_support.py ${CONDA_CHANNEL} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION} -u --log ./_ci/${OS_SLUG}/${PYTHON_VERSION}/build_number.txt

fi

BOB_BUILD_NUMBER=`head -n 1 ./_ci/${OS_SLUG}/${PYTHON_VERSION}/build_number.txt | tr -d '\n'`
export_env BOB_BUILD_NUMBER

# copy the recipe_append.yaml over before build
run_cmd cp ./_ci/recipe_append.yaml conda/recipe_append.yaml

run_cmd ${CONDA_ROOT}/bin/conda build --no-anaconda-upload --variant-config-files _ci/conda_build_config.yaml --python=${PYTHON_VERSION} conda

# delete the bob packages from the cache otherwise the cache keeps increasing
# over and over. See https://gitlab.idiap.ch/bob/bob.admin/issues/65
run_cmd rm -rf ${CONDA_ROOT}/pkgs/bob*.tar.bz2

# run git clean to clean everything that is not needed
run_cmd git clean -ffdx --exclude=miniconda.sh --exclude="miniconda/pkgs/*.tar.bz2" --exclude=miniconda/pkgs/urls.txt --exclude=_ci --exclude="miniconda/conda-bld/linux-64/*.tar.bz2" --exclude="miniconda/conda-bld/osx-64/*.tar.bz2" --exclude="dist/*.zip" --exclude=sphinx