summaryrefslogtreecommitdiff
path: root/etc/hstdp-snapshot/tasks/002-python-packages.sh
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2019-02-15 22:13:21 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2019-02-15 22:13:21 -0500
commit79c25396b4a59b63844022ca7f650a0654b8c160 (patch)
treefc974965569e6647363e1983d3806082c14e9b99 /etc/hstdp-snapshot/tasks/002-python-packages.sh
parentb07f61a7744b203ed004294f5b281bfaacf8dcfc (diff)
downloaddocker-pipeline-79c25396b4a59b63844022ca7f650a0654b8c160.tar.gz
Add hstdp snapshot
Diffstat (limited to 'etc/hstdp-snapshot/tasks/002-python-packages.sh')
-rwxr-xr-xetc/hstdp-snapshot/tasks/002-python-packages.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/etc/hstdp-snapshot/tasks/002-python-packages.sh b/etc/hstdp-snapshot/tasks/002-python-packages.sh
new file mode 100755
index 0000000..33714aa
--- /dev/null
+++ b/etc/hstdp-snapshot/tasks/002-python-packages.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+set -e
+set -x
+
+# Uses GLOBAL environment variable: PYTHON_VERSION defined by `docker build` argument
+prefix="${TOOLCHAIN}"
+sysconfdir="${TOOLCHAIN_BUILD}/etc/${PIPELINE}"
+reqdir=${sysconfdir}/pip
+
+export PATH="${prefix}/bin:${PATH}"
+export CFLAGS="-I${prefix}/include"
+export LDFLAGS="-L${prefix}/lib -Wl,-rpath=${prefix}/lib"
+
+function pre()
+{
+ if [[ ! -d ${reqdir} ]]; then
+ # Nothing there, but maybe that's on purpose.
+ exit 0
+ fi
+}
+
+function build()
+{
+ pre
+ # Iterate over pip requirement files
+ for req in ${reqdir}/*
+ do
+ pip install --upgrade --progress-bar=off -r "${req}"
+ done
+ post
+}
+
+function post()
+{
+ rm -rf ~/.cache/pip
+ [[ -d src ]] && rm -rf src || true
+ [[ -f gmon.out ]] && rm -rf gmon.out || true
+}
+
+build