File tree Expand file tree Collapse file tree 8 files changed +39
-20
lines changed Expand file tree Collapse file tree 8 files changed +39
-20
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ echo -e "${bg_black}${txt_white} Copy over a production database to staging ${
27
27
echo -e " ${bg_black}${txt_white} ${txt_end} "
28
28
29
29
# Check for a local config file
30
+ echo -e " "
30
31
echo -e " ${txt_blue} Checking for local configuration file (${conf_file} ). ${txt_end} "
32
+ echo -e " "
31
33
if [[ -f " $conf_file " ]]; then
32
34
. " $conf_file "
33
35
fi
@@ -79,14 +81,12 @@ while true; do
79
81
esac
80
82
done
81
83
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 " "
85
87
86
88
n98-magerun setup:upgrade
87
89
echo
88
- n98-magerun deploy:mode:set developer
89
- echo
90
90
n98-magerun setup:di:compile
91
91
echo
92
92
n98-magerun indexer:reindex
Original file line number Diff line number Diff line change 2
2
3
3
if [ $_arg_local_backup == ' on' ]; then
4
4
# 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 " "
6
8
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"
8
10
9
11
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"
11
13
fi
12
14
else
13
15
# 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 " "
15
19
fi
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# 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 " "
5
7
6
8
# Set the default directories to transfer
7
9
source=(" /pub/media/" " /wp/wp-content/uploads/" )
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# 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 " "
5
7
6
8
mysql -h$DB_HOST -u$DB_USER -p$DB_PASS $DB_DBASE < ../backups/latest-m2.sql
7
9
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# 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 " "
5
7
6
8
remote_m2_db_file=" $remote_backup_dir /latest-m2.sql.gz"
7
9
remote_wp_db_file=" $remote_backup_dir /latest-wp.sql.gz"
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# 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 " "
6
7
7
8
# loop until validation
8
9
while [[ -z ${remote_host} ]]; do
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# 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} "
5
7
6
8
status=$( ssh -o BatchMode=yes -o ConnectTimeout=5 -p " ${remote_port} " " ${remote_username} @${remote_host} " echo ok 2>&1 )
7
9
8
10
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} "
10
14
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} "
13
19
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} "
15
23
fi
Original file line number Diff line number Diff line change @@ -30,6 +30,6 @@ old_domain=$(echo ${old_domain} | sed 's:/*$::')
30
30
31
31
sed -i " s|$old_domain |$new_domain |g" ../backups/latest-m2.sql
32
32
33
- if existRemoteFile " $remote_wp_db_file " ; then
33
+ if [ $_arg_wordpress == ' on ' ] ; then
34
34
sed -i " s|$old_domain |$new_domain |g" ../backups/latest-wp.sql
35
35
fi
You can’t perform that action at this time.
0 commit comments