From 3f51ebec5cd914edb7888614fd57ee8f1efbf159 Mon Sep 17 00:00:00 2001 From: Hugo Duksis Date: Thu, 1 Jun 2017 15:08:22 +0200 Subject: [PATCH 1/3] Move install script path to variable --- provision.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/provision.sh b/provision.sh index deb26d1..f8aa99f 100644 --- a/provision.sh +++ b/provision.sh @@ -2,13 +2,14 @@ SETUP_DIR=$HOME/.pio INSTALLED_FLAG=$SETUP_DIR/installed +INSTALL_SCRIPT_PATH='https://raw.githubusercontent.com/apache/incubator-predictionio/master/bin/install.sh' mkdir -p $SETUP_DIR if [ ! -f $INSTALLED_FLAG ]; then echo "Installing PredictionIO..." - bash -e -c "$(curl -s https://install.prediction.io/install.sh)" 0 -y + bash -e -c "$(curl -s $INSTALL_SCRIPT_PATH)" 0 -y if [ $? -ne 0 ]; then echo "ERROR: PredictionIO installation failed." From be91b04907c15b277f670547197742b140e22977 Mon Sep 17 00:00:00 2001 From: Hugo Duksis Date: Thu, 1 Jun 2017 14:40:21 +0200 Subject: [PATCH 2/3] Show errors when they occure to see the dns resolution error: ``` curl: (6) Could not resolve host: install.prediction.io ``` --- provision.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provision.sh b/provision.sh index deb26d1..6d29efb 100644 --- a/provision.sh +++ b/provision.sh @@ -8,7 +8,7 @@ mkdir -p $SETUP_DIR if [ ! -f $INSTALLED_FLAG ]; then echo "Installing PredictionIO..." - bash -e -c "$(curl -s https://install.prediction.io/install.sh)" 0 -y + bash -e -c "$(curl -sS https://install.prediction.io/install.sh)" 0 -y if [ $? -ne 0 ]; then echo "ERROR: PredictionIO installation failed." From 8ae4d6fbb60157be4c9fd1b34f8663075ce6dc0b Mon Sep 17 00:00:00 2001 From: Hugo Duksis Date: Thu, 1 Jun 2017 14:24:49 +0200 Subject: [PATCH 3/3] Use the presence of pio-start-all comand as installed flag In order to avoid: ``` ==> PredictionIO: PredictionIO already installed. Skip installation. ==> PredictionIO: /tmp/vagrant-shell: line 34: pio-start-all: command not found ``` --- provision.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/provision.sh b/provision.sh index deb26d1..8af02c1 100644 --- a/provision.sh +++ b/provision.sh @@ -1,11 +1,10 @@ #!/usr/bin/env bash SETUP_DIR=$HOME/.pio -INSTALLED_FLAG=$SETUP_DIR/installed mkdir -p $SETUP_DIR -if [ ! -f $INSTALLED_FLAG ]; then +if [ ! -x "$(command -v pio-start-all)" ]; then echo "Installing PredictionIO..." bash -e -c "$(curl -s https://install.prediction.io/install.sh)" 0 -y @@ -23,7 +22,6 @@ if [ ! -f $INSTALLED_FLAG ]; then else echo "Finish PredictionIO installation." - touch $INSTALLED_FLAG fi