Skip to content

Commit 5837f2c

Browse files
committed
Merge branch 'develop' into fix/postfix-configuration
2 parents a82f16b + 7034b0d commit 5837f2c

File tree

7 files changed

+111
-122
lines changed

7 files changed

+111
-122
lines changed

.github/workflows/test_and_build.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
on:
2+
pull_request:
3+
push:
4+
branches:
5+
- master
6+
- develop
7+
8+
name: Test 👨‍🔧
9+
10+
jobs:
11+
12+
test: #----------------------------------------------------------------------
13+
runs-on: ubuntu-latest
14+
name: Behat Tests - PHP ${{ matrix.php }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
php: ['7.2', '7.3', '7.4', '8.0']
19+
steps:
20+
- name: Check out source code
21+
uses: actions/checkout@v2
22+
23+
- name: Get Composer cache directory
24+
id: composer-cache
25+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
26+
27+
- name: Set up Composer caching
28+
uses: actions/cache@v2
29+
env:
30+
cache-name: cache-composer-dependencies
31+
with:
32+
path: ${{ steps.composer-cache.outputs.dir }}
33+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-composer-
36+
37+
- name: Set up PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: '${{ matrix.php }}'
41+
coverage: none
42+
tools: composer
43+
extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json
44+
45+
- name: Update docker
46+
run: |
47+
sudo apt purge nginx nginx-common docker docker-engine docker.io docker-ce containerd runc
48+
curl -fsSL https://get.docker.com/ | sudo bash
49+
sudo systemctl restart docker.service
50+
51+
- name: Install docker-compose
52+
run: |
53+
VERSION=$(curl --silent "https://api.github.com/repos/docker/compose/releases/latest" |
54+
grep '"tag_name":' |
55+
sed -E 's/.*"([^"]+)".*/\1/'
56+
)
57+
sudo curl -L "https://github.com/docker/compose/releases/download/$VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
58+
59+
- name: Install dependencies
60+
run: |
61+
cd "$GITHUB_WORKSPACE/.."
62+
git clone https://github.com/EasyEngine/easyengine.git easyengine --depth=1
63+
cd easyengine
64+
rm -rf features
65+
cp -R $GITHUB_WORKSPACE/features .
66+
# Run composer install for master else update.
67+
if [[ "$GITHUB_REF" = "refs/heads/master" ]]; then
68+
composer install --prefer-dist --no-progress --no-interaction
69+
else
70+
sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json
71+
composer update --prefer-dist --no-progress --no-interaction
72+
fi
73+
php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null
74+
sudo php easyengine.phar cli info
75+
76+
- name: Test
77+
shell: 'script -q -e -c "bash {0}"'
78+
run: |
79+
set -e
80+
cd "$GITHUB_WORKSPACE/../easyengine"
81+
sudo -E ./vendor/bin/behat
82+
env:
83+
COMPOSE_INTERACTIVE_NO_CLI: 1
84+
85+
- name: Output logs
86+
if: ${{ always() }}
87+
run: |
88+
[[ -f "/opt/easyengine/logs/install.log" ]] && cat /opt/easyengine/logs/install.log || echo 'No install log.'
89+
[[ -f "/opt/easyengine/logs/ee.log" ]] && cat /opt/easyengine/logs/ee.log || echo 'No run log.'
90+

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

ci/prepare.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

ci/test-env-install.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
"prefer-stable": true,
1010
"autoload": {
1111
"psr-4": {
12-
"": "src/"
12+
"EE\\Site\\Type\\": "src/"
1313
},
14-
"files": [ "site-type-wp.php" ]
14+
"files": [
15+
"site-type-wp.php"
16+
]
1517
},
1618
"require-dev": {
1719
"wp-cli/mustangostang-spyc": "^0.6.3"

features/bootstrap/FeatureContext.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
}
4242
$runner = \EE::get_runner();
4343
$runner->init_logger();
44+
$runner->init_config();
4445
/* End. Loading required files to enable EE::launch() in tests. */
4546

4647
use Behat\Behat\Context\Context;
@@ -380,7 +381,7 @@ public function cleanupScenario(AfterScenarioScope $scope)
380381
public function thereShouldBeContainersWithLabel($expected_running_containers, PyStringNode $pyStringNode)
381382
{
382383
$labels = $pyStringNode->getStrings();
383-
$label_string = implode($labels, ' -f label=');
384+
$label_string = implode(' -f label=',$labels);
384385

385386
$result = EE::launch( "docker ps -qf label=$label_string | wc -l", false, true );
386387
$running_containers = (int) trim($result->stdout);

src/WordPress.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,17 @@ public function __construct() {
128128
* : Set custom source directory for site inside htdocs.
129129
*
130130
* [--php=<php-version>]
131-
* : PHP version for site. Currently only supports PHP 5.6, 7.0, 7.2, 7.3, 7.4 and latest.
131+
* : PHP version for site. Currently only supports PHP 5.6, 7.0, 7.2, 7.3, 7.4, 8.0 and latest.
132132
* ---
133133
* default: latest
134134
* options:
135-
* - 5.6
136-
* - 7.0
137-
* - 7.2
138-
* - 7.3
139-
* - 7.4
140-
* - latest
135+
* - 5.6
136+
* - 7.0
137+
* - 7.2
138+
* - 7.3
139+
* - 7.4
140+
* - 8.0
141+
* - latest
141142
* ---
142143
*
143144
* [--dbname=<dbname>]
@@ -301,10 +302,7 @@ public function create( $args, $assoc_args ) {
301302
$this->site_data['app_admin_url'] = \EE\Utils\get_flag_value( $assoc_args, 'title', $this->site_data['site_url'] );
302303
$this->site_data['app_admin_username'] = \EE\Utils\get_flag_value( $assoc_args, 'admin-user', \EE\Utils\random_name_generator() );
303304
$this->site_data['app_admin_password'] = \EE\Utils\get_flag_value( $assoc_args, 'admin-pass', '' );
304-
$this->site_data['db_name'] = \EE\Utils\get_flag_value( $assoc_args, 'dbname', str_replace( [
305-
'.',
306-
'-'
307-
], '_', $this->site_data['site_url'] ) );
305+
$this->site_data['db_name'] = \EE\Utils\get_flag_value( $assoc_args, 'dbname', str_replace( [ '.', '-' ], '_', $this->site_data['site_url'] ) );
308306
$this->site_data['db_host'] = \EE\Utils\get_flag_value( $assoc_args, 'dbhost', GLOBAL_DB );
309307
$this->site_data['db_port'] = '3306';
310308
$this->site_data['db_user'] = \EE\Utils\get_flag_value( $assoc_args, 'dbuser', $this->create_site_db_user( $this->site_data['site_url'] ) );
@@ -371,7 +369,7 @@ public function create( $args, $assoc_args ) {
371369
}
372370
$this->site_data['alias_domains'] = substr( $this->site_data['alias_domains'], 0, - 1 );
373371

374-
$supported_php_versions = [ 5.6, 7.0, 7.2, 7.3, 7.4, 'latest' ];
372+
$supported_php_versions = [ 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 'latest' ];
375373
if ( ! in_array( $this->site_data['php_version'], $supported_php_versions ) ) {
376374
$old_version = $this->site_data['php_version'];
377375
$floor = (int) floor( $this->site_data['php_version'] );
@@ -380,7 +378,10 @@ public function create( $args, $assoc_args ) {
380378
} elseif ( 7 === $floor ) {
381379
$this->site_data['php_version'] = 7.4;
382380
$old_version .= ' yet';
383-
} else {
381+
} elseif ( 8 === $floor ) {
382+
$this->site_data['php_version'] = 8.0;
383+
$old_version .= ' yet';
384+
} else {
384385
EE::error( 'Unsupported PHP version: ' . $this->site_data['php_version'] );
385386
}
386387
\EE::confirm( sprintf( 'EEv4 does not support PHP %s. Continue with PHP %s?', $old_version, $this->site_data['php_version'] ), $assoc_args );
@@ -1137,7 +1138,7 @@ private function wp_download_and_config( $assoc_args ) {
11371138
$count = 0;
11381139
while ( $mysql_unhealthy ) {
11391140
$mysql_unhealthy = ! \EE::exec( $health_chk );
1140-
if ( $count ++ > 180 ) {
1141+
if ( $count++ > 180 ) {
11411142
break;
11421143
}
11431144
sleep( 1 );

0 commit comments

Comments
 (0)