Commit 89420718 authored by André Anjos's avatar André Anjos 💬
Browse files

[ci] Making it work for deployment

parent 4f391f93
Pipeline #25804 failed with stages
in 3 minutes and 37 seconds
......@@ -10,3 +10,5 @@ quiet: true #!final
show_channel_urls: true #!final
anaconda_upload: false #!final
ssl_verify: false #!final
channels:
- defaults
......@@ -108,7 +108,7 @@ install_miniconda() {
check_defined CONDA_ROOT
check_defined CI_PROJECT_DIR
export CONDARC=${CONDA_ROOT}/condarc
export CONDARC="${CONDA_ROOT}/condarc"
check_defined CONDARC
# checks if a conda installation exists. Otherwise, installs one
......@@ -120,33 +120,24 @@ run_cmd mkdir -p ${CONDA_ROOT}/pkgs
run_cmd touch ${CONDA_ROOT}/pkgs/urls
run_cmd touch ${CONDA_ROOT}/pkgs/urls.txt
CONDA_CHANNEL_ROOT=http://www.idiap.ch/public/conda
check_defined CONDA_CHANNEL_ROOT
run_cmd cp -fv ${CI_PROJECT_DIR}/bob/devtools/data/base-condarc ${CONDARC}
echo "channels:" >> ${CONDARC}
if [ "${1}" == "beta" ]; then
echo " - ${CONDA_CHANNEL_ROOT}/label/beta" >> ${CONDARC}
fi
echo " - ${CONDA_CHANNEL_ROOT}" >> ${CONDARC}
echo " - defaults" >> ${CONDARC}
# displays contents of our configuration
echo "Contents of \`${CONDARC}':"
cat ${CONDARC}
# setup conda-channels
CONDA_CHANNEL_ROOT="http://www.idiap.ch/public/conda"
check_defined CONDA_CHANNEL_ROOT
CONDA_CLI_CHANNELS="-c ${CONDA_CHANNEL_ROOT} -c defaults"
# creates a base installation depending on the purpose
if [ "${1}" == "build" ]; then
run_cmd ${CONDA_ROOT}/bin/conda install -n base python conda=4 conda-build=3
elif [ "${1}" == "local" ]; then
if [ "$(uname -s)" == "Linux" ]; then
_os="linux-64"
else
_os="osx-64"
fi
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" ${CONDA_ROOT}/conda-bld/${_os}/bob.devtools-*.tar.bz2
run_cmd ${CONDA_ROOT}/bin/conda index ${CONDA_ROOT}/conda-bld
CONDA_CLI_CHANNELS="-c ${CONDA_ROOT}/conda-bld ${CONDA_CLI_CHANNELS}"
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" --override-channels ${CONDA_CLI_CHANNELS} bob.devtools
elif [ "${1}" == "beta" ] || [ "${1}" == "stable" ]; then
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" bob.devtools
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" --override-channels ${CONDA_CLI_CHANNELS} bob.devtools
else
log_error "Bootstrap with 'build', or 'local|beta|stable <name>'"
log_error "The value '${1}' is not currently supported"
......
......@@ -47,7 +47,7 @@ check_defined PYTHON_VERSION
export DOCSERVER=http://www.idiap.ch
check_defined DOCSERVER
export CONDARC=${CONDA_ROOT}/condarc
export CONDARC="${CONDA_ROOT}/condarc"
check_defined CONDARC
export BOB_PACKAGE_VERSION=`cat version.txt | tr -d '\n'`;
......@@ -59,21 +59,25 @@ run_cmd conda activate base
export PATH
check_defined PATH
CONDA_CHANNEL_ROOT="${DOCSERVER}/public/conda"
check_defined CONDA_CHANNEL_ROOT
if [ -z "${CI_COMMIT_TAG}" ]; then #building beta
channel="http://www.idiap.ch/public/conda/label/beta"
UPLOAD_CHANNEL="${CONDA_CHANNEL_ROOT}/label/beta"
else
channel="http://www.idiap.ch/public/conda"
UPLOAD_CHANNEL="${CONDA_CHANNEL_ROOT}"
fi
check_defined UPLOAD_CHANNEL
log_info "$ ${CONDA_ROOT}/bin/python ${CI_PROJECT_DIR}/ci/nextbuild.py ${channel} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION}"
export BOB_BUILD_NUMBER=$(${CONDA_ROOT}/bin/python ${CI_PROJECT_DIR}/ci/nextbuild.py ${channel} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION})
log_info "$ ${CONDA_ROOT}/bin/python ${CI_PROJECT_DIR}/ci/nextbuild.py ${UPLOAD_CHANNEL} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION}"
export BOB_BUILD_NUMBER=$(${CONDA_ROOT}/bin/python ${CI_PROJECT_DIR}/ci/nextbuild.py ${UPLOAD_CHANNEL} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION})
check_defined BOB_BUILD_NUMBER
# copy the recipe_append.yaml over before build
run_cmd cp ${CI_PROJECT_DIR}/bob/devtools/data/recipe_append.yaml conda/
run_cmd cp ${CI_PROJECT_DIR}/bob/devtools/data/conda_build_config.yaml conda/
run_cmd ${CONDA_ROOT}/bin/conda build "--python=${PYTHON_VERSION} --no-anaconda-upload" conda
# to build, we only rely on the stable channel and defaults
run_cmd ${CONDA_ROOT}/bin/conda build --override-channels -c "${CONDA_CHANNEL_ROOT} -c defaults --python=${PYTHON_VERSION} --no-anaconda-upload" conda
# run git clean to clean everything that is not needed. This helps to keep the
# disk usage on CI machines to minimum.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment