Skip to content

Commit 8234aab

Browse files
committed
Merge branch 'develop' for v1.0.0-beta.1
2 parents cb7dd9d + c80a0e2 commit 8234aab

21 files changed

+2315
-1
lines changed

.distignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.DS_Store
2+
.git
3+
.gitignore
4+
.gitlab-ci.yml
5+
.editorconfig
6+
.travis.yml
7+
behat.yml
8+
circle.yml
9+
bin/
10+
features/
11+
utils/
12+
*.zip
13+
*.tar.gz
14+
*.swp
15+
*.txt
16+
*.log

.editorconfig

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# https://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[{.jshintrc,*.json,*.yml,*.feature}]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[{*.txt,wp-config-sample.php}]
21+
end_of_line = crlf
22+
23+
[composer.json]
24+
indent_style = space
25+
indent_size = 4

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
wp-cli.local.yml
3+
node_modules/
4+
vendor/
5+
*.zip
6+
*.tar.gz
7+
*.swp
8+
*.txt
9+
*.log
10+
composer.lock
11+
.idea
12+
*.db

.travis.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
sudo: required
2+
3+
language: php
4+
php: 7.0
5+
6+
env:
7+
global:
8+
- TEST_COMMAND=$(echo $TRAVIS_REPO_SLUG | cut -d/ -f 2) # Get command name to be tested
9+
10+
before_script:
11+
- |
12+
# Remove Xdebug for a huge performance increase:
13+
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
14+
phpenv config-rm xdebug.ini
15+
else
16+
echo "xdebug.ini does not exist"
17+
fi
18+
- ./ci/prepare.sh
19+
- ./ci/add-test-certs.sh
20+
21+
script:
22+
- cd "$TRAVIS_BUILD_DIR/../easyengine"
23+
- sudo ./vendor/bin/behat
24+
25+
after_script:
26+
- cat /opt/easyengine/ee.log
27+
28+
cache:
29+
directories:
30+
- $HOME/.composer/cache
31+
32+
notifications:
33+
email:
34+
on_success: never
35+
on_failure: change

README.md

+108-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,108 @@
1-
# site-wp-command
1+
# EasyEngine/site-wp-command
2+
3+
Performs basic site functions in easyengine.
4+
5+
`site` command contains following subcommand
6+
* [create](#create)
7+
* [delete](#delete)
8+
* [disable](#disable)
9+
* [enable](#enable)
10+
* [info](#info)
11+
* [list](#list)
12+
* [up](#up)
13+
* [down](#down)
14+
* [restart](#restart)
15+
* [reload](#reload)
16+
17+
## create
18+
Runs the site creation.
19+
20+
```bash
21+
ee site create example.com # install wordpress without any page caching (default)
22+
ee site create example.com --type=wp # install wordpress without any page caching
23+
ee site create example.com --type=wp --cache # install wordpress with page caching
24+
ee site create example.com --type=wp --mu=wpsubdir # install wpmu-subdirectory without any page caching
25+
ee site create example.com --type=wp --mu=wpsubdir --cache # install wpmu-subdirectory with page caching
26+
ee site create example.com --type=wp --mu=subdom # install wpmu-subdomain without any page caching
27+
ee site create example.com --type=wp --mu=subdom --cache # install wpmu-subdomain with page cache
28+
```
29+
30+
Let's Encrypt SSL
31+
```bash
32+
# Enable SSL using Let’s Encrypt (You can add --letsencrypt along with any other flag.)
33+
ee site create example.com --type=wp [--letsencrypt|--le]
34+
ee site create example.com --type=wp --le # install wordpress without any page caching + letsencrypt ssl
35+
ee site create example.com --type=wp --cache --le # install wordpress with page caching + letsencrypt ssl
36+
ee site create example.com --type=wp --mu=subdom --le # install wordpress wpmu-subdomain + wildcard letsencrypt ssl
37+
```
38+
39+
## delete
40+
Deletes an existing EasyEngine site including the webroot and the database.
41+
42+
```bash
43+
ee site delete example.com # Asks for confirmation.
44+
ee site delete example.com --yes # Skips the confirmation prompt.
45+
```
46+
47+
## disable
48+
Disables a website. It will stop all containers which will free up resources used by this site. The site's data stored in the disk will still be safe.
49+
50+
```bash
51+
ee site disable example.com
52+
```
53+
54+
## enable
55+
Enables a website. It will start the docker containers of the website if they are stopped.
56+
57+
```bash
58+
ee site enable example.com
59+
```
60+
61+
## info
62+
Display all the relevant site information, credentials and useful links.
63+
64+
```bash
65+
ee site info example.com
66+
```
67+
68+
## list
69+
Lists the created websites.
70+
71+
```bash
72+
ee site list # Lists all sites (default: tabular format)
73+
ee site list --format=[count|csv|json|table|text|yaml] # Lists all sites in a particular format
74+
ee site list --enabled # List enabled sites
75+
ee site list --disabled # List disabled sites
76+
```
77+
78+
## up
79+
Starts services associated with site.
80+
81+
```bash
82+
ee site up example.com # Defaults to all services
83+
ee site up example.com --nginx
84+
```
85+
86+
## down
87+
Stops services associated with site.
88+
89+
```bash
90+
ee site down example.com # Defaults to all services
91+
ee site down example.com --mailhog
92+
```
93+
94+
## restart
95+
Restarts containers associated with site. This action will have a few seconds of downtime.
96+
97+
```bash
98+
ee site restart example.com # Defaults to all services
99+
ee site restart example.com --nginx
100+
```
101+
102+
## reload
103+
Reload services in containers without restarting container(s) associated with site.
104+
105+
```bash
106+
ee site reload example.com # Defaults to all services
107+
ee site reload example.com --nginx
108+
```

ci/add-test-certs.sh

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/usr/bin/env bash
2+
sudo mkdir -p /opt/easyengine/nginx/certs
3+
4+
cat <<EOF | sudo tee /opt/easyengine/nginx/certs/example2.test.crt
5+
-----BEGIN CERTIFICATE-----
6+
MIIDAzCCAeugAwIBAgIJAOfjYN/2twJzMA0GCSqGSIb3DQEBBQUAMBgxFjAUBgNV
7+
BAMMDWV4YW1wbGUyLnRlc3QwHhcNMTgwNzEzMDgyMzEwWhcNMjgwNzEwMDgyMzEw
8+
WjAYMRYwFAYDVQQDDA1leGFtcGxlMi50ZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOC
9+
AQ8AMIIBCgKCAQEA4nSZucxge7AoPQAT9x6q9wd99/Of/5Pg9wimq9F/hI41jKT/
10+
Go24Cjz4+qlBk1vhT9huGfGPvtU939mkEdbtuvYX1qft2LEDK/TAUFtJCXEz/qKP
11+
ndFWyFhOxcKaD8lsbBW9ZuE+qK1Zjc2x4LKESmi6dAk0fgcIKxy8o1C3hFVnW8Mi
12+
A1bzlrTZMJl9McFaLGjtEkIBAXdk0Z9xA7Vl29AWXBkRR16WpEDhxPIR5s4qKiqv
13+
1I32Xaeh7R8NVIm+glMfo4C+b03/hdt6FmDvmvoKjBuFOs8156NMShIeYrzOxv18
14+
wJTLrJXYVjiUDylcaTZhP0a1xp3feOPweS+7gwIDAQABo1AwTjAdBgNVHQ4EFgQU
15+
YhlFd4zw174kiNnDQM39QS5fkk0wHwYDVR0jBBgwFoAUYhlFd4zw174kiNnDQM39
16+
QS5fkk0wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAk3b7fwUkG1P+
17+
9SzU+BGXBy/VjMeCqtraZSeKKHBnqZK1AsL7osXY+/k2k5VMZNfHyOjATCpwNc06
18+
rhK115aHKcMpzNfaogN1xwb4/TWzC7pp9QNFJkDsIKxPBa9aYuSBlvXfKK1BOS49
19+
XaNC5cOdqNV5kJOU3zSqYu0P5M65rRnUQwaOvOtqknxAgsVQcfzQVfl3vFSlGMcA
20+
qlKifxwYo77dUp2rucY418bh2sFUIzaIFiB2cxqfOkDa70RSye5aJStvG4mxImAF
21+
WlZrjFDu7AwkoQSD0rkwSoOwEmrwXAAjlfGueDIq/bBLPiTptPy3zIyutT0JHV2b
22+
lgkJtDRf0A==
23+
-----END CERTIFICATE-----
24+
EOF
25+
26+
cat <<EOF | sudo tee /opt/easyengine/nginx/certs/example2.test.key
27+
28+
-----BEGIN RSA PRIVATE KEY-----
29+
MIIEogIBAAKCAQEA4nSZucxge7AoPQAT9x6q9wd99/Of/5Pg9w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tzIcCgYAT9a2B44k/RDD5flSEsBW4
46+
e6071n26BwjjC/ZDpU2X2XCqCBZ2ZPCndXY8QpIZW9vObGohwwgD04JdjCg8Kx1O
47+
MZq4CmoPtnO8Vm10lduN691GOwu042rpmMBdQnEPTsJ+wduaUTAo9IhfySHe8rS0
48+
x4r8WBATEMCO7kKFwZwgKQKBgG6lGeipAOVB5xp3kqSry4b1UGBMTDtfw7ey57NX
49+
4Al8ihcO71qN9eFG1MY3xMnPr/nw4ydlhrbMPGiOjx6Y+ev4y0yzJ++Jij+G9Sem
50+
kV5CiTQa48mHtOPgKer7DtAdCpeiQqU/u8y0mas8rJbK9yBnuWHZff7ohWu9ehka
51+
RRAbAoGAa+qjNQapv6XCNeAmunhDgMBzRZhTLZrLSvdNflenEuMpkgrkHbgJJnrG
52+
Yvr8i0kojvoKofYPoqvno/S5ZM2QLIVCP28HkXhVSv63doMm3pcibiAagHpNYLa9
53+
4uwN640uFpqt7JCSOlJP7w4zx5BKXU9D9FRwri7QivBpmBHpVLk=
54+
-----END RSA PRIVATE KEY-----
55+
EOF
56+
57+
cat <<EOF | sudo tee /opt/easyengine/nginx/certs/www.example3.test.crt
58+
-----BEGIN CERTIFICATE-----
59+
MIIDAzCCAeugAwIBAgIJAJo9QUktB2TOMA0GCSqGSIb3DQEBBQUAMBgxFjAUBgNV
60+
BAMMDWV4YW1wbGUzLnRlc3QwHhcNMTgwNzEzMDgyMjUxWhcNMjgwNzEwMDgyMjUx
61+
WjAYMRYwFAYDVQQDDA1leGFtcGxlMy50ZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOC
62+
AQ8AMIIBCgKCAQEAxjI414PGPUf9aRSmjVywFHMHLhJGF1+Lg3YimM9fKo1WqD4T
63+
2mepdV9zOztUCGrszMNcpaltjf8nTSuNwEWUp9TQYufABavN3TvzNWnmT3Q5NIA0
64+
2v6SZVQUEskWwoDOqhudH8D6/Dk4m449UMKrN2VD3A61T6TtlkbiX6lX2e/8UfSH
65+
ECFZP/xAh68l/XgcsI46tfvBPDdQdSDYhFxIhRqWevOT2FVQjR63yL6uZ96SeiIH
66+
sntxjBnqaYTYwgN5Bjv1vbJwHqOMhZNnquVfxh/+EOd/gBQKBWiavC5HmjnVbjyT
67+
6V9GiGBMsdRfjf/pNjIaqjXMYyIEtFm2/SSaIQIDAQABo1AwTjAdBgNVHQ4EFgQU
68+
nrOjZu9o7IznjL5JHADGu/VLB7UwHwYDVR0jBBgwFoAUnrOjZu9o7IznjL5JHADG
69+
u/VLB7UwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAqhW1cDx4Owrj
70+
EUJkyKBxT6aDtWUdSP7SAvfl4pRz3wdpTT6TWc6t0s3X81tRYSX3on4L4dzfpp2/
71+
/Hgz6LlBIQ9thznE7WnUDE7VR6A0+Grc4po2Vq20z52LGzff/yKWx3PSVjL0f/IL
72+
HZ2t5YpI36nHNcJFEJWlckPkcDa8tX5tsDFr50luCsvuZBGYu6pnLWEZumL/QdHC
73+
UVMAKtWZxf9Via6aIKqsUNdBwq7gHdiZFYyi8NSCX2yD06LtIjBzDTn9Qsch6hSD
74+
utaxR66cXq8laVwyHc+Z+HkG/Y7GytDdKGYUTPB/lIhqpMrJJDcJLJz10yR8zBub
75+
ZLuoQMvF5Q==
76+
-----END CERTIFICATE-----
77+
EOF
78+
cat <<EOF | sudo tee /opt/easyengine/nginx/certs/www.example3.test.key
79+
-----BEGIN RSA PRIVATE KEY-----
80+
MIIEogIBAAKCAQEAxjI414PGPUf9aRSmjVywFHMHLhJGF1+Lg3YimM9fKo1WqD4T
81+
2mepdV9zOztUCGrszMNcpaltjf8nTSuNwEWUp9TQYufABavN3TvzNWnmT3Q5NIA0
82+
2v6SZVQUEskWwoDOqhudH8D6/Dk4m449UMKrN2VD3A61T6TtlkbiX6lX2e/8UfSH
83+
ECFZP/xAh68l/XgcsI46tfvBPDdQdSDYhFxIhRqWevOT2FVQjR63yL6uZ96SeiIH
84+
sntxjBnqaYTYwgN5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lzhz
100+
e5h0J+ldeMOUc3YfEiEVukVmuNpape6qeS8nQvgHG4CLqGSS826o45TLSjWZjvgr
101+
vwv2fs4XJyq0MZsrrGGwPUvLs1dem7d3c2iZ0nrXJ0oq07SyGlIgQ6rM4mlR6aE4
102+
UQv1AoGAPgI7RDJcqXMwG7CyIboLTyPRWsFfhN1nlALP1URK61kAkxgBusg45GEa
103+
k8hTB9lhcWDTbL/GVHn5JWxn8ytLPZiDR2RbJtE/Z1bagROANrFYjqJib8lyFhvt
104+
HYXONl5W77CPrYjOLD+Q9ZXjYYvtAxnqFNXicRMPti7Sre9SkRo=
105+
-----END RSA PRIVATE KEY-----
106+
EOF

ci/prepare.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# called by Travis CI
4+
5+
# install dependencies
6+
wget -qO ee https://rt.cx/ee4beta && sudo bash ee
7+
rm ee
8+
9+
# Setup EE develop repo
10+
cd ..
11+
git clone https://github.com/EasyEngine/easyengine.git easyengine --depth=1
12+
cd easyengine
13+
echo 'travis_test' > VERSION
14+
15+
# Copy tests to EE repo
16+
rm -r features
17+
cp -R ../$TEST_COMMAND/features .
18+
19+
# Install composer dependencies and update them for tests
20+
composer update
21+
22+
# Place the command inside EE repo
23+
sudo rm -r vendor/easyengine/$TEST_COMMAND
24+
cp -R ../$TEST_COMMAND vendor/easyengine/
25+
26+
# Create phar and test it
27+
php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null
28+
sudo php easyengine.phar cli info

composer.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "easyengine/site-wp-command",
3+
"description": "EasyEngine package for WordPress site creation.",
4+
"type": "ee-cli-package",
5+
"homepage": "https://github.com/easyengine/site-wp-command",
6+
"license": "MIT",
7+
"authors": [],
8+
"minimum-stability": "dev",
9+
"prefer-stable": true,
10+
"autoload": {
11+
"psr-4": {
12+
"": "src/"
13+
},
14+
"files": [ "site-wp-command.php" ]
15+
},
16+
"extra": {
17+
"branch-alias": {
18+
"dev-master": "1.x-dev"
19+
},
20+
"bundled": true
21+
}
22+
}

0 commit comments

Comments
 (0)