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
18
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.
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
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
-
```
21
+
```php
22
+
define('AUTH_KEY', 'put your unique phrase here');
23
+
define('SECURE_AUTH_KEY', 'put your unique phrase here');
24
+
// etc.
25
+
```
26
26
27
-
4. Copy .env.example to .env and edit the file to define database credentials
27
+
1. Copy .env.example to .env and edit the file to define database credentials
28
28
29
-
```sh
30
-
cp .env.example .env
31
-
```
29
+
```sh
30
+
cp .env.example .env
31
+
```
32
+
33
+
1. 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
+
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
+
```
62
+
63
+
Wildcards don't work for multi-level subdomains. Add each site to the list of domains.
64
+
65
+
* Rename the created certs to `cert.pem` and `cert-key.pem`.
66
+
67
+
1. Run `docker compose up --build` to start the containers.
68
+
69
+
1. Construct the database.
70
+
71
+
#### Outside contributors
72
+
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:
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:
94
+
95
+
```sh
96
+
'CREATE DATABASE IF NOT EXISTS wordpress_api_jquery_com;'| docker exec -i jquerydb mysql -u root -proot
97
+
```
98
+
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.`.
100
+
101
+
Fill in the form with the following information:
102
+
103
+
- Site Title: Any (e.g., "jQuery")
104
+
- Username: Any
105
+
- Password: Any
106
+
- Your Email: Any email address
107
+
- Search Engine Visibility: Uncheck
108
+
109
+
Click Install WordPress.
110
+
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:
112
+
113
+
```json
114
+
{
115
+
"url": "http://local.api.jquery.com",
116
+
"username": "dev",
117
+
"password": "dev"
118
+
}
119
+
```
120
+
121
+
Replace the `url` with the site you are testing. The `dev` user is automatically created by this repo's wp-config.php.
122
+
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.
124
+
125
+
---
32
126
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. Import the database from a production WordPress instance.
127
+
#### Infrastructure team members only
68
128
69
129
```sh
70
130
# You need SSH admin access to this production server
@@ -82,7 +142,7 @@ cp .env.example .env
82
142
docker exec -i jquerydb mysql -u root -proot < wordpress.sql
83
143
```
84
144
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.
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.
0 commit comments