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

[scripts] Remove outdated scripts [ci skip]

parent 1dc88511
Branches
No related tags found
No related merge requests found
Pipeline #36143 failed
#!/usr/bin/env bash
# Thu 15 Feb 15:36:30 2018 CET
export PYTHON_VERSION="${PYTHON_VERSION:-${1}}"
if [ -z "${PYTHON_VERSION}" ]; then
echo "usage: $0 <python-version>"
exit 1
fi
scriptdir="$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)"
basedir=`pwd`
# These should be set by the CI - resetting in case of running from cmdline
export CONDA_ROOT="${CONDA_ROOT:-${basedir}/miniconda}"
export BOB_PACKAGE_VERSION="${BOB_PACKAGE_VERSION:-unknown}"
export PYTHONUNBUFFERED="${PYTHONUNBUFFERED:-1}"
export CI_PROJECT_URL="${CI_PROJECT_URL:-https://gitlab.idiap.ch/bob/bob.nightlies}"
# This should be installed by CI, but installing it here in case running from
# cmdline
if [ ! -d "_ci" ]; then
mkdir _ci
curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > _ci/install.sh
chmod 755 _ci/install.sh
./_ci/install.sh _ci master #installs ci support scripts
fi
# If not running on the CI, set docserver
if [ -z "${DOCPASS}" ]; then
export DOCSERVER=http://beatubulatest.lab.idiap.ch/
export CI_PROJECT_DIR=`pwd`
export CI_PROJECT_PATH=bob/bob.nightlies
export CI_PROJECT_NAME=bob.nightlies
export CI_COMMIT_REF_NAME=master
export PYPIUSER=unknown
export PYPIPASS=unknown
export DOCUSER=unknown
export DOCPASS=unknown
fi
if [ ! -d "${CONDA_ROOT}" ]; then
export VISIBILITY='private' #always allows the inclusion of all channels
./_ci/before_build.sh
unset VISIBILITY #unsets temporary hack
fi
source ${basedir}/_ci/functions.sh
PACKAGES=($(sed -e "/^\s*#.*/d;/^\s*$/d" ${basedir}/order.txt))
current=0
for f in "${PACKAGES[@]}"; do
((current++))
echo "";
log_debug " ==========================================================";
log_debug " Checking ${f} (${current}/${#PACKAGES[@]})...";
log_debug " ==========================================================";
echo "";
# First checks if all package tests pass
export BOB_TEST_ONLY="true"
${scriptdir}/rebuild.sh ${CONDA_ROOT} ${PYTHON_VERSION} ${f}
status=$?
unset BOB_TEST_ONLY
if [ ${status} -ne 0 ]; then
log_warn "Package ${f} check FAILED - rebuilding it..."
echo "";
log_info " ==========================================================";
log_info " Building ${f} (${current}/${#PACKAGES[@]})...";
log_info " ==========================================================";
echo "";
${scriptdir}/rebuild.sh ${CONDA_ROOT} ${PYTHON_VERSION} ${f}
status=$?
if [ ${status} -ne 0 ]; then
log_error "Package ${f} rebuild FAILED - aborting..."
exit ${status}
fi
else
log_info "Package ${f} check SUCCESS - skipping rebuild"
fi
done
#!/usr/bin/env bash
# Mon 19 Feb 10:42:26 2018 CET
if [ $# -ne 3 ]; then
echo "Completely rebuilds the given package"
echo "usage: $0 <conda> <python-version> <package-name>"
echo "example: $0 \$\{CONDA_ROOT\} 2.7 bob.blitz"
exit 1
fi
CONDA_ROOT=${1}
PYTHON_VERSION=${2}
CI_PROJECT_NAME=${3}
# Defines some required defaults, if they are not set by the CI (these allow
# local builds)
basedir=`pwd`
CI_PROJECT_NAMESPACE="${CI_PROJECT_NAMESPACE:-bob}"
CI_PROJECT_PATH=${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}
CI_PROJECT_DIR=${basedir}/src/${CI_PROJECT_NAME}
CI_PROJECT_URL="https://gitlab.idiap.ch/${CI_PROJECT_PATH}"
CI_COMMIT_REF="${CI_COMMIT_REF:-12345678}"
CI_COMMIT_REF_NAME="${CI_COMMIT_REF_NAME:-@local}"
# Overrides some stuff
if [ "${CI_COMMIT_REF_NAME}" == "@local" ]; then
BOB_PACKAGE_VERSION="unknown"
PYTHONUNBUFFERED=1
fi
source ${basedir}/_ci/functions.sh
unset BOB_PACKAGE_VERSION
# The way to clone the repositories for this build
check_pass CI_JOB_TOKEN
GITLAB_CHECKOUT_STRATEGY="${GITLAB_CHECKOUT_STRATEGY:-https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.idiap.ch/}"
# Checks package visibility
VISIBILITY=`visibility`
# Setup project variables
export_env CI_PROJECT_DIR
export_env CI_PROJECT_NAME
export_env CI_PROJECT_NAMESPACE
export_env CI_PROJECT_PATH
export_env CI_COMMIT_REF
export_env CI_COMMIT_REF_NAME
export_env CI_PROJECT_URL
export_env CONDA_ROOT
export_env PYTHONUNBUFFERED
export_env PYTHON_VERSION
export_env CI_PROJECT_DIR
export_env CI_PROJECT_PATH
export_env CI_PROJECT_NAME
if [ -d "${CI_PROJECT_DIR}" ]; then
run_cmd git -C ${CI_PROJECT_DIR} pull #updates
run_cmd git -C ${CI_PROJECT_DIR} clean -ffdx #rebuilds
else
if [ ! -d ${basedir}/src ]; then
run_cmd mkdir -p ${basedir}/src
fi
log_info "$ git clone --depth 1 \${GITLAB_CHECKOUT_STRATEGY}/${CI_PROJECT_PATH} ${CI_PROJECT_DIR}"
git clone --depth 1 ${GITLAB_CHECKOUT_STRATEGY}${CI_PROJECT_PATH} ${CI_PROJECT_DIR}
fi
# Gets the latest stable version of a given package or returns the empty string
# $1: work directory for the package checkout
latest_stable () {
git -C $1 fetch --tags
echo `git -C $1 tag --sort='v:refname' | grep -e 'v[0-9]*\.[0-9]*\.[0-9]*$' | tail -n 1`
}
if [[ "${STABLE}" == "true" ]]; then
CI_COMMIT_TAG=`latest_stable ${CI_PROJECT_DIR}`
if [ -z "${CI_COMMIT_TAG}" ]; then
echo "";
log_debug " ==========================================================";
log_debug " Skipping $f (${current}/${total}). No stable release";
log_debug " ==========================================================";
echo "";
continue;
fi
export_env CI_COMMIT_TAG
run_cmd git -C ${CI_PROJECT_DIR} checkout ${CI_COMMIT_TAG}
fi
run_cmd cd ${CI_PROJECT_DIR}
run_cmd ln -s ${basedir}/_ci .
# Calculates package version
if [ ! -r "version.txt" ]; then
log_error "./version.txt does not exist - cannot figure out version number"
exit 1
fi
BOB_PACKAGE_VERSION=`cat version.txt | tr -d '\n'`;
export_env BOB_PACKAGE_VERSION
# This will reset conda channels to their configuration so it they are
# appropriate for the current package being built
set_conda_channels ${VISIBILITY} ${CI_COMMIT_TAG}
# Calculates the current build-number available if in test-only mode
if [ -n "${BOB_TEST_ONLY}" ]; then
set_next_bob_build_number ${CONDA_CHANNELS[0]}
((BOB_BUILD_NUMBER--)) #uses the latest available
export_env BOB_BUILD_NUMBER
fi
run_cmd ./_ci/build.sh
if [ -z "${BOB_TEST_ONLY}" ]; then
# consider uploading depending on the environment...
if [[ "${DEPLOY_PACKAGES}" == "true" ]]; then
deploy_conda_packages ${CONDA_CHANNELS[0]} ${CI_PROJECT_NAME}
else
log_info 'Skipping package deployment (${DEPLOY_PACKAGES}!="true")...'
fi
else
log_info 'Skipping package deployment (in test-only mode)...'
fi
# we don't keep temp build material while testing only or after an upload
run_cmd ${CONDA_ROOT}/bin/conda build purge
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment