Skip to content

Commit 11c1eb4

Browse files
committed
Merge branch 'develop' for v1.8.0
2 parents 70c69bb + bd0ce5c commit 11c1eb4

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public function checkLocalRedisCacheOfSite($site)
346346
$site_root_folder = EE_SITE_ROOT . '/' . $site;
347347
exec("cd $site_root_folder && docker-compose exec redis redis-cli set 'easyengine' 'rocks'");
348348
$output = exec("cd $site_root_folder && docker-compose exec redis redis-cli get 'easyengine'");
349-
if ( '"rocks"' !== $output ) {
349+
if ( 'rocks' !== $output ) {
350350
throw new Exception("Local redis not working for $site site. Getting '$output' instead of 'rocks'.");
351351
}
352352
exec("cd $site_root_folder && docker-compose exec redis redis-cli del 'easyengine'");

src/PHP.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __construct() {
8181
* : Create separate db container instead of using global db.
8282
*
8383
* [--php=<php-version>]
84-
* : PHP version for site. Currently only supports PHP 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1 and latest.
84+
* : PHP version for site. Currently only supports PHP 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, and latest.
8585
* ---
8686
* default: latest
8787
* options:
@@ -92,6 +92,8 @@ public function __construct() {
9292
* - 7.4
9393
* - 8.0
9494
* - 8.1
95+
* - 8.2
96+
* - 8.3
9597
* - latest
9698
* ---
9799
*
@@ -226,7 +228,7 @@ public function create( $args, $assoc_args ) {
226228
}
227229
$this->site_data['alias_domains'] = substr( $this->site_data['alias_domains'], 0, - 1 );
228230

229-
$supported_php_versions = [ 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1, 'latest' ];
231+
$supported_php_versions = [ 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 'latest' ];
230232
if ( ! in_array( $this->site_data['php_version'], $supported_php_versions ) ) {
231233
$old_version = $this->site_data['php_version'];
232234
$floor = (int) floor( $this->site_data['php_version'] );
@@ -236,15 +238,15 @@ public function create( $args, $assoc_args ) {
236238
$this->site_data['php_version'] = 7.4;
237239
$old_version .= ' yet';
238240
} elseif ( 8 === $floor ) {
239-
$this->site_data['php_version'] = 8.0;
241+
$this->site_data['php_version'] = 8.2;
240242
$old_version .= ' yet';
241243
} else {
242244
EE::error( 'Unsupported PHP version: ' . $this->site_data['php_version'] );
243245
}
244246
\EE::confirm( sprintf( 'EEv4 does not support PHP %s. Continue with PHP %s?', $old_version, $this->site_data['php_version'] ) );
245247
}
246248

247-
$this->site_data['php_version'] = ( 7.4 === (double) $this->site_data['php_version'] ) ? 'latest' : $this->site_data['php_version'];
249+
$this->site_data['php_version'] = ( 8.0 === (double) $this->site_data['php_version'] ) ? 'latest' : $this->site_data['php_version'];
248250

249251
if ( $this->cache_type && ! $local_cache ) {
250252
\EE\Service\Utils\init_global_container( GLOBAL_REDIS );
@@ -619,6 +621,7 @@ public function dump_docker_compose_yml( $additional_filters = [] ) {
619621

620622
$filter = [];
621623
$filter[] = $this->site_data['cache_host'];
624+
$filter['site_url'] = $this->site_data['site_url'];
622625
$filter['site_prefix'] = \EE_DOCKER::get_docker_style_prefix( $this->site_data['site_url'] );
623626
$filter['is_ssl'] = $this->site_data['site_ssl'];
624627
$filter['php_version'] = ( string ) $this->site_data['php_version'];

src/Site_PHP_Docker.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
2424
$restart_default = [ 'name' => 'always' ];
2525
$network_default = [
2626
'net' => [
27-
[ 'name' => 'site-network' ],
27+
[ 'name' => $filters['site_url'] ],
2828
],
2929
];
3030

3131
$network = [
32+
'name' => $filters['site_url'],
3233
'networks_labels' => [
3334
'label' => [
3435
[ 'name' => 'org.label-schema.vendor=EasyEngine' ],
@@ -64,7 +65,7 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
6465
$db['networks'] = $network_default;
6566
}
6667
// PHP configuration.
67-
$php_image_key = ( 'latest' === $filters['php_version'] ? 'easyengine/php' : 'easyengine/php' . $filters['php_version'] );
68+
$php_image_key = ( 'latest' === $filters['php_version'] ? 'easyengine/php8.2' : 'easyengine/php' . $filters['php_version'] );
6869

6970
$php['service_name'] = [ 'name' => 'php' ];
7071
$php['image'] = [ 'name' => $php_image_key . ':' . $img_versions[ $php_image_key ] ];
@@ -101,7 +102,7 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
101102
$php['networks'] = [
102103
'net' => [
103104
[
104-
'name' => 'site-network',
105+
'name' => $filters['site_url'],
105106
'aliases' => [
106107
'alias' => [
107108
'name' => '${VIRTUAL_HOST}_php',
@@ -160,7 +161,7 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
160161
$nginx['networks'] = [
161162
'net' => [
162163
[ 'name' => 'global-frontend-network' ],
163-
[ 'name' => 'site-network' ],
164+
[ 'name' => $filters['site_url'] ],
164165
],
165166
];
166167
if ( in_array( GLOBAL_REDIS, $filters, true ) ) {
@@ -186,7 +187,7 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
186187
];
187188
$mailhog['networks'] = [
188189
'net' => [
189-
[ 'name' => 'site-network' ],
190+
[ 'name' => $filters['site_url'] ],
190191
[ 'name' => 'global-frontend-network' ],
191192
],
192193
];

templates/config/nginx/main.conf.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ server {
111111
log_not_found off;
112112
}
113113
# Cache static files
114-
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ {
114+
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf|webp)$ {
115115
add_header "Access-Control-Allow-Origin" "*";
116116
access_log off;
117117
log_not_found off;

templates/docker-compose.mustache

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.5'
2-
31
services:
42

53
{{#services}}
@@ -69,27 +67,26 @@ services:
6967
volumes:
7068
{{#external_vols}}
7169
{{ext_vol_name}}:
72-
external:
73-
name: {{prefix}}_{{ext_vol_name}}
70+
external: true
71+
name: {{prefix}}_{{ext_vol_name}}
7472
{{/external_vols}}
7573
{{/created_volumes}}
7674

7775
{{#network}}
7876
networks:
79-
site-network:
80-
name: ${VIRTUAL_HOST}
77+
{{name}}:
8178
{{#networks_labels}}
8279
labels:
8380
{{#label}}
8481
- "{{name}}"
8582
{{/label}}
8683
{{/networks_labels}}
8784
global-frontend-network:
88-
external:
89-
name: ee-global-frontend-network
85+
external: true
86+
name: ee-global-frontend-network
9087
{{#enable_backend_network}}
9188
global-backend-network:
92-
external:
93-
name: ee-global-backend-network
89+
external: true
90+
name: ee-global-backend-network
9491
{{/enable_backend_network}}
9592
{{/network}}

0 commit comments

Comments
 (0)