You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+84-30Lines changed: 84 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,47 +64,101 @@ cp .env.example .env
64
64
65
65
6. Run `docker compose up --build` to start the containers.
66
66
67
-
7. Import the database from a production WordPress instance.
67
+
7. Construct the database.
68
+
69
+
#### All users
70
+
71
+
You do not need to be an infrastructure team member to test jQuery websites. Each site can be deployed after installing wordpress locally, but the database for that site needs to be created first. The database name for each site is listed below:
Select the corresponding database name from the table above for the site you wish to test and run the following command to create the database:
68
92
69
-
```sh
70
-
# You need SSH admin access to this production server
71
-
ssh wp-05.ops.jquery.net
93
+
```sh
94
+
'CREATE DATABASE IF NOT EXISTS wordpress_jquery_com;' | docker exec -i jquerydb mysql -u root -proot
95
+
```
96
+
97
+
Then, visit the local site in your browser to complete the WordPress installation, such as http://local.api.jquery.com/wp-admin/install.php. Make sure the address begins with `local.`.
98
+
99
+
Fill in the form with the following information:
100
+
101
+
- Site Title: Any (e.g., "jQuery")
102
+
- Username: Any
103
+
- Password: Any
104
+
- Your Email: Any email address
105
+
- Search Engine Visibility: Uncheck
106
+
107
+
Click Install WordPress.
108
+
109
+
You should now be able to run `grunt deploy` from the corresponding jQuery site repo. Make sure the repo has a `config.json` with the following:
110
+
111
+
```json
112
+
{
113
+
"url": "http://local.api.jquery.com",
114
+
"username": "dev",
115
+
"password": "dev"
116
+
}
117
+
```
118
+
119
+
Replace the `url` with the site you are testing. The `dev` user is automatically created by this repo's wp-config.php.
72
120
73
-
sudo -u tarsnap mysqldump --databases `sudo -u tarsnap mysql -B -N -e "SHOW DATABASES LIKE 'wordpress_%'"` > wordpress.sql
74
-
```
121
+
#### Infrastructure team members only
75
122
76
-
Then, on your local machine, run:
123
+
```sh
124
+
# You need SSH admin access to this production server
125
+
ssh wp-05.ops.jquery.net
126
+
127
+
sudo -u tarsnap mysqldump --databases `sudo -u tarsnap mysql -B -N -e "SHOW DATABASES LIKE 'wordpress_%'"`> wordpress.sql
128
+
```
77
129
78
-
```sh
79
-
# Copy the SQL dump from your home directory on the server (as created by the previous command)
80
-
# NOTE: There must be no space between -p and the password!
81
-
scp -C wp-05.ops.jquery.net:~/wordpress.sql .
82
-
docker exec -i jquerydb mysql -u root -proot < wordpress.sql
83
-
```
130
+
Then, on your local machine, run:
131
+
132
+
```sh
133
+
# Copy the SQL dump from your home directory on the server (as created by the previous command)
134
+
# NOTE: There must be no space between -p and the password!
135
+
scp -C wp-05.ops.jquery.net:~/wordpress.sql .
136
+
docker exec -i jquerydb mysql -u root -proot < wordpress.sql
137
+
```
84
138
85
-
Optionally, import the blog database as well. This uses a slightly different set of commands because our blogs have a shorter naming convention for their database than the doc sites. This stems from a time that the blogs were in fact native to the jquery.com site and database, and remain internally named as such.
139
+
Optionally, import the blog database as well. This uses a slightly different set of commands because our blogs have a shorter naming convention fortheir databases than the doc sites. This stems from a time that the blogs werein fact native to the jquery.com site and database, and remain internally named as such.
86
140
87
-
```sh
88
-
ssh wpblogs-01.ops.jquery.net
141
+
```sh
142
+
ssh wpblogs-01.ops.jquery.net
89
143
90
-
# Export wordpress_jquery, and import as wordpress_blog_jquery_com.
91
-
# Use --no-create-db to omit DB name during export, so we can set expected name during import.
echo 'CREATE DATABASE IF NOT EXISTS wordpress_blog_jquery_com; CREATE DATABASE IF NOT EXISTS wordpress_blog_jqueryui_com; CREATE DATABASE IF NOT EXISTS wordpress_blog_jquerymobile_com;' | docker exec -i jquerydb mysql -u root -proot
156
+
echo'CREATE DATABASE IF NOT EXISTS wordpress_blog_jquery_com; CREATE DATABASE IF NOT EXISTS wordpress_blog_jqueryui_com; CREATE DATABASE IF NOT EXISTS wordpress_blog_jquerymobile_com;'| docker exec -i jquerydb mysql -u root -proot
0 commit comments