diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-01-31 14:22:54 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-01-31 14:22:54 -0500 |
commit | 3190d616c3b61ba7f173dba1e46af701bbf2e34c (patch) | |
tree | e816864a7a1a2c111bb1cc88e1f63900117c9be4 | |
parent | f17f08d418e285d28b9b414b657e287556566497 (diff) | |
download | docker-pipeline-3190d616c3b61ba7f173dba1e46af701bbf2e34c.tar.gz |
Refactor all
-rw-r--r-- | Dockerfile | 3 | ||||
-rw-r--r-- | etc/hstdp-2018.3a/pkgs/002-hstcal.sh | 14 | ||||
-rwxr-xr-x | etc/hstdp-2018.3a/tasks/002-python-packages.sh | 4 | ||||
-rw-r--r-- | etc/jwstdp-latest/pkgs/002-fitsverify.sh | 4 | ||||
-rwxr-xr-x | etc/jwstdp-latest/tasks/001-packages.sh | 5 | ||||
-rwxr-xr-x | etc/jwstdp-latest/tasks/002-python-packages.sh | 4 | ||||
-rwxr-xr-x | scripts/build.sh | 17 |
7 files changed, 30 insertions, 21 deletions
@@ -3,8 +3,6 @@ FROM astroconda/python:${PYTHON_VERSION} LABEL maintainer="jhunk@stsci.edu" \ vendor="Space Telescope Science Institute" -ARG USER_ACCT=${USER_ACCT:-developer} -ARG USER_HOME=/home/${USER_ACCT} ARG PIPELINE=${PIPELINE:-} WORKDIR "${TOOLCHAIN_BUILD}" @@ -15,7 +13,6 @@ COPY etc/ ${TOOLCHAIN_BUILD}/etc USER "${USER_ACCT}" RUN sudo chown -R ${USER_ACCT}: ${TOOLCHAIN_BUILD} \ - && whoami \ && bin/build.sh \ && sudo rm -rf "${TOOLCHAIN_BUILD}" diff --git a/etc/hstdp-2018.3a/pkgs/002-hstcal.sh b/etc/hstdp-2018.3a/pkgs/002-hstcal.sh index 8b4ab4f..fe45351 100644 --- a/etc/hstdp-2018.3a/pkgs/002-hstcal.sh +++ b/etc/hstdp-2018.3a/pkgs/002-hstcal.sh @@ -3,14 +3,16 @@ name=hstcal version=2.2.0 url="https://github.com/spacetelescope/${name}" +# Grab a version of WAF that isn't broken +curl -o waf https://waf.io/waf-2.0.12 +chmod +x waf + git clone "${url}" pushd "${name}" &>/dev/null - # Grab a version of WAF that isn't broken - curl -o waf https://waf.io/waf-2.0.12 - chmod +x waf + git checkout "${version}" # Build / Install - ./waf configure --prefix=${PREFIX} --release-with-symbols --with-cfitsio=${PREFIX} - ./waf build - ./waf install + ../waf configure --prefix=${PREFIX} --release-with-symbols --with-cfitsio=${PREFIX} + ../waf build + ../waf install popd &>/dev/null diff --git a/etc/hstdp-2018.3a/tasks/002-python-packages.sh b/etc/hstdp-2018.3a/tasks/002-python-packages.sh index 3d89b6a..33714aa 100755 --- a/etc/hstdp-2018.3a/tasks/002-python-packages.sh +++ b/etc/hstdp-2018.3a/tasks/002-python-packages.sh @@ -33,8 +33,8 @@ function build() function post() { rm -rf ~/.cache/pip - [[ -d src ]] && rm -rf src - [[ -f gmon.out ]] && rm -rf gmon.out + [[ -d src ]] && rm -rf src || true + [[ -f gmon.out ]] && rm -rf gmon.out || true } build diff --git a/etc/jwstdp-latest/pkgs/002-fitsverify.sh b/etc/jwstdp-latest/pkgs/002-fitsverify.sh index 3469f3d..424daf8 100644 --- a/etc/jwstdp-latest/pkgs/002-fitsverify.sh +++ b/etc/jwstdp-latest/pkgs/002-fitsverify.sh @@ -9,8 +9,8 @@ tar xf "$(basename ${url})" pushd "${name}" &>/dev/null gcc -o ${name} ftverify.c fvrf_data.c fvrf_file.c fvrf_head.c \ - fvrf_key.c fvrf_misc.c -DSTANDALONE -I${TOOLCHAIN_INCLUDE} \ - -L${TOOLCHAIN_LIB} -Wl,-rpath=${TOOLCHAIN_LIB} -lcfitsio -lm -lnsl + fvrf_key.c fvrf_misc.c ${CFLAGS} -DSTANDALONE \ + ${LDFLAGS} -lcfitsio -lm -lnsl install -m 755 -t "${TOOLCHAIN_BIN}" ${name} popd &>/dev/null diff --git a/etc/jwstdp-latest/tasks/001-packages.sh b/etc/jwstdp-latest/tasks/001-packages.sh index e948120..e64fe06 100755 --- a/etc/jwstdp-latest/tasks/001-packages.sh +++ b/etc/jwstdp-latest/tasks/001-packages.sh @@ -2,15 +2,10 @@ set -e set -x -prefix="${TOOLCHAIN}" sysconfdir="${TOOLCHAIN_BUILD}/etc/${PIPELINE}" reqdir=${sysconfdir}/pkgs blddir=builds -export PATH="${prefix}/bin:${PATH}" -export CFLAGS="-I${prefix}/include" -export LDFLAGS="-L${prefix}/lib -Wl,-rpath=${prefix}/lib" -export PREFIX="${prefix}" function pre() { diff --git a/etc/jwstdp-latest/tasks/002-python-packages.sh b/etc/jwstdp-latest/tasks/002-python-packages.sh index 3d89b6a..33714aa 100755 --- a/etc/jwstdp-latest/tasks/002-python-packages.sh +++ b/etc/jwstdp-latest/tasks/002-python-packages.sh @@ -33,8 +33,8 @@ function build() function post() { rm -rf ~/.cache/pip - [[ -d src ]] && rm -rf src - [[ -f gmon.out ]] && rm -rf gmon.out + [[ -d src ]] && rm -rf src || true + [[ -f gmon.out ]] && rm -rf gmon.out || true } build diff --git a/scripts/build.sh b/scripts/build.sh index 348556f..8e2b178 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,12 +1,22 @@ -#!/bin/bash -e +#!/bin/bash -x +prefix="${TOOLCHAIN}" taskdir=${TOOLCHAIN_BUILD}/etc/${PIPELINE}/tasks +export _maxjobs=$(getconf _NPROCESSORS_ONLN) +export PATH="${prefix}/bin:${PATH}" +export CFLAGS="-I${prefix}/include" +export LDFLAGS="-L${prefix}/lib -Wl,-rpath=${prefix}/lib" +export PKG_CONFIG_PATH="${prefix}/lib/pkgconfig" +export PREFIX="${prefix}" + if [[ ! -d ${taskdir} ]]; then echo "No tasks. ${taskdir} does not exist." exit 1 fi +printenv | sort + for task in ${taskdir}/* do # Check for execution permission @@ -16,4 +26,9 @@ do fi echo "Executing: ${task}" ${task} + retval=$? + if [[ ${retval} != 0 ]]; then + echo "TASK FAILED: ${task}" + exit ${retval} + fi done |