diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2018-03-02 15:15:20 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2018-03-02 15:15:20 -0500 |
commit | 20963a1ff85d198358dd9629b8a1b5f2c2e7edf5 (patch) | |
tree | 12cdc94e2b6390208f86698d7906fbfd356286dc | |
parent | ca55992134ef987080e4168379dc8f23ca803ca8 (diff) | |
download | docker-buildsys-20963a1ff85d198358dd9629b8a1b5f2c2e7edf5.tar.gz |
Initial commit of with_env handler
-rw-r--r-- | Dockerfile | 3 | ||||
-rwxr-xr-x | with_env | 23 |
2 files changed, 26 insertions, 0 deletions
@@ -76,6 +76,9 @@ RUN conda config --set auto_update_conda false \ ${CONDA_PACKAGES} \ && chown -R jenkins: ${OPT} ${HOME} +# Inject custom handlers +ADD with_env /usr/local/bin + WORKDIR ${HOME} EXPOSE 22 diff --git a/with_env b/with_env new file mode 100755 index 0000000..6200ebe --- /dev/null +++ b/with_env @@ -0,0 +1,23 @@ +#!/bin/bash +set +x +environ=base +commands=() + +while [[ $# > 0 ]] +do + key="$1" + case $key in + -n|--name) + environ="$2" + shift 2 + ;; + *) + commands+=("$1") + shift + ;; + esac +done + +source activate $environ +${commands[@]} +exit $? |