Skip to content

Commit 31a3fd4

Browse files
committed
removed BASTION_HOST_REMOTE. if a ProxyJump is needed, it should be set in DEST_HOST's .ssh/config
1 parent c957eff commit 31a3fd4

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ See [`CONTRIBUTING.md`](CONTRIBUTING.md).
3131
- `wp-config.php` is already setup
3232
- user has appopriate permissions (ex. member of `www-data`)
3333
- [WP-CLI][wp-cli] is already installed
34-
2. You may need to configure your users `.ssh/config`. For example,
34+
2. You may need to configure your `.ssh/config`. For example,
3535
`chapters_stage` requires the following entry:
3636
```
3737
Host 10.22.10.14
@@ -50,15 +50,15 @@ See [`CONTRIBUTING.md`](CONTRIBUTING.md).
5050
## Use
5151
5252
1. `SOURCE_HOST`: *(optional)*
53-
- run [`backup_wordpress.sh`][backup] on the
53+
- run [`backup_wordpress.sh`][backup]
5454
2. Local/laptop:
5555
1. Clone this repository
5656
2. Prepare configuration file
5757
1. Make a copy of one of the appropriate
5858
[`config_examples/`](config_examples/)
5959
2. Replace `FILEPATH` and `USERNAME` with your information
6060
3. Ensure `SOURCE_DB_FILE` and `SOURCE_UPLOADS_FILE` are valid files on
61-
the `SOURCE_HOST`.
61+
the `SOURCE_HOST` (ex. by completing step 1, above)
6262
3. Execute script with config file as only argument. For example:
6363
```shell
6464
./wp-pull.sh chapters__stage

bin/wp-pull-remote.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ import_database() {
201201

202202
pull_data() {
203203
headerone 'DEST_HOST: Pulling data from SOURCE_HOST_REMOTE'
204-
scp -oProxyJump=${BASTION_HOST_REMOTE} \
205-
${SOURCE_HOST_REMOTE}:${SOURCE_DB_FILE} \
204+
scp ${SOURCE_HOST_REMOTE}:${SOURCE_DB_FILE} \
206205
${SOURCE_HOST_REMOTE}:${SOURCE_UPLOADS_FILE} \
207206
${TEMP_DIR}/
208207
PULLED_DB_FILE="${TEMP_DIR}/${SOURCE_DB_FILE##*/}"

config_examples/chapters__stage

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# DEST_UPLOADS_DIR: /var/www/chapters/wp-content/uploads
55
# DEST_TEMP_DIR: /var/www/chapters
66
# DEST_WP_DIR: /var/www/chapters/wp
7-
# BASTION_HOST_REMOTE: 10.22.10.10
87
# SOURCE_HOST_REMOTE: 10.22.10.14
98
# SOURCE_DOMAIN: creativecommons.net
109
# SOURCE_DB_FILE: /var/www/chapters/backup/now/db.sql.gz

wp-pull.sh

-6
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ Configuration File Variables:
2323
destination host (will be destroyed and replaced)
2424
DEST_WP_DIR Absolute path of WordPress directory (where to run
2525
WP-CLI from)
26-
BASTION_HOST_REMOTE Bastion or Jump Host used to connect to
27-
SOURCE_HOST_REMOTE
2826
SOURCE_HOST_REMOTE Host to pull WordPress data from
2927
SOURCE_DOMAIN Domain/Site URL of the source WordPress
3028
SOURCE_DB_FILE Absolute path of the database file (.sql.gz)
@@ -73,8 +71,6 @@ display_summary_and_confirm(){
7371
echo "${DKG}DEST_UPLOADS_DIR:${RST} ${DEST_UPLOADS_DIR}"
7472
echo "${DKG}DEST_WP_DIR:${RST} ${DEST_WP_DIR}"
7573
echo
76-
echo "${DKG}BASTION_HOST_REMOTE:${RST} ${BASTION_HOST_REMOTE}"
77-
echo
7874
echo "${DKG}SOURCE_HOST_REMOTE:${RST} ${SOURCE_HOST_REMOTE}"
7975
echo "${DKG}SOURCE_DOMAIN:${RST} ${SOURCE_DOMAIN}"
8076
echo "${DKG}SOURCE_DB_FILE:${RST} ${SOURCE_DB_FILE}"
@@ -115,7 +111,6 @@ execute_remote_script() {
115111
export DEST_UPLOADS_DIR=\"${DEST_UPLOADS_DIR}\"
116112
export DEST_TEMP_DIR=\"${DEST_TEMP_DIR}\"
117113
export DEST_WP_DIR=\"${DEST_WP_DIR}\"
118-
export BASTION_HOST_REMOTE=\"${BASTION_HOST_REMOTE}\"
119114
export SOURCE_HOST_REMOTE=\"${SOURCE_HOST_REMOTE}\"
120115
export SOURCE_DOMAIN=\"${SOURCE_DOMAIN}\"
121116
export SOURCE_DB_FILE=\"${SOURCE_DB_FILE}\"
@@ -134,7 +129,6 @@ extract_variables_from_config() {
134129
DEST_TEMP_DIR="${DEST_TEMP_DIR%/}"
135130
DEST_WP_DIR="$(awk '/^# DEST_WP_DIR:/ {print $3}' "${_f}")"
136131
DEST_WP_DIR="${DEST_WP_DIR%/}"
137-
BASTION_HOST_REMOTE="$(awk '/^# BASTION_HOST_REMOTE:/ {print $3}' "${_f}")"
138132
SOURCE_HOST_REMOTE="$(awk '/^# SOURCE_HOST_REMOTE:/ {print $3}' "${_f}")"
139133
SOURCE_DOMAIN="$(awk '/^# SOURCE_DOMAIN:/ {print $3}' "${_f}")"
140134
SOURCE_DB_FILE="$(awk '/^# SOURCE_DB_FILE:/ {print $3}' "${_f}")"

0 commit comments

Comments
 (0)