Skip to content

Commit

Permalink
Fixed #66: made scripts a little more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
grtjn committed Aug 27, 2015
1 parent de944e4 commit f06a2a2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion opt/vagrant/bootstrap-centos-extra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
echo "running $0 $@"

# Convert all property keys to lowercase and store to tmp file to be sourced.
if [ -d /vagrant ]; then
if [ -f /vagrant/project.properties ]; then
sed 's/.*=/\L&/' /vagrant/project.properties > /tmp/$4.project.properties
elif [ -f project.properties ]; then
sed 's/.*=/\L&/' project.properties > /tmp/$4.project.properties
else
printf "ml_version=$2\n" > /tmp/$4.project.properties
fi
Expand Down
4 changes: 3 additions & 1 deletion opt/vagrant/bootstrap-centos-master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
echo "running $0 $@"

# Convert all property keys to lowercase and store to tmp file to be sourced.
if [ -d /vagrant ]; then
if [ -f /vagrant/project.properties ]; then
sed 's/.*=/\L&/' /vagrant/project.properties > /tmp/$4.project.properties
elif [ -f project.properties ]; then
sed 's/.*=/\L&/' project.properties > /tmp/$4.project.properties
else
printf "ml_version=$2\n" > /tmp/$4.project.properties
fi
Expand Down
9 changes: 6 additions & 3 deletions opt/vagrant/install-ml-centos.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#! /bin/sh
echo "running $0 $@"

# Defaults
ml_version=8

# Load the normalized project properties.
source /tmp/$1.project.properties

Expand Down Expand Up @@ -34,11 +37,11 @@ fi
# Determine the MarkLogic installer to use
if [ -n "${ml_installer}" ]; then
installer=${ml_installer}
elif [ "${ml_version}" -eq "5" ]; then
elif [ "${ml_version}" = "5" ]; then
installer="MarkLogic-5.0-6.1.x86_64.rpm"
elif [ "${ml_version}" -eq "6" ]; then
elif [ "${ml_version}" = "6" ]; then
installer="MarkLogic-6.0-5.3.x86_64.rpm"
elif [ "${ml_version}" -eq "8" ]; then
elif [ "${ml_version}" = "8" ]; then
installer="MarkLogic-8.0-3.x86_64.rpm"
else
installer="MarkLogic-7.0-5.1.x86_64.rpm"
Expand Down
7 changes: 5 additions & 2 deletions opt/vagrant/install-mlcp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#! /bin/sh
echo "running $0 $@"

# Defaults
ml_version=8

# Load the normalized project properties.
source /tmp/$1.project.properties

Expand All @@ -10,9 +13,9 @@ yum -y install java-1.8.0-openjdk-devel
# Determine installer to use.
if [ -n "${mlcp_installer}" ]; then
installer=${mlcp_installer}
elif [ "${ml_version}" -eq "8" ]; then
elif [ "${ml_version}" = "8" ]; then
installer=mlcp-1.3-3-bin.zip
elif [ "${ml_version}" -eq "7" ]; then
elif [ "${ml_version}" = "7" ]; then
installer=mlcp-Hadoop2-1.2-4-bin.zip
else
installer=mlcp-Hadoop2-1.0-5-bin.zip
Expand Down

0 comments on commit f06a2a2

Please sign in to comment.