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

Remove outdated scripts

parent 8df2a529
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
# Mon 8 Aug 17:40:24 2016 CEST
# Creates a build environment for the current package
# $1 == conda folder (e.g. "/opt/conda")
# $2 == python version (e.g. "2.7")
# $3 == local dir for environment (e.g. "env")
if [ "${#}" -ne 3 ]; then
echo "usage: ${0} <conda-root> <python-version> <prefix>"
echo "example: ${0} /opt/conda 2.7 env"
exit 1
fi
CONDA_FOLDER=${1}
PYTHON_VERSION=${2}
PREFIX=`pwd`/${3}
WHEELS_SERVER="www.idiap.ch"
WHEELS_REPOSITORY="https://${WHEELS_SERVER}/software/bob/wheels/gitlab/"
# Determines the architecture we're using
if [ "$(uname)" == "Darwin" ]; then
ARCH="macosx"
else
ARCH="linux"
fi
# Functions for coloring echo commands
red_echo() {
echo -e "\033[1;31m${@}\033[0m"
}
green_echo() {
echo -e "\033[1;32m${@}\033[0m"
}
yellow_echo() {
echo -e "\033[1;33m${@}\033[0m"
}
# Function for running command and echoing results
run_cmd() {
green_echo "[(`date +%c`)>>] Running \"${@}\"..."
${@}
if [ "$?" != "0" ]; then
red_echo "[(`date +%c`)!!] Command Failed \"${@}\""
exit 1
else
green_echo "[(`date +%c`)<<] Finished comand \"${@}\""
fi
}
# Clones the conda dev environment to use
if [ ! -d ${PREFIX} ]; then
yellow_echo "[++] Downloading environment list into file \`env.txt'..."
pyver=$(echo ${PYTHON_VERSION} | tr -d '.')
curl --silent https://gitlab.idiap.ch/bob/bob.admin/raw/master/install/${ARCH}/devel-py${pyver}.txt > env.txt
yellow_echo "[++] Bootstrapping conda installation at ${PREFIX}..."
run_cmd ${CONDA_FOLDER}/bin/conda clean --lock
run_cmd ${CONDA_FOLDER}/bin/conda create --prefix ${PREFIX} --file env.txt --yes
run_cmd ${CONDA_FOLDER}/bin/conda clean --lock
else
yellow_echo "[!!] Prefix directory ${PREFIX} exists, not re-installing..."
fi
# Source the newly created conda environment
green_echo "[>>] Running \"source ${CONDA_FOLDER}/bin/activate ${PREFIX}\"..."
source ${CONDA_FOLDER}/bin/activate ${PREFIX}
green_echo "[<<] Environment ${PREFIX} activated"
# Verify where pip is installed
use_pip=`which pip`
if [ -z "${use_pip}" ]; then
red_echo "[!!] Cannot find pip, aborting..."
exit 1
else
yellow_echo "[++] Using pip: ${use_pip}"
fi
use_python=`which python`
if [ -z "${use_python}" ]; then
red_echo "[!!] Cannot find python, aborting..."
exit 1
else
yellow_echo "[++] Using python: ${use_python}"
fi
# Install this package's build dependencies
if [ -e requirements.txt ]; then
run_cmd ${use_pip} install --find-links ${WHEELS_REPOSITORY} --use-wheel --no-index --trusted-host ${WHEELS_SERVER} --pre --requirement requirements.txt
else
yellow_echo "[!!] No requirements.txt file found, skipping 'pip install <build-deps>'..."
fi
# Install this package's test dependencies
if [ -e test-requirements.txt ]; then
run_cmd ${use_pip} install --find-links ${WHEELS_REPOSITORY} --use-wheel --no-index --trusted-host ${WHEELS_SERVER} --pre --requirement test-requirements.txt
else
yellow_echo "[!!] No test-requirements.txt file found, skipping 'pip install <test-deps>'..."
fi
# Finally, bootstrap the installation from the new environment
if [ -e bootstrap-buildout.py ]; then
run_cmd ${use_python} bootstrap-buildout.py
else
red_echo "[!!] No bootstrap-buildout.py file found, stopping..."
exit 1
fi
#!/usr/bin/env bash
# Wed 21 Sep 2016 13:08:05 CEST
# Functions for coloring echo commands
red_echo() {
echo -e "\033[1;31m${@}\033[0m"
}
green_echo() {
echo -e "\033[1;32m${@}\033[0m"
}
if [ -z "${DOCUSER}" ] || [ -z "${DOCPASS}" ] || [ -z "${DOCSERVER}" ]; then
red_echo "DOCSERVER, DOCUSER and/or DOCPASS undefined - aborting...";
exit 1
fi
info=sphinx/.gitlab-ci.info
echo "repo=${CI_PROJECT_PATH}" > ${info}
echo "branch=${CI_BUILD_REF_NAME}" >> ${info}
echo "tag=${CI_BUILD_TAG}" >> ${info}
echo "build=${CI_BUILD_ID}" >> ${info}
echo "commit=${CI_BUILD_REF}" >> ${info}
echo "runner=${CI_RUNNER_DESCRIPTION}" >> ${info}
file=${CI_PROJECT_NAME}-${CI_BUILD_REF}.tar.bz2
tar cfj ${file} sphinx
green_echo "[>>] Uploading ${file}..."
curl --silent --user "${DOCUSER}:${DOCPASS}" --upload-file ${file} ${DOCSERVER}/software/bob/docs-upload/
if [ $? != 0 ]; then
red_echo "[error] curl command finished with an error condition"
exit 1
fi
#!/usr/bin/env bash
# Wed 21 Sep 2016 13:06:56 CEST
# Functions for coloring echo commands
red_echo() {
echo -e "\033[1;31m${@}\033[0m"
}
green_echo() {
echo -e "\033[1;32m${@}\033[0m"
}
if [ -z "${DOCUSER}" ] || [ -z "${DOCPASS}" ] || [ -z "${DOCSERVER}" ]; then
red_echo "DOCSERVER, DOCUSER and/or DOCPASS undefined - aborting...";
exit 1
fi
for file in dist/*.whl; do
green_echo "[>>] Uploading ${file}..."
curl --silent --user "${DOCUSER}:${DOCPASS}" --upload-file ${file} ${DOCSERVER}/software/bob/wheels-upload/gitlab/
if [ $? != 0 ]; then
red_echo "[error] curl command finished with an error condition"
exit 1
fi
done
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