Merge pull request 'Make sure to git pull latest changes on ~/.abra/apps side' (#54) from latest-checks into main

Reviewed-on: coop-cloud/abra#54
This commit is contained in:
decentral1se 2020-12-29 17:10:16 +01:00
commit b634b4c668

20
abra
View File

@ -298,7 +298,7 @@ warning() {
} }
success() { success() {
echo "$(tput setaf 2)$*$(tput sgr0)" echo "$(tput setaf 2)SUCCESS: $*$(tput sgr0)"
} }
###### Default settings ###### Default settings
@ -325,16 +325,19 @@ require_stack() {
fi fi
} }
require_app_clone() { require_app_latest() {
APP="$1" APP="$1"
APP_DIR="$ABRA_DIR/apps/$APP" APP_DIR="$ABRA_DIR/apps/$APP"
if [ ! -d "$APP_DIR" ]; then if [ ! -d "$APP_DIR" ]; then
warning "'$APP' not found, fetching via git.." warning "The app type '$APP' was not found, fetching via Git"
if ! git clone "$GIT_URL/$APP.git" "$ABRA_DIR/apps/$APP"; then if ! git clone "$GIT_URL/$APP.git" "$ABRA_DIR/apps/$APP" > /dev/null 2>&1 ; then
error "Could not retrieve '$APP', this app doesn't exist?" error "Could not retrieve app type '$APP', this app type doesn't exist?"
fi fi
success "Fetched app configuration via Git"
fi fi
cd "$APP_DIR" && git pull > /dev/null 2>&1
} }
# FIXME 3wc: update or remove # FIXME 3wc: update or remove
@ -353,8 +356,6 @@ load_custom_commands() {
if [ -n "$abra__domain_" ]; then if [ -n "$abra__domain_" ]; then
load_instance load_instance
load_instance_env load_instance_env
require_app_clone "$APP"
fi fi
if [ -f "$APP_DIR/abra-commands.sh" ]; then if [ -f "$APP_DIR/abra-commands.sh" ]; then
@ -540,7 +541,7 @@ sub_app_new (){
SERVER=$abra___server SERVER=$abra___server
DOMAIN=$abra___domain DOMAIN=$abra___domain
require_app_clone "$APP" require_app_latest "$APP"
if [ -z "$SERVER" ]; then if [ -z "$SERVER" ]; then
echo "Where would you like to put $APP?" echo "Where would you like to put $APP?"
@ -596,7 +597,7 @@ sub_app_deploy (){
load_instance load_instance
load_instance_env load_instance_env
require_app_clone "$APP" require_app_latest "$APP"
if [ "$abra___skip_check" == "false" ]; then if [ "$abra___skip_check" == "false" ]; then
sub_app_check sub_app_check
@ -622,7 +623,6 @@ sub_app_deploy (){
prompt_confirm prompt_confirm
APP=$(basename "$APP_DIR") APP=$(basename "$APP_DIR")
require_app_clone "$APP"
( (
cd "$APP_DIR" || error "\$APP_DIR '$APP_DIR' not found" cd "$APP_DIR" || error "\$APP_DIR '$APP_DIR' not found"