From f213c3df5f70b21a164bedd811d6a71900da62a3 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 29 Dec 2020 17:04:17 +0100 Subject: [PATCH 1/5] Follow convention and show type of message --- abra | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abra b/abra index f94c4a5..a6fd3e6 100755 --- a/abra +++ b/abra @@ -298,7 +298,7 @@ warning() { } success() { - echo "$(tput setaf 2)$*$(tput sgr0)" + echo "$(tput setaf 2)SUCCESS: $*$(tput sgr0)" } ###### Default settings From fff2fbe8190f6e5661283067e84c85c3fbfda067 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 29 Dec 2020 17:05:00 +0100 Subject: [PATCH 2/5] Prepare function name for new functionality --- abra | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/abra b/abra index a6fd3e6..115e3e1 100755 --- a/abra +++ b/abra @@ -325,7 +325,7 @@ require_stack() { fi } -require_app_clone() { +require_app_latest() { APP="$1" APP_DIR="$ABRA_DIR/apps/$APP" @@ -540,7 +540,7 @@ sub_app_new (){ SERVER=$abra___server DOMAIN=$abra___domain - require_app_clone "$APP" + require_app_latest "$APP" if [ -z "$SERVER" ]; then echo "Where would you like to put $APP?" @@ -596,7 +596,7 @@ sub_app_deploy (){ load_instance load_instance_env - require_app_clone "$APP" + require_app_latest "$APP" if [ "$abra___skip_check" == "false" ]; then sub_app_check From ebfe7ca4e84992986603a8c10821fa5c4c16fa74 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 29 Dec 2020 17:05:30 +0100 Subject: [PATCH 3/5] Suppress output of clone and do better logging --- abra | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/abra b/abra index 115e3e1..36beb19 100755 --- a/abra +++ b/abra @@ -330,10 +330,11 @@ require_app_latest() { APP_DIR="$ABRA_DIR/apps/$APP" if [ ! -d "$APP_DIR" ]; then - warning "'$APP' not found, fetching via git.." - if ! git clone "$GIT_URL/$APP.git" "$ABRA_DIR/apps/$APP"; then - error "Could not retrieve '$APP', this app doesn't exist?" + warning "The app type '$APP' was not found, fetching via Git" + if ! git clone "$GIT_URL/$APP.git" "$ABRA_DIR/apps/$APP" > /dev/null 2>&1 ; then + error "Could not retrieve app type '$APP', this app type doesn't exist?" fi + success "Fetched app configuration via Git" fi } From 3a9e141b240d05f0edceb7178341b596fc3f678e Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 29 Dec 2020 17:06:32 +0100 Subject: [PATCH 4/5] Pull latest changes Closes https://git.autonomic.zone/coop-cloud/abra/issues/42. --- abra | 2 ++ 1 file changed, 2 insertions(+) diff --git a/abra b/abra index 36beb19..d7ed306 100755 --- a/abra +++ b/abra @@ -336,6 +336,8 @@ require_app_latest() { fi success "Fetched app configuration via Git" fi + + cd "$APP_DIR" && git pull > /dev/null 2>&1 } # FIXME 3wc: update or remove From 67cce192dfa24e15cee2a12acbc8527dfad68ffa Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 29 Dec 2020 17:06:49 +0100 Subject: [PATCH 5/5] Don't do more cloning that necessary --- abra | 3 --- 1 file changed, 3 deletions(-) diff --git a/abra b/abra index d7ed306..1f2447e 100755 --- a/abra +++ b/abra @@ -356,8 +356,6 @@ load_custom_commands() { if [ -n "$abra__domain_" ]; then load_instance load_instance_env - - require_app_clone "$APP" fi if [ -f "$APP_DIR/abra-commands.sh" ]; then @@ -625,7 +623,6 @@ sub_app_deploy (){ prompt_confirm APP=$(basename "$APP_DIR") - require_app_clone "$APP" ( cd "$APP_DIR" || error "\$APP_DIR '$APP_DIR' not found"