Skip to content

Commit 849a686

Browse files
committed
Updated messaging. Fixed WordPress url update.
1 parent 42b0baa commit 849a686

File tree

8 files changed

+39
-20
lines changed

8 files changed

+39
-20
lines changed

db-sync.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ echo -e "${bg_black}${txt_white} Copy over a production database to staging ${
2727
echo -e "${bg_black}${txt_white} ${txt_end}"
2828

2929
# Check for a local config file
30+
echo -e ""
3031
echo -e "${txt_blue} Checking for local configuration file (${conf_file}). ${txt_end}"
32+
echo -e ""
3133
if [[ -f "$conf_file" ]]; then
3234
. "$conf_file"
3335
fi
@@ -79,14 +81,12 @@ while true; do
7981
esac
8082
done
8183

82-
echo -e "${bg_black}${txt_white} ${txt_end}"
83-
echo -e "${bg_black}${txt_white} Run the Magento configuration. ${txt_end}"
84-
echo -e "${bg_black}${txt_white} ${txt_end}"
84+
echo -e ""
85+
echo -e "${txt_blue} Run the Magento configuration. ${txt_end}"
86+
echo -e ""
8587

8688
n98-magerun setup:upgrade
8789
echo
88-
n98-magerun deploy:mode:set developer
89-
echo
9090
n98-magerun setup:di:compile
9191
echo
9292
n98-magerun indexer:reindex

utils/local_backup.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
if [ $_arg_local_backup == 'on' ]; then
44
# Backup the current local database
5-
echo -e "\n${txt_white}${bg_black}Backing up local database(s).${txt_end}\n"
5+
echo -e ""
6+
echo -e "${txt_blue} Backing up local database(s).${txt_end}"
7+
echo -e ""
68

7-
n98-magerun --root-dir="${PWD}" db:dump --compression="gzip" --force "../backups/$DATESTAMP-m2.sql.gz"
9+
n98-magerun --ansi --root-dir="${PWD}" db:dump --compression="gzip" --force "../backups/$DATESTAMP-m2.sql.gz"
810

911
if [ $_arg_wordpress == 'on' ]; then
10-
n98-magerun --root-dir="${PWD}" db:dump --compression="gzip" --connection="wordpress" --force "../backups/$DATESTAMP-wp.sql.gz"
12+
n98-magerun --ansi --root-dir="${PWD}" db:dump --compression="gzip" --connection="wordpress" --force "../backups/$DATESTAMP-wp.sql.gz"
1113
fi
1214
else
1315
# No local backup
14-
echo -e "\n${txt_white}${bg_black}Skipping local database(s) backup.${txt_end}\n"
16+
echo -e ""
17+
echo -e "${txt_blue} Skipping local database(s) backup.${txt_end}"
18+
echo -e ""
1519
fi

utils/local_imagery_import.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22

33
# Backup the current local database
4-
echo -e "\n${txt_white}${bg_black}Importing imagery from live.${txt_end}\n"
4+
echo -e ""
5+
echo -e "${txt_blue} Importing imagery from live.${txt_end}"
6+
echo -e ""
57

68
# Set the default directories to transfer
79
source=("/pub/media/" "/wp/wp-content/uploads/")

utils/local_import.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22

33
# Backup the current local database
4-
echo -e "\n${txt_white}${bg_black}Importing into local database(s).${txt_end}\n"
4+
echo -e ""
5+
echo -e "${txt_blue} Importing into local database(s).${txt_end}"
6+
echo -e ""
57

68
mysql -h$DB_HOST -u$DB_USER -p$DB_PASS $DB_DBASE<../backups/latest-m2.sql
79

utils/remote_retrieve.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22

33
# Use the settings to check your connection
4-
echo -e "\n${txt_white}${bg_black}Retrieving database(s).${txt_end}\n"
4+
echo -e ""
5+
echo -e "${txt_blue} Retrieving database(s).${txt_end}"
6+
echo -e ""
57

68
remote_m2_db_file="$remote_backup_dir/latest-m2.sql.gz"
79
remote_wp_db_file="$remote_backup_dir/latest-wp.sql.gz"

utils/set_remote_host.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env bash
22

33
# Set data
4-
5-
echo -e "\n${txt_white}${bg_black}Enter the remote server info.${txt_end}\n"
4+
echo -e ""
5+
echo -e "${txt_blue} Enter the remote server info.${txt_end}"
6+
echo -e ""
67

78
# loop until validation
89
while [[ -z ${remote_host} ]]; do

utils/ssh_connection_test.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
#!/usr/bin/env bash
22

33
# Use the settings to check your connection
4-
echo -e "\n${txt_white}${bg_black}SSH Connection test.${txt_end}\n"
4+
echo -e "${bg_black}${txt_white} ${txt_end}"
5+
echo -e "${bg_black}${txt_white} SSH Connection test. ${txt_end}"
6+
echo -e "${bg_black}${txt_white} ${txt_end}"
57

68
status=$(ssh -o BatchMode=yes -o ConnectTimeout=5 -p "${remote_port}" "${remote_username}@${remote_host}" echo ok 2>&1)
79

810
if [[ $status == ok ]]; then
9-
echo -e "${txt_green}Remote connection successful!${txt_end}"
11+
echo -e "${bg_green}${txt_white} ${txt_end}"
12+
echo -e "${bg_green}${txt_white} Remote connection successful! ${txt_end}"
13+
echo -e "${bg_green}${txt_white} ${txt_end}"
1014
elif [[ $status == "Permission denied"* ]] ; then
11-
echo -e "${txt_red}Permission denied${txt_end}"
12-
echo -e "${txt_red}Make sure you connected with the -A flag to forward your ssh agent.${txt_end}"
15+
echo -e "${bg_red}${txt_white} ${txt_end}"
16+
echo -e "${bg_red}${txt_white}${txt_bold} Permission denied ${txt_end}"
17+
echo -e "${bg_red}${txt_white} Make sure you connected with the -A flag to forward your ssh agent. ${txt_end}"
18+
echo -e "${bg_red}${txt_white} ${txt_end}"
1319
else
14-
echo -e "${txt_red}Remote connection failed${txt_end}"
20+
echo -e "${bg_red}${txt_white} ${txt_end}"
21+
echo -e "${bg_red}${txt_white} Remote connection failed ${txt_end}"
22+
echo -e "${bg_red}${txt_white} ${txt_end}"
1523
fi

utils/url_update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ old_domain=$(echo ${old_domain} | sed 's:/*$::')
3030

3131
sed -i "s|$old_domain|$new_domain|g" ../backups/latest-m2.sql
3232

33-
if existRemoteFile "$remote_wp_db_file"; then
33+
if [ $_arg_wordpress == 'on' ]; then
3434
sed -i "s|$old_domain|$new_domain|g" ../backups/latest-wp.sql
3535
fi

0 commit comments

Comments
 (0)