Skip to content

Commit 69cb14f

Browse files
committed
fixup! use auto-numbering for ol list
1 parent c61348e commit 69cb14f

File tree

1 file changed

+133
-129
lines changed

1 file changed

+133
-129
lines changed

README.md

Lines changed: 133 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -6,163 +6,167 @@ This repo has the necessary setup for running [jquery-wp-content](https://github
66

77
1. Clone this repo and its submodules
88

9-
```sh
10-
git clone --recursive git@github.com:jquery/jquery-wp-docker.git
11-
```
9+
```sh
10+
git clone --recursive git@github.com:jquery/jquery-wp-docker.git
11+
```
1212

13-
2. Copy the wp-config-sample.php file to wp-config.php
13+
1. Copy the wp-config-sample.php file to wp-config.php
1414

15-
```sh
16-
cp wp-config-sample.php wp-config.php
17-
```
15+
```sh
16+
cp wp-config-sample.php wp-config.php
17+
```
18+
19+
1. Edit the wp-config.php file and set unique keys and salts using https://api.wordpress.org/secret-key/1.1/salt/. Do NOT change the `DB_` defines.
20+
21+
```php
22+
define('AUTH_KEY', 'put your unique phrase here');
23+
define('SECURE_AUTH_KEY', 'put your unique phrase here');
24+
// etc.
25+
```
1826

19-
3. Edit the wp-config.php file and set unique keys and salts using https://api.wordpress.org/secret-key/1.1/salt/. Do NOT change the `DB_` defines.
27+
1. Copy .env.example to .env and edit the file to define database credentials
2028

21-
```php
22-
define('AUTH_KEY', 'put your unique phrase here');
23-
define('SECURE_AUTH_KEY', 'put your unique phrase here');
24-
// etc.
25-
```
29+
```sh
30+
cp .env.example .env
31+
```
2632

27-
4. Copy .env.example to .env and edit the file to define database credentials
33+
1. Optionally, add local SSL certs to the `ssl` directory.
2834

29-
```sh
30-
cp .env.example .env
31-
```
35+
* If you don't have any, you can generate them using [mkcert](https://github.com/FiloSottile/mkcert).
36+
Run the following:
3237
33-
5. Optionally, add local SSL certs to the `ssl` directory.
34-
35-
* If you don't have any, you can generate them using [mkcert](https://github.com/FiloSottile/mkcert).
36-
Run the following:
37-
38-
```sh
39-
mkcert -install
40-
```
41-
42-
* Then, in the `ssl` directory, run:
43-
```sh
44-
mkcert \
45-
local.jquery.com \
46-
local.api.jquery.com \
47-
local.blog.jquery.com \
48-
local.learn.jquery.com \
49-
local.releases.jquery.com \
50-
local.jqueryui.com \
51-
local.api.jqueryui.com \
52-
local.blog.jqueryui.com \
53-
local.jquerymobile.com \
54-
local.api.jquerymobile.com \
55-
local.blog.jquerymobile.com \
56-
local.jquery.org \
57-
local.brand.jquery.org \
58-
local.contribute.jquery.org \
59-
local.meetings.jquery.org
60-
```
61-
Wildcards don't work for multi-level subdomains. Add each site to the list of domains.
62-
63-
* Rename the created certs to `cert.pem` and `cert-key.pem`.
64-
65-
6. Run `docker compose up --build` to start the containers.
66-
67-
7. Construct the database.
68-
69-
### Outside contributors
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:
72-
73-
| Site | Database Name |
74-
|------|---------------|
75-
| jquery.com | wordpress_jquery_com |
76-
| api.jquery.com | wordpress_api_jquery_com |
77-
| blog.jquery.com | wordpress_blog_jquery_com |
78-
| learn.jquery.com | wordpress_learn_jquery_com |
79-
| releases.jquery.com | wordpress_releases_jquery_com |
80-
| jqueryui.com | wordpress_jqueryui_com |
81-
| api.jqueryui.com | wordpress_api_jqueryui_com |
82-
| blog.jqueryui.com | wordpress_blog_jqueryui_com |
83-
| jquerymobile.com | wordpress_jquerymobile_com |
84-
| api.jquerymobile.com | wordpress_api_jquerymobile_com |
85-
| blog.jquerymobile.com | wordpress_blog_jquerymobile_com |
86-
| jquery.org | wordpress_jquery_org |
87-
| brand.jquery.org | wordpress_brand_jquery_org |
88-
| contribute.jquery.org | wordpress_contribute_jquery_org |
89-
| meetings.jquery.org | wordpress_meetings_jquery_org |
90-
91-
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:
92-
93-
```sh
94-
'CREATE DATABASE IF NOT EXISTS wordpress_api_jquery_com;' | docker exec -i jquerydb mysql -u root -proot
95-
```
38+
```sh
39+
mkcert -install
40+
```
9641
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.`.
42+
* Then, in the `ssl` directory, run:
9843
99-
Fill in the form with the following information:
44+
```sh
45+
mkcert \
46+
local.jquery.com \
47+
local.api.jquery.com \
48+
local.blog.jquery.com \
49+
local.learn.jquery.com \
50+
local.releases.jquery.com \
51+
local.jqueryui.com \
52+
local.api.jqueryui.com \
53+
local.blog.jqueryui.com \
54+
local.jquerymobile.com \
55+
local.api.jquerymobile.com \
56+
local.blog.jquerymobile.com \
57+
local.jquery.org \
58+
local.brand.jquery.org \
59+
local.contribute.jquery.org \
60+
local.meetings.jquery.org
61+
```
10062
101-
- Site Title: Any (e.g., "jQuery")
102-
- Username: Any
103-
- Password: Any
104-
- Your Email: Any email address
105-
- Search Engine Visibility: Uncheck
63+
Wildcards don't work for multi-level subdomains. Add each site to the list of domains.
10664

107-
Click Install WordPress.
65+
* Rename the created certs to `cert.pem` and `cert-key.pem`.
10866

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:
67+
1. Run `docker compose up --build` to start the containers.
11068

111-
```json
112-
{
113-
"url": "http://local.api.jquery.com",
114-
"username": "dev",
115-
"password": "dev"
116-
}
117-
```
69+
1. Construct the database.
11870

119-
Replace the `url` with the site you are testing. The `dev` user is automatically created by this repo's wp-config.php.
71+
#### Outside contributors
12072

121-
After a successful deployment, visit http://local.api.jquery.com to see the site, or https://local.api.jquery.com if you created certs.
73+
You do not need to be on the jQuery Infrastructure Team 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:
12274

123-
### Infrastructure team members only
75+
| Site | Database Name |
76+
|------|---------------|
77+
| jquery.com | wordpress_jquery_com |
78+
| api.jquery.com | wordpress_api_jquery_com |
79+
| blog.jquery.com | wordpress_blog_jquery_com |
80+
| learn.jquery.com | wordpress_learn_jquery_com |
81+
| releases.jquery.com | wordpress_releases_jquery_com |
82+
| jqueryui.com | wordpress_jqueryui_com |
83+
| api.jqueryui.com | wordpress_api_jqueryui_com |
84+
| blog.jqueryui.com | wordpress_blog_jqueryui_com |
85+
| jquerymobile.com | wordpress_jquerymobile_com |
86+
| api.jquerymobile.com | wordpress_api_jquerymobile_com |
87+
| blog.jquerymobile.com | wordpress_blog_jquerymobile_com |
88+
| jquery.org | wordpress_jquery_org |
89+
| brand.jquery.org | wordpress_brand_jquery_org |
90+
| contribute.jquery.org | wordpress_contribute_jquery_org |
91+
| meetings.jquery.org | wordpress_meetings_jquery_org |
12492

125-
```sh
126-
# You need SSH admin access to this production server
127-
ssh wp-05.ops.jquery.net
93+
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:
12894

129-
sudo -u tarsnap mysqldump --databases `sudo -u tarsnap mysql -B -N -e "SHOW DATABASES LIKE 'wordpress_%'"` > wordpress.sql
130-
```
95+
```sh
96+
'CREATE DATABASE IF NOT EXISTS wordpress_api_jquery_com;' | docker exec -i jquerydb mysql -u root -proot
97+
```
13198

132-
Then, on your local machine, run:
99+
Then, finish installing WordPress by visiting the appropriate install URL for that site, such as http://local.api.jquery.com/wp-admin/install.php. Make sure the address begins with `local.`.
133100

134-
```sh
135-
# Copy the SQL dump from your home directory on the server (as created by the previous command)
136-
# NOTE: There must be no space between -p and the password!
137-
scp -C wp-05.ops.jquery.net:~/wordpress.sql .
138-
docker exec -i jquerydb mysql -u root -proot < wordpress.sql
139-
```
101+
Fill in the form with the following information:
140102

141-
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 databases 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.
103+
- Site Title: Any (e.g., "jQuery")
104+
- Username: Any
105+
- Password: Any
106+
- Your Email: Any email address
107+
- Search Engine Visibility: Uncheck
142108

143-
```sh
144-
ssh wpblogs-01.ops.jquery.net
109+
Click Install WordPress.
145110

146-
# Export wordpress_jquery, and import as wordpress_blog_jquery_com.
147-
# Use --no-create-db to omit DB name during export, so we can set expected name during import.
148-
sudo -u tarsnap mysqldump -p wordpress_jquery --no-create-db > wordpress_blog_jquery_com.sql;
149-
sudo -u tarsnap mysqldump -p wordpress_jqueryui --no-create-db > wordpress_blog_jqueryui_com.sql;
150-
sudo -u tarsnap mysqldump -p wordpress_jquerymobile --no-create-db > wordpress_blog_jquerymobile_com.sql;
151-
```
111+
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:
152112

153-
And then locally:
113+
```json
114+
{
115+
"url": "http://local.api.jquery.com",
116+
"username": "dev",
117+
"password": "dev"
118+
}
119+
```
154120

155-
```sh
156-
scp -C wpblogs-01.ops.jquery.net:wordpress_blog_{jquery_com,jqueryui_com,jquerymobile_com}.sql .
121+
Replace the `url` with the site you are testing. The `dev` user is automatically created by this repo's wp-config.php.
157122
158-
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
123+
After a successful deployment, visit http://local.api.jquery.com to see the site, or https://local.api.jquery.com if you created certs.
159124
160-
docker exec -i jquerydb mysql -u root -proot --database wordpress_blog_jquery_com < wordpress_blog_jquery_com.sql;
161-
docker exec -i jquerydb mysql -u root -proot --database wordpress_blog_jqueryui_com < wordpress_blog_jqueryui_com.sql;
162-
docker exec -i jquerydb mysql -u root -proot --database wordpress_blog_jquerymobile_com < wordpress_blog_jquerymobile_com.sql;
163-
```
125+
---
126+
127+
#### Infrastructure team members only
128+
129+
```sh
130+
# You need SSH admin access to this production server
131+
ssh wp-05.ops.jquery.net
132+
133+
sudo -u tarsnap mysqldump --databases `sudo -u tarsnap mysql -B -N -e "SHOW DATABASES LIKE 'wordpress_%'"` > wordpress.sql
134+
```
135+
136+
Then, on your local machine, run:
137+
138+
```sh
139+
# Copy the SQL dump from your home directory on the server (as created by the previous command)
140+
# NOTE: There must be no space between -p and the password!
141+
scp -C wp-05.ops.jquery.net:~/wordpress.sql .
142+
docker exec -i jquerydb mysql -u root -proot < wordpress.sql
143+
```
144+
145+
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 databases 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.
146+
147+
```sh
148+
ssh wpblogs-01.ops.jquery.net
149+
150+
# Export wordpress_jquery, and import as wordpress_blog_jquery_com.
151+
# Use --no-create-db to omit DB name during export, so we can set expected name during import.
152+
sudo -u tarsnap mysqldump -p wordpress_jquery --no-create-db > wordpress_blog_jquery_com.sql;
153+
sudo -u tarsnap mysqldump -p wordpress_jqueryui --no-create-db > wordpress_blog_jqueryui_com.sql;
154+
sudo -u tarsnap mysqldump -p wordpress_jquerymobile --no-create-db > wordpress_blog_jquerymobile_com.sql;
155+
```
156+
157+
And then locally:
158+
159+
```sh
160+
scp -C wpblogs-01.ops.jquery.net:wordpress_blog_{jquery_com,jqueryui_com,jquerymobile_com}.sql .
161+
162+
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
163+
164+
docker exec -i jquerydb mysql -u root -proot --database wordpress_blog_jquery_com < wordpress_blog_jquery_com.sql;
165+
docker exec -i jquerydb mysql -u root -proot --database wordpress_blog_jqueryui_com < wordpress_blog_jqueryui_com.sql;
166+
docker exec -i jquerydb mysql -u root -proot --database wordpress_blog_jquerymobile_com < wordpress_blog_jquerymobile_com.sql;
167+
```
164168
165-
Then visit http://local.api.jquery.com, or https://local.api.jquery.com if you created certs.
169+
Then visit http://local.api.jquery.com, or https://local.api.jquery.com if you created certs.
166170
167171
## Updating
168172

0 commit comments

Comments
 (0)