aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Rendina <rendinam@users.noreply.github.com>2020-07-28 14:49:54 -0400
committerGitHub <noreply@github.com>2020-07-28 14:49:54 -0400
commit30eab9663d5541e80f3c07985e0349c754b043ed (patch)
treec57dd2f91e6fbc66d0e34c1e5377ad142ba87824
parenta8d2fd9a872facc4a6ea5bd803396392b1be417d (diff)
downloaddocker-buildsys-pipeline-30eab9663d5541e80f3c07985e0349c754b043ed.tar.gz
Generalize snapshot specification (#3)HEADmaster
Allow snapshot URL or direct file specification
-rw-r--r--Dockerfile5
-rwxr-xr-xbuild.sh8
2 files changed, 7 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index d060d33..8a5cdf2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,7 +15,7 @@ ARG CONDA_BUILD_VERSION
ARG CONDA_PACKAGES
# Pipeline environment snapshot definition
-ARG SNAPSHOT_URL
+ARG SNAPSHOT_INPUT
# Declare environment
ENV OPT=/opt \
@@ -74,6 +74,8 @@ RUN curl -q -OSs ${MC_URL}/${MC_INSTALLER} \
ENV PATH "${MC_PATH}/bin:${PATH}"
USER developer
+ADD ${SNAPSHOT_INPUT} ${HOME}/SNAPSHOT.yml
+
RUN conda config --set auto_update_conda false \
&& conda config --set always_yes true \
&& conda config --set quiet true \
@@ -82,7 +84,6 @@ RUN conda config --set auto_update_conda false \
conda=${CONDA_VERSION} \
git \
${CONDA_PACKAGES} \
- && curl -L -Ss ${SNAPSHOT_URL} -o ${HOME}/SNAPSHOT.yml \
&& conda env update -n base --file ${HOME}/SNAPSHOT.yml
WORKDIR ${HOME}
diff --git a/build.sh b/build.sh
index 66788d9..9dba331 100755
--- a/build.sh
+++ b/build.sh
@@ -6,12 +6,12 @@ if [[ ! $tag ]]; then
exit 1
fi
-url="$2"
-if [[ ! $url ]]; then
- echo "No published snapshot URL specified."
+snapshot="$2"
+if [[ ! $snapshot ]]; then
+ echo "No snapshot file or URL specified."
exit 1
fi
docker build \
-t "astroconda/buildsys-pipeline:${tag}" \
- --build-arg SNAPSHOT_URL="${url}" $(pwd)
+ --build-arg SNAPSHOT_INPUT="${snapshot}" $(pwd)