Skip to content
Snippets Groups Projects
Commit d0ce4426 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[ci] Improved deployment

parent db7b2930
No related branches found
No related tags found
No related merge requests found
Pipeline #25799 failed
...@@ -13,7 +13,7 @@ stages: ...@@ -13,7 +13,7 @@ stages:
.build_template: &build_job .build_template: &build_job
stage: build stage: build
before_script: before_script:
- ./ci/bootstrap.sh - ./ci/bootstrap.sh build
script: script:
- ./ci/build.sh - ./ci/build.sh
cache: &build_caches cache: &build_caches
...@@ -73,9 +73,12 @@ build_macosx_36: ...@@ -73,9 +73,12 @@ build_macosx_36:
.deploy_template: &deploy_job .deploy_template: &deploy_job
stage: deploy stage: deploy
before_script: before_script:
- ./ci/bootstrap.sh self - ./ci/bootstrap.sh local myenv
script: script:
- ./ci/deploy.sh - source ${CONDA_ROOT}/etc/profile.d/conda.sh
- conda activate myenv
- bdt --help
- bdt ci deploy
dependencies: dependencies:
- build_linux_36 - build_linux_36
- build_macosx_36 - build_macosx_36
......
#!/usr/bin/env bash #!/usr/bin/env bash
# Bootstraps a new conda installation and prepares base environment # Bootstraps a new conda installation and prepares base environment
# if "self" is passed as parameter, then self installs an already built # if "local" is passed as parameter, then self installs an already built
# version of bob.devtools available on your conda-bld directory. # version of bob.devtools available on your conda-bld directory. If you pass
# "beta", then it bootstraps from the package installed on our conda beta
# channel. If you pass "stable", then it bootstraps installing the package
# available on the stable channel.
#
# If bootstrapping anything else than "build", then provide a second argument
# with the name of the environment that one wants to create with an
# installation of bob.devtools.
# datetime prefix for logging # datetime prefix for logging
log_datetime() { log_datetime() {
...@@ -113,21 +120,34 @@ run_cmd mkdir -p ${CONDA_ROOT}/pkgs ...@@ -113,21 +120,34 @@ run_cmd mkdir -p ${CONDA_ROOT}/pkgs
run_cmd touch ${CONDA_ROOT}/pkgs/urls run_cmd touch ${CONDA_ROOT}/pkgs/urls
run_cmd touch ${CONDA_ROOT}/pkgs/urls.txt 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} run_cmd cp -fv ${CI_PROJECT_DIR}/bob/devtools/data/base-condarc ${CONDARC}
echo "channels:" >> ${CONDARC} echo "channels:" >> ${CONDARC}
echo " - http://www.idiap.ch/public/conda" >> ${CONDARC} if [ "${1}" == "beta" ]; then
echo " - ${CONDA_CHANNEL_ROOT}/label/beta" >> ${CONDARC}
fi
echo " - ${CONDA_CHANNEL_ROOT}" >> ${CONDARC}
echo " - defaults" >> ${CONDARC} echo " - defaults" >> ${CONDARC}
# displays contents of our configuration # displays contents of our configuration
echo "Contents of \`${CONDARC}':" echo "Contents of \`${CONDARC}':"
cat ${CONDARC} cat ${CONDARC}
# updates conda installation, installs just built bob.devtools # creates a base installation depending on the purpose
if [ "${1}" == "self" ]; then if [ "${1}" == "build" ]; then
run_cmd ${CONDA_ROOT}/bin/conda create -n bdt ${CONDA_ROOT}/conda-bld/${OS_SLUG}/bob.devtools-*.tar.bz2
else
run_cmd ${CONDA_ROOT}/bin/conda install -n base python conda=4 conda-build=3 run_cmd ${CONDA_ROOT}/bin/conda install -n base python conda=4 conda-build=3
elif [ "${1}" == "local" ]; then
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" ${CONDA_ROOT}/conda-bld/${OS_SLUG}/bob.devtools-*.tar.bz2
elif [ "${1}" == "beta" ] || [ "${1}" == "stable" ]; then
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" bob.devtools
else
log_error "Bootstrap with 'build', or 'local|beta|stable <name>'"
log_error "The value '${1}' is not currently supported"
exit 1
fi fi
run_cmd
# cleans up # cleans up
run_cmd ${CONDA_ROOT}/bin/conda clean --lock run_cmd ${CONDA_ROOT}/bin/conda clean --lock
......
#!/usr/bin/env bash #!/usr/bin/env bash
# Wed Jan 9 16:48:57 CET 2019 # Wed Jan 9 16:48:57 CET 2019
source $(dirname ${0})/functions.sh
run_cmd cp -fv ${CI_PROJECT_DIR}/bob/devtools/data/base-condarc ${CONDARC}
echo "channels:" >> ${CONDARC}
echo " - ${DOCSERVER}/public/conda" >> ${CONDARC}
echo " - defaults" >> ${CONDARC}
deploy_conda_packages ${CONDA_CHANNELS[0]} ${CI_PROJECT_NAME} deploy_conda_packages ${CONDA_CHANNELS[0]} ${CI_PROJECT_NAME}
# upload the docs from the sphinx folder (usually an artifact of Linux Python # upload the docs from the sphinx folder (usually an artifact of Linux Python
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment