Skip to content

Commit

Permalink
Per #1546, set env var MET_REPO_DIR to easily get directory that repo…
Browse files Browse the repository at this point in the history
…sitory was cloned into
  • Loading branch information
georgemccabe committed Jan 20, 2022
1 parent d787dbb commit f9b2a19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
File renamed without changes.
5 changes: 3 additions & 2 deletions scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN if [ "x${SOURCE_BRANCH}" = "x" ]; then \
fi

ENV MET_GIT_NAME ${SOURCE_BRANCH}
ENV MET_REPO_DIR /met/MET-${MET_GIT_NAME}
ENV MET_GIT_URL https://github.com/dtcenter/MET
ENV MET_DEVELOPMENT true

Expand All @@ -32,7 +33,7 @@ WORKDIR /met
# Delete the MET source code for tagged releases matching "v"*.
#
RUN echo "Checking out MET ${MET_GIT_NAME} from ${MET_GIT_URL}" \
&& git clone ${MET_GIT_URL} /met/MET-${MET_GIT_NAME} \
&& cd /met/MET-${MET_GIT_NAME}/met \
&& git clone ${MET_GIT_URL} ${MET_REPO_DIR} \
&& cd ${MET_REPO_DIR}/met \
&& git checkout ${MET_GIT_NAME} \
&& ../scripts/docker/build_met_docker.sh
13 changes: 7 additions & 6 deletions scripts/docker/Dockerfile.copy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN if [ "x${SOURCE_BRANCH}" = "x" ]; then \
fi

ENV MET_GIT_NAME ${SOURCE_BRANCH}
ENV MET_REPO_DIR /met/MET-${MET_GIT_NAME}
ENV MET_GIT_URL https://github.com/dtcenter/MET
ENV MET_DEVELOPMENT true

Expand All @@ -31,15 +32,15 @@ WORKDIR /met
# Download and install MET and GhostScript fonts.
# Delete the MET source code for tagged releases matching "v"*.
#
RUN echo "Copying MET into /met/MET-${MET_GIT_NAME}" \
&& mkdir -p /met/MET-${MET_GIT_NAME}
RUN echo "Copying MET into ${MET_REPO_DIR}" \
&& mkdir -p ${MET_REPO_DIR}

COPY . /met/MET-${MET_GIT_NAME}
COPY . ${MET_REPO_DIR}

RUN if [ ! -e "/met/MET-${MET_GIT_NAME}/met/configure.ac" ]; then \
RUN if [ ! -e "${MET_REPO_DIR}/met/configure.ac" ]; then \
echo "ERROR: docker build must be run from the MET directory"; \
exit 1; \
fi

RUN cd /met/MET-${MET_GIT_NAME}/met \
&& ./scripts/docker/build_met_docker.sh
RUN cd ${MET_REPO_DIR}/met \
&& ../scripts/docker/build_met_docker.sh

0 comments on commit f9b2a19

Please sign in to comment.