From 6cb6e33664fbf471d2c9c9b2c23f24b2fe87d97a Mon Sep 17 00:00:00 2001 From: Chuan Yang Date: Thu, 29 Sep 2016 05:44:27 +0000 Subject: [PATCH] MNEMONIC-107:Use MNEMONIC_HOME Environment Variable --- build-tools/release.sh | 7 +++++++ build-tools/runall.sh | 5 +++++ docker/Dockerfile | 3 +++ 3 files changed, 15 insertions(+) diff --git a/build-tools/release.sh b/build-tools/release.sh index 0438c770..8c94f7b6 100755 --- a/build-tools/release.sh +++ b/build-tools/release.sh @@ -17,6 +17,13 @@ # limitations under the License. # +if [ -z "${MNEMONIC_HOME}" ]; then + export MNEMONIC_HOME="$(cd "`dirname "$0"`"/..; pwd)" +fi + +cd "${MNEMONIC_HOME}" + + usage(){ echo "Usage: $0 Release_Version Next_Release_Version Candidate_Id" echo "e.g. $0 0.2.0 0.2.0 rc2" diff --git a/build-tools/runall.sh b/build-tools/runall.sh index 0d3a17c6..3d9c31a1 100755 --- a/build-tools/runall.sh +++ b/build-tools/runall.sh @@ -17,6 +17,11 @@ # limitations under the License. # +if [ -z "${MNEMONIC_HOME}" ]; then + export MNEMONIC_HOME="$(cd "`dirname "$0"`"/..; pwd)" +fi +cd "${MNEMONIC_HOME}" + echo [INFO] Cleaning up and re-building... git clean -xdf > /dev/null diff --git a/docker/Dockerfile b/docker/Dockerfile index 657f51ea..a45ea721 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -64,6 +64,9 @@ RUN echo export MAVEN_OPTS="\" $([[ \"x\" != \"x${proxy_host}\" ]] && echo -Dpro RUN cd /ws && git clone https://github.com/apache/incubator-mnemonic.git && \ cd incubator-mnemonic && source /etc/profile.d/mvn.sh && mvn clean package install +ENV MNEMONIC_HOME /ws/incubator-mnemonic +ENV PATH $MNEMONIC_HOME:$PATH + WORKDIR /ws CMD ["bash"]