Skip to content

Commit 5481f6f

Browse files
committed
updated readme
1 parent 08bae59 commit 5481f6f

1 file changed

Lines changed: 70 additions & 79 deletions

File tree

README.md

Lines changed: 70 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Automated set up utilities for WordPress.
1+
Automated set up utilities for [WordPress].
22

33
WordPress is set up with a non-root user.
44

@@ -9,107 +9,98 @@ Volumes for the docroot and wp-content/uploads directories are configured.
99
To automatically setup WP use two containers:
1010

1111
# docker-compose.yml
12-
# This one runs the cron service and contains the 'data' volumes
13-
wp-cli:
14-
image: nickbreen/wp-cli
15-
16-
# This one runs the setup script and then terminates.
17-
wp-setup:
12+
setup:
1813
image: nickbreen/wp-setup
19-
command: |-
20-
. /setup.sh
21-
install_core
22-
install_themes
23-
install_plugins
24-
wp_options
25-
wp_commands
26-
volumes_from:
27-
- wp-cli
2814
environment:
2915
# yadda, see below
3016

17+
The installation is hardcoded to `/var/www`.
18+
3119
# Configuration
3220

3321
The database configuration can be specified explicitly with:
3422

35-
- ```WP_DB_HOST```
36-
- ```WP_DB_PORT```
37-
- ```WP_DB_NAME```
38-
- ```WP_DB_USER```
39-
- ```WP_DB_PASSWORD```
40-
- ```WP_DB_PREFIX```
23+
- `WP_DB_HOST`
24+
- `WP_DB_PORT`
25+
- `WP_DB_NAME`
26+
- `WP_DB_USER`
27+
- `WP_DB_PASSWORD`
28+
- `WP_DB_PREFIX`
4129

42-
If any are omitted then values are inferred from the linked ```:mysql``` container, otherwise sensible defaults are used.
30+
If any are omitted then values are inferred from the linked ```:mysql```
31+
container, otherwise sensible defaults are used.
4332

4433
Variable | Value inferred from | Default
4534
-------------------- | ------------------------------ | ---------
46-
```WP_DB_NAME``` | ```MYSQL_ENV_MYSQL_DATABASE``` | wordpress
47-
```WP_DB_USER``` | ```MYSQL_ENV_MYSQL_USER``` | wordpress
48-
```WP_DB_PASSWORD``` | ```MYSQL_ENV_MYSQL_PASSWORD``` | wordpress
49-
```WP_DB_HOST``` | ```MYSQL_PORT_3306_TCP_ADDR``` | mysql
50-
```WP_DB_PORT``` | ```MYSQL_PORT_3306_TCP_PORT``` | 3306
51-
```WP_DB_PREFIX``` | N/A | wp_
35+
`WP_DB_NAME` | `MYSQL_ENV_MYSQL_DATABASE` | wordpress
36+
`WP_DB_USER` | `MYSQL_ENV_MYSQL_USER` | wordpress
37+
`WP_DB_PASSWORD` | `MYSQL_ENV_MYSQL_PASSWORD` | wordpress
38+
`WP_DB_HOST` | `MYSQL_PORT_3306_TCP_ADDR` | mysql
39+
`WP_DB_PORT` | `MYSQL_PORT_3306_TCP_PORT` | 3306
40+
`WP_DB_PREFIX` | N/A | wp_
5241

53-
```--extra-php``` is supported with the ```WP_EXTRA_PHP``` environment variable. E.g.
42+
`--extra-php` is supported with the `WP_EXTRA_PHP` environment variable. E.g.
5443

5544
WP_EXTRA_PHP: |
5645
define('DISABLE_WP_CRON', true);
5746

5847
## Installation
5948

60-
The initial DB is installed, if not already installed in the DB, using the variables; each has a useless default value, so make sure you set them:
61-
- ```WP_LOCALE``` (default ```en_NZ```)
62-
- ```WP_URL```
63-
- ```WP_TITLE```
64-
- ```WP_ADMIN_USER```
65-
- ```WP_ADMIN_PASSWORD```
66-
- ```WP_ADMIN_EMAIL```
67-
68-
## Themes and Plugins
69-
70-
Themes and plugins can be installed from the WordPress.org repository, from a URL to the theme's or plugin's ZIP file. I.e.:
71-
72-
Each theme or plugin is on its own line.
73-
74-
WP_THEMES: |
75-
theme-slug
76-
http://theme.domain/theme-url.zip
77-
78-
WP_PLUGINS: |
79-
plugin-slug
80-
https://plugin.domain/plugin-url.zip
49+
The initial DB is installed, if not already installed in the DB, using the
50+
following variables; the setup script will complain if any are unset.
8151

82-
Themes and plugins can also be installed from [Bitbucket] (OAuth 1.0a supported for private repositories) and [GitHub] (HTTP Basic Auth using personal access tokens for private repositories):
52+
- `WP_LOCALE` (default `en_NZ`)
53+
- `WP_URL`
54+
- `WP_TITLE`
55+
- `WP_ADMIN_USER`
56+
- `WP_ADMIN_PASSWORD`
57+
- `WP_ADMIN_EMAIL`
8358

84-
BB_KEY: "BitBucket API OAuth Key"
85-
BB_SECRET: "BitBucket API OAuth Secret"
86-
BB_PLUGINS: |
87-
account/repo [tag]
88-
BB_THEMES: |
89-
account/repo [tag]
90-
GH_TOKEN: username:token
91-
GH_THEME: |
92-
CherryFramework/CherryFramework
93-
94-
[Bitbucket]: https://bitbucket.com "Bitbucket"
95-
[GitHub]: https://github.com "GitHub"
96-
97-
## Options
98-
99-
Any WordPress options can be set as JSON using ```WP_OPTIONS```. E.g.
100-
101-
WP_OPTIONS: |
102-
timezone_string "Pacific/Auckland"
103-
some_complex_option {"access_key_id":"...","secret_access_key":"..."}
104-
105-
Simple strings must be quoted.
59+
## Arbitrary WP-CLI Commands
10660

107-
To set non-JSON options, use ```WP_COMMANDS```.
61+
Any arbitrary WP-CLI commands can be executed, actually any commands as the
62+
value is processed by `sh`. Any environment variable prefixed with `WP_COMMANDS`
63+
will be processed.
64+
65+
WP_COMMANDS_0: |
66+
wp plugin activate --network jetpack
67+
WP_COMMANDS_1: |
68+
wp site create --slug=site1 --title="Site 1"
69+
wp --url=http://site1.example.com rewrite structure /%postname%
70+
wp --url=http://site1.example.com rewrite flush
71+
WP_COMMANDS_2: |
72+
wp site create --slug=site2 --title="Site 2"
73+
wp --url=http://site2.example.com rewrite structure /%postname%
74+
wp --url=http://site2.example.com rewrite flush
75+
WP_COMMANDS_3: |
76+
wp site create --slug=site3 --title="Site 3"
77+
wp --url=http://site3.example.com rewrite structure /%postname%
78+
wp --url=http://site3.example.com rewrite flush
10879

109-
## Arbitrary WP-CLI Commands
80+
## Themes and Plugins
11081

111-
Any WP-CLI command can be executed; e.g.:
82+
Themes and plugins can be installed from the WordPress.org repository, from a
83+
URL to the theme's or plugin's ZIP file using `WP_COMMANDS`; e.g.:
11284

11385
WP_COMMANDS: |
114-
rewrite structure /%postname%
115-
rewrite flush
86+
wp theme install theme-slug --version=1.2.3
87+
wp theme install http://example.com/theme.zip --activate
88+
wp plugin install plugin-slug --version=1.2.3
89+
wp plugin install https://example.com/plugin.zip
90+
91+
Themes and plugins can also be installed from [Bitbucket] (OAuth 1.0a supported
92+
for private repositories) and [GitHub] (HTTP Basic Auth using personal access
93+
tokens for private repositories); e.g.:
94+
95+
WP_COMMANDS: |
96+
wp github theme install CherryFramework/CherryFramework v3.1.5
97+
wp github theme install CherryFramework/CherryFramework v3.1.5 --token=XXXXX
98+
wp bitbucket plugin install CherryFramework/cherry-plugin v3.1.5
99+
wp bitbucket plugin install CherryFramework/cherry-plugin v3.1.5 --key=XXXX --secret=XXXXXX
100+
101+
For both GitHub and Bitbucket the version/release tag is optional and defaults
102+
to the `latest` release, or if no releases exist, to `master`.
103+
104+
[Bitbucket]: https://bitbucket.com
105+
[GitHub]: https://github.com
106+
[WordPress]: https://wordpress.org

0 commit comments

Comments
 (0)