From 01bbd5dd4a62bddb75bd245afb5d8095dafcbc26 Mon Sep 17 00:00:00 2001 From: kexkey Date: Fri, 28 Dec 2018 15:27:03 -0500 Subject: [PATCH] finalreturncode from tests and override versions in setup --- dist/setup.sh | 4 +++- .../generators/app/templates/installer/start.sh | 6 ++---- .../generators/app/templates/installer/testfeatures.sh | 8 +++++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dist/setup.sh b/dist/setup.sh index de6259d..b3d0d05 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -184,6 +184,7 @@ configure() { docker run -v $current_path:/data \ -e DEFAULT_USER=$USER \ -e DEFAULT_CERT_HOSTNAME=$(hostname) \ + -e VERSION_OVERRIDE=$VERSION_OVERRIDE \ -e GATEKEEPER_VERSION=$GATEKEEPER_VERSION \ -e PROXY_VERSION=$PROXY_VERSION \ -e PROXYCRON_VERSION=$PROXYCRON_VERSION \ @@ -637,7 +638,8 @@ ALWAYSYES=0 SUDO_REQUIRED=0 AUTOSTART=0 -# CYPHERNODE VERSION "0.1.0-rc.1" +# CYPHERNODE VERSION "v0.1.0-rc.1" +VERSION_OVERRIDE="true" CONF_VERSION="v0.1-rc.1" GATEKEEPER_VERSION="v0.1-rc.1" PROXY_VERSION="v0.1-rc.1" diff --git a/install/generator-cyphernode/generators/app/templates/installer/start.sh b/install/generator-cyphernode/generators/app/templates/installer/start.sh index df94744..670c2a3 100644 --- a/install/generator-cyphernode/generators/app/templates/installer/start.sh +++ b/install/generator-cyphernode/generators/app/templates/installer/start.sh @@ -42,13 +42,11 @@ if [ -f $current_path/exitStatus.sh ]; then fi if [ "$EXIT_STATUS" -ne "0" ]; then - exec ./stop.sh + printf "\r\n\033[1;31mThere was an error during cyphernode installation. Please see Docker's logs for more information. Run ./stop.sh to stop cyphernode.\r\n\r\n\033[0m" exit 1 fi - - printf "\r\n\033[0;92mDepending on your current location and DNS settings, point your favorite browser to one of the following URLs to access Cyphernode's status page:\r\n" printf "\r\n" printf "\033[0;95m<% cns.forEach(cn => { %><%= ('https://' + cn + '/status/\\r\\n') %><% }) %>\033[0m\r\n" -printf "\r\n\033[0;92mUse 'admin' as the username with the configuration password you selected at the beginning of the configuration process.\r\n" +printf "\033[0;92mUse 'admin' as the username with the configuration password you selected at the beginning of the configuration process.\r\n\r\n\033[0m" diff --git a/install/generator-cyphernode/generators/app/templates/installer/testfeatures.sh b/install/generator-cyphernode/generators/app/templates/installer/testfeatures.sh index ef71edf..a7afff2 100644 --- a/install/generator-cyphernode/generators/app/templates/installer/testfeatures.sh +++ b/install/generator-cyphernode/generators/app/templates/installer/testfeatures.sh @@ -234,6 +234,7 @@ feature_status() { brokenproxy="false" containers=$(checkservice) returncode=$? +finalreturncode=${returncode} if [ "${returncode}" -ne "0" ]; then echo -e "\e[1;31mCyphernode could not fully start properly within delay." > /dev/console status=$(echo "{${containers}}" | jq ".containers[] | select(.name == \"proxy\") | .active") @@ -262,6 +263,7 @@ if [ "${status}" = "true" ]; then else returncode=1 fi +finalreturncode=$((${returncode} | ${finalreturncode})) result="${result}$(feature_status ${returncode} 'Gatekeeper error!')}" result="${result},{\"name\":\"pycoin\",\"working\":" @@ -272,6 +274,7 @@ if [[ "${brokenproxy}" != "true" && "${status}" = "true" ]]; then else returncode=1 fi +finalreturncode=$((${returncode} | ${finalreturncode})) result="${result}$(feature_status ${returncode} 'Pycoin error!')}" <% if (features.indexOf('otsclient') != -1) { %> @@ -283,6 +286,7 @@ if [[ "${brokenproxy}" != "true" && "${status}" = "true" ]]; then else returncode=1 fi +finalreturncode=$((${returncode} | ${finalreturncode})) result="${result}$(feature_status ${returncode} 'OTSclient error!')}" <% } %> @@ -294,6 +298,7 @@ if [[ "${brokenproxy}" != "true" && "${status}" = "true" ]]; then else returncode=1 fi +finalreturncode=$((${returncode} | ${finalreturncode})) result="${result}$(feature_status ${returncode} 'Bitcoin error!')}" <% if (features.indexOf('lightning') != -1) { %> @@ -305,6 +310,7 @@ if [[ "${brokenproxy}" != "true" && "${status}" = "true" ]]; then else returncode=1 fi +finalreturncode=$((${returncode} | ${finalreturncode})) result="${result}$(feature_status ${returncode} 'Lightning error!')}" <% } %> @@ -314,4 +320,4 @@ echo "${result}" > /gatekeeper/installation.json echo -e "\r\n\e[1;32mTests finished.\e[0m" > /dev/console -echo "EXIT_STATUS=${returncode}" > /exitStatus.sh +echo "EXIT_STATUS=${finalreturncode}" > /exitStatus.sh