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
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
14
14
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
+
```
18
26
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
20
28
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
+
```
26
32
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.
28
34
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:
32
37
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:
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
+
```
96
41
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:
98
43
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
+
```
100
62
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.
106
64
107
-
Click Install WordPress.
65
+
* Rename the created certs to `cert.pem` and `cert-key.pem`.
108
66
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.
110
68
111
-
```json
112
-
{
113
-
"url": "http://local.api.jquery.com",
114
-
"username": "dev",
115
-
"password": "dev"
116
-
}
117
-
```
69
+
1. Construct the database.
118
70
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
120
72
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:
# 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:
128
94
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
+
```
131
98
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.`.
133
100
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:
140
102
141
-
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.
103
+
- Site Title: Any (e.g., "jQuery")
104
+
- Username: Any
105
+
- Password: Any
106
+
- Your Email: Any email address
107
+
- Search Engine Visibility: Uncheck
142
108
143
-
```sh
144
-
ssh wpblogs-01.ops.jquery.net
109
+
Click Install WordPress.
145
110
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.
Replace the `url` with the site you are testing. The `dev` user is automatically created by this repo's wp-config.php.
157
122
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.
# 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.
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