aboutsummaryrefslogtreecommitdiff
path: root/start.sh
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2018-12-04 11:08:16 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2018-12-04 11:08:16 -0500
commitf6eb0f96fec2a124333381c6a80ccd4f27290a7d (patch)
tree1dc20385009169baac43a31212d9dfd5ed2b6dde /start.sh
parent3767b4566c124f0b7ac15352b0614d8ef94f23d1 (diff)
downloadwheeblast-master.tar.gz
Semi-initial commitHEADmaster
Diffstat (limited to 'start.sh')
-rwxr-xr-xstart.sh98
1 files changed, 98 insertions, 0 deletions
diff --git a/start.sh b/start.sh
new file mode 100755
index 0000000..696f5af
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,98 @@
+#!/bin/bash
+root="$(pwd)"
+build=/io
+static=/static
+srcdir=${root}/src
+cache_left=${root}/cache
+cache_right=/root/.cache
+
+staging=staging
+wheelhouse=wheelhouse
+disthouse=disthouse
+
+source "$(dirname ${BASH_SOURCE[0]})/etc/config.sh"
+source "$(dirname ${BASH_SOURCE[0]})/etc/functions.sh"
+
+export GREP_MODE='-G'
+if [[ $(uname) == Linux ]]; then
+ export GREP_MODE='-P'
+elif [[ $(uname) == Darwin ]]; then
+ export GREP_MODE='-E'
+fi
+
+for project in "${projects[@]}"
+do
+ url="${host}/${org}/${project}"
+ dest="${srcdir}/${project}"
+
+ if [[ ! -d ${dest} ]]; then
+ msg "Retrieving source for: ${project}"
+ git clone --recursive "${url}" "${dest}" &>/dev/null
+ if [[ $? != 0 ]]; then
+ msg2 "Failed to clone: ${url}"
+ continue
+ fi
+ fi
+
+ pushd "${dest}" &>/dev/null
+ tags=$(git tag | grep ${GREP_MODE} ${tag_regex} | tail -n ${tag_limit})
+ echo "Tags: ${tags}"
+
+ for tag in $tags
+ do
+ git fetch --all &>/dev/null
+ git reset --hard &>/dev/null
+ git clean -ffxd &>/dev/null
+ git checkout "${tag}" &>/dev/null
+
+ msg "Initializing Docker image: ${docker_image}"
+ docker run --rm -i -t \
+ -v "${cache_left}:${cache_right}" \
+ -v "${root}:${static}" \
+ -v "${dest}:${build}" \
+ "${docker_image}" ${static}/build-project.sh "${project}"
+ done
+ popd &>/dev/null
+done
+
+wheels_binary=$(find ${staging} -type f -name '*cp*-cp*m*.whl')
+wheels_universal=$(find ${staging} -type f -name '*-any.whl')
+dists=$(find ${staging} -type f -name '*.tar.gz')
+
+
+mkdir -p ${wheelhouse}
+mkdir -p ${disthouse}
+
+if [[ $wheels_binary ]]; then
+ msg2 "Exporting binary wheels..."
+ for whl in $wheels_binary; do
+ docker run --rm -i -t \
+ -v "${root}:${static}" \
+ "${docker_image}" \
+ auditwheel repair \
+ "${static}/${whl}" \
+ -w ${static}/wheelhouse
+ if [[ $? == 0 ]]; then
+ rm -f "${whl}"
+ fi
+ done
+fi
+
+set +e
+
+# "auditwheel" wastes time for univeral wheels
+if [[ $wheels_universal ]]; then
+ msg2 "Exporting universal wheels..."
+ for whl in $wheels_universal; do
+ msg3 "$(basename ${whl})"
+ mv "${whl}" "${wheelhouse}"
+ done
+fi
+
+if [[ $dists ]]; then
+ msg2 "Exporting source dists..."
+ for dist in ${dists}; do
+ msg3 "$(basename "${dist}")"
+ mv "${dist}" "${disthouse}"
+ done
+fi