Skip to content

Commit df42f60

Browse files
committed
updated docs and removed proxyjump assumption
1 parent fd8ba7d commit df42f60

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

README.md

+33-19
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Creative Commons Site Reliability Engineering WordPress Data Pull
44

5-
**:warning: Destroys and replaces destination data**
5+
> :warning: **Destroys and replaces destination data**
66
77

88
## Code of Conduct
@@ -14,8 +14,8 @@ Creative Commons Site Reliability Engineering WordPress Data Pull
1414
> behavior to [conduct@creativecommons.org](mailto:conduct@creativecommons.org)
1515
> per our [reporting guidelines][reporting_guide].
1616
17-
[code_of_conduct]:https://creativecommons.github.io/community/code-of-conduct/
18-
[reporting_guide]:https://creativecommons.github.io/community/code-of-conduct/enforcement/
17+
[code_of_conduct]:https://opensource.creativecommons.org/community/code-of-conduct/
18+
[reporting_guide]:https://opensource.creativecommons.org/community/code-of-conduct/enforcement/
1919

2020

2121
## Contributing
@@ -25,14 +25,22 @@ See [`CONTRIBUTING.md`](CONTRIBUTING.md).
2525

2626
## Assumptions
2727

28-
1. Destination web hosting and WordPress are configured independently (ex. by
29-
SaltStack)
30-
- `wp-config.php` is already setup
31-
- user is a member of `www-data`
32-
- [WP-CLI][wp-cli] is installed on the destination host
33-
2. WordPress source data was created using
34-
[/states/wordpress/files/backup_wordpress.sh][backup] found in the
35-
[creativecommons/sre-salt-prime][salt-prime] repository.
28+
1. `DEST_HOST`:
29+
1. Web hosting and WordPress are configured independently (ex. by
30+
SaltStack)
31+
- `wp-config.php` is already setup
32+
- user has appopriate permissions (ex. member of `www-data`)
33+
- [WP-CLI][wp-cli] is already installed
34+
2. You may need to configure your users `.ssh/config`. For example,
35+
`chapters_stage` requires the following entry:
36+
```
37+
Host 10.22.10.14
38+
ProxyJump 10.22.10.10
39+
```
40+
2. `SOURCE_HOST`:
41+
1. WordPress source data was created using
42+
[/states/wordpress/files/backup_wordpress.sh][backup] found in the
43+
[creativecommons/sre-salt-prime][salt-prime] repository.
3644
3745
[wp-cli]: https://wp-cli.org/
3846
[salt-prime]: https://github.com/creativecommons/sre-salt-prime
@@ -41,14 +49,20 @@ See [`CONTRIBUTING.md`](CONTRIBUTING.md).
4149
4250
## Use
4351
44-
1. Optionally, run [`backup_wordpress.sh`][backup] on the source host
45-
2. Clone this repository
46-
3. Make a copy of one of the appropriate [`config_examples/`](config_examples/)
47-
and replace `FILEPATH` and `USERNAME`
48-
4. Execute script with config file as only argument. For example:
49-
```shell
50-
./wp-pull.sh chapters__stage
51-
```
52+
1. `SOURCE_HOST`: *(optional)*
53+
- run [`backup_wordpress.sh`][backup] on the
54+
2. Local/laptop:
55+
1. Clone this repository
56+
2. Prepare configuration file
57+
1. Make a copy of one of the appropriate
58+
[`config_examples/`](config_examples/)
59+
2. Replace `FILEPATH` and `USERNAME` with your information
60+
3. Ensure `SOURCE_DB_FILE` and `SOURCE_UPLOADS_FILE` are valid files on
61+
the `SOURCE_HOST`.
62+
3. Execute script with config file as only argument. For example:
63+
```shell
64+
./wp-pull.sh chapters__stage
65+
```
5266
5367
5468
# Alternatives

bin/wp-pull-remote.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ display_dest_host_info() {
147147
display_source_host_info() {
148148
headerone 'SOURCE_HOST: Info / Connection Validation'
149149
echo -n "${DKG}LABEL:${RST} "
150-
ssh -t -q -oProxyJump=${BASTION_HOST_REMOTE} ${SOURCE_HOST_REMOTE} '
150+
ssh -t -q ${SOURCE_HOST_REMOTE} '
151151
if [[ -f /etc/salt/minion_id ]]
152152
then
153153
cat /etc/salt/minion_id

config_examples/chapters__stage

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# vim: ft=sshconfig
2-
#
31
# The following are parsed by wp-pull.sh:
42
#
53
# DEST_DOMAIN: stage.creativecommons.net
@@ -13,12 +11,11 @@
1311
# SOURCE_UPLOADS_FILE: /var/www/chapters/backup/now/uploads.tgz
1412

1513

16-
#pushconfig
1714
Host bastion-us-east-2
1815
HostName bastion-us-east-2.creativecommons.org
1916

2017

21-
# The wp-pull HostName is the DEST_HOST
18+
# The wp-pull HostName is the DEST_HOST.
2219
Host wp-pull
2320
AddKeysToAgent yes
2421
ForwardAgent yes
@@ -35,3 +32,6 @@ Host *
3532
ServerAliveInterval 30
3633
TCPKeepAlive no
3734
User USERNAME
35+
36+
37+
# vim: ft=sshconfig

0 commit comments

Comments
 (0)