Skip to content

Commit f38931b

Browse files
committed
Merge branch 'develop-v4' into master-v4 for v4.0.0-beta.4
2 parents 11c2df7 + b436ece commit f38931b

File tree

12 files changed

+227
-187
lines changed

12 files changed

+227
-187
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Please attach the output of following command when open a new support request.
1010

1111
```bash
1212
lsb_release -a
13-
ee -v
14-
ee info
13+
ee cli version
14+
ee cli info
1515
wp --allow-root --info
1616
```
1717

.github/ISSUE_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ If you feel the issue is a EasyEngine core specific issue, please attach the out
44

55
System Information
66
- [ ] lsb_release -a
7-
- [ ] ee -v
8-
- [ ] ee info
7+
- [ ] ee cli version
8+
- [ ] ee cli info
99
- [ ] wp --allow-root --info

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ before_install:
1818
1919
install:
2020
- composer install --no-interaction
21+
- sudo ./ci/test-env-install.sh
2122

2223
before_script:
2324
- composer validate
25+
- ./vendor/bin/behat
2426
- ./ci/prepare.sh
2527

2628
jobs:

ci/test-env-install.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
function setup_test_requirements() {
3+
# Adding software-properties-common for add-apt-repository.
4+
apt-get install -y software-properties-common
5+
# Adding ondrej/php repository for installing php, this works for all ubuntu flavours.
6+
add-apt-repository -y ppa:ondrej/php
7+
apt-get update
8+
# Installing php-cli, which is the minimum requirement to run EasyEngine
9+
apt-get -y install php7.2-cli
10+
11+
php_modules=( pcntl curl sqlite3 )
12+
if command -v php > /dev/null 2>&1; then
13+
# Reading the php version.
14+
default_php_version="$(readlink -f /usr/bin/php | gawk -F "php" '{ print $2}')"
15+
for module in "${php_modules[@]}"; do
16+
if ! php -m | grep $module >> $LOG_FILE 2>&1; then
17+
echo "$module not installed. Installing..."
18+
apt install -y php$default_php_version-$module
19+
else
20+
echo "$module is already installed"
21+
fi
22+
done
23+
fi
24+
}
25+
26+
setup_test_requirements

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"php": ">=5.3.29",
2828
"composer/composer": "^1.2.0",
2929
"composer/semver": "~1.0",
30-
"easyengine/site-command": "v1.0.0-beta.3",
30+
"easyengine/cron-command": "v1.0.0-beta.1",
31+
"easyengine/site-command": "v1.0.0",
3132
"easyengine/shell-command": "v1.0.0-beta.1",
3233
"justinrainbow/json-schema": "~5.2.5",
3334
"monolog/monolog": "^1.23",

composer.lock

Lines changed: 67 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

features/bootstrap/FeatureContext.php

Lines changed: 13 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
use Behat\Behat\Hook\Scope\AfterFeatureScope;
88

99

10-
use Behat\Gherkin\Node\PyStringNode,
11-
Behat\Gherkin\Node\TableNode;
10+
use Behat\Gherkin\Node\PyStringNode;
1211

1312
class FeatureContext implements Context
1413
{
@@ -94,88 +93,23 @@ public function stdoutShouldReturnSomethingLike($output_stream, PyStringNode $ex
9493
}
9594

9695
/**
97-
* @Then The :site db entry should be removed
96+
* @Then ee should be deleted
9897
*/
99-
public function theDbEntryShouldBeRemoved($site)
98+
public function eeShouldBeDeleted()
10099
{
101-
$out = shell_exec("sudo bin/ee site list");
102-
if (strpos($out, $site) !== false) {
103-
throw new Exception("$site db entry not been removed!");
100+
$result = EE::launch("docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\" | wc -l", false, true);
101+
if( trim($result->stdout) !== '0' ) {
102+
throw new Exception("All containers have not been removed.");
104103
}
105-
106-
}
107-
108-
/**
109-
* @Then The :site webroot should be removed
110-
*/
111-
public function theWebrootShouldBeRemoved($site)
112-
{
113-
if (file_exists(getenv('HOME') . "/ee-sites/" . $site)) {
114-
throw new Exception("Webroot has not been removed!");
104+
$home = getenv('HOME');
105+
if(file_exists("$home/.ee/")){
106+
throw new Exception("~/.ee/ has not been removed");
115107
}
116-
}
117-
118-
/**
119-
* @Then Following containers of site :site should be removed:
120-
*/
121-
public function followingContainersOfSiteShouldBeRemoved($site, TableNode $table)
122-
{
123-
$containers = $table->getHash();
124-
$site_name = implode(explode('.', $site));
125-
126-
foreach ($containers as $container) {
127-
128-
$sevice = $container['container'];
129-
$container_name = $site_name . '_' . $sevice . '_1';
130-
131-
exec("docker inspect -f '{{.State.Running}}' $container_name > /dev/null 2>&1", $exec_out, $return);
132-
if (!$return) {
133-
throw new Exception("$container_name has not been removed!");
134-
}
108+
if(file_exists("$home/ee-sites/")){
109+
throw new Exception("~/ee-sites/ has not been removed");
135110
}
136-
}
137-
138-
/**
139-
* @Then The site :site should have webroot
140-
*/
141-
public function theSiteShouldHaveWebroot($site)
142-
{
143-
if (!file_exists(getenv('HOME') . "/ee-sites/" . $site)) {
144-
throw new Exception("Webroot has not been created!");
145-
}
146-
}
147-
148-
/**
149-
* @Then The site :site should have WordPress
150-
*/
151-
public function theSiteShouldHaveWordpress($site)
152-
{
153-
if (!file_exists(getenv('HOME') . "/ee-sites/" . $site . "/app/src/wp-config.php")) {
154-
throw new Exception("WordPress data not found!");
155-
}
156-
}
157-
158-
/**
159-
* @Then Request on :site should contain following headers:
160-
*/
161-
public function requestOnShouldContainFollowingHeaders($site, TableNode $table)
162-
{
163-
$url = 'http://' . $site;
164-
165-
$ch = curl_init();
166-
curl_setopt($ch, CURLOPT_URL, $url);
167-
curl_setopt($ch, CURLOPT_HEADER, true);
168-
curl_setopt($ch, CURLOPT_NOBODY, true);
169-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
170-
$headers = curl_exec($ch);
171-
curl_close($ch);
172-
173-
$rows = $table->getHash();
174-
175-
foreach ($rows as $row) {
176-
if (strpos($headers, $row['header']) === false) {
177-
throw new Exception("Unable to find " . $row['header'] . "\nActual output is : " . $headers);
178-
}
111+
if(file_exists('/opt/easyengine/')){
112+
throw new Exception("/opt/easyengine/ has not been removed");
179113
}
180114
}
181115

@@ -184,7 +118,6 @@ public function requestOnShouldContainFollowingHeaders($site, TableNode $table)
184118
*/
185119
public static function cleanup(AfterFeatureScope $scope)
186120
{
187-
exec("sudo bin/ee site delete hello.test");
188121
if(file_exists('ee.phar')) {
189122
unlink('ee.phar');
190123
}

features/cli.feature

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ Feature: CLI Command
1313
Scenario: ee update works properly
1414
Given ee phar is generated
1515
When I run 'sudo php ee.phar cli update --yes'
16-
Then return value should be 0
16+
Then return value should be 0
17+
18+
Scenario: ee uninstall works properly
19+
When I run 'sudo bin/ee cli self-uninstall --yes'
20+
Then ee should be deleted

0 commit comments

Comments
 (0)