Skip to content

Commit

Permalink
Merge branch 'develop' for vd4.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
mrrobot47 committed Mar 18, 2019
2 parents c65fda8 + f55eb6c commit 62427d3
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 67 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.10
4.0.11
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"easyengine/cron-command": "v1.0.2",
"easyengine/log-command": "v1.0.1",
"easyengine/mailhog-command": "v1.0.2",
"easyengine/site-command": "v2.3.0",
"easyengine/site-type-wp": "v1.0.8",
"easyengine/site-type-php": "v1.0.8",
"easyengine/service-command": "v1.0.8",
"easyengine/shell-command" : "v1.0.2",
"easyengine/site-command": "v2.3.1",
"easyengine/site-type-wp": "v1.0.9",
"easyengine/site-type-php": "v1.0.9",
"easyengine/service-command": "v1.0.9",
"easyengine/shell-command" : "v1.0.3",
"justinrainbow/json-schema": "5.2.7",
"monolog/monolog": "1.24.0",
"mustache/mustache": "2.12.0",
Expand Down
91 changes: 46 additions & 45 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions img-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"easyengine/cron": "v4.0.0",
"easyengine/mailhog": "v4.0.0",
"easyengine/mariadb": "v4.0.0",
"easyengine/nginx-proxy": "v4.0.1",
"easyengine/nginx-proxy": "v4.0.2",
"easyengine/nginx": "v4.0.0",
"easyengine/php": "v4.0.0",
"easyengine/php": "v4.0.2",
"easyengine/php5.6": "v4.0.0",
"easyengine/postfix": "v4.0.0",
"easyengine/redis": "v4.0.0"
"easyengine/redis": "v4.0.0",
"easyengine/newrelic-daemon": "v4.0.0"
}
11 changes: 6 additions & 5 deletions php/EE/Migration/Containers.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ public static function start_container_migration() {
$updated_images = [];

foreach ( $img_versions as $img => $version ) {
if ( 'easyengine/php5.6' === $img ) {
continue;
}
if ( $current_versions[ $img ] !== $version ) {
$updated_images[] = $img;
if ( array_key_exists( $img, $current_versions ) ) {
if ( $current_versions[ $img ] !== $version ) {
$updated_images[] = $img;
self::pull_or_error( $img, $version );
}
} else {
self::pull_or_error( $img, $version );
}
}
Expand Down
17 changes: 13 additions & 4 deletions php/EE/Migration/GlobalContainers.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ public static function down_global_containers( $updated_images ) {
foreach ( $updated_images as $image_name ) {
$global_container_name = $all_global_images[ $image_name ];
$global_service_name = ltrim( $global_container_name, 'services_' );
$global_service_name = rtrim( $global_service_name, '_1' );
EE::debug( "Removing $global_container_name" );
$remove_suffix = explode( '_1', $global_service_name );
$global_service_name = empty( $remove_suffix[0] ) ? $global_service_name : $remove_suffix[0];
EE::debug( "Removing $global_container_name" );

if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) {
if ( ! EE::exec( "docker-compose stop $global_service_name && docker-compose rm -f $global_service_name" ) ) {
Expand All @@ -94,8 +95,11 @@ public static function down_global_containers( $updated_images ) {
* @throws \Exception
*/
public static function global_service_up( $service_name ) {
$global_service_name = ltrim( $service_name, 'services_' );
$remove_suffix = explode( '_1', $global_service_name );
$global_service_name = empty( $remove_suffix[0] ) ? $global_service_name : $remove_suffix[0];
EE::debug( 'Start ' . $service_name . ' container up' );
if ( 'global-nginx-proxy' === $service_name ) {
if ( 'global-nginx-proxy' === $global_service_name ) {
\EE\Service\Utils\nginx_proxy_check();
} else {
\EE\Service\Utils\init_global_container( $service_name );
Expand Down Expand Up @@ -124,8 +128,13 @@ public static function global_service_down( $service_name ) {
* @return array
*/
public static function get_all_global_images_with_service_name() {

$launch = EE::launch( sprintf( 'docker ps -f "id=%s" --format={{.Names}}', EE_PROXY_TYPE ) );
if ( 0 === $launch->return_code ) {
$nginx_proxy = trim( $launch->stdout );
}
return [
'easyengine/nginx-proxy' => EE_PROXY_TYPE,
'easyengine/nginx-proxy' => $nginx_proxy,
'easyengine/mariadb' => GLOBAL_DB_CONTAINER,
'easyengine/redis' => GLOBAL_REDIS_CONTAINER,
// 'easyengine/cron' => EE_CRON_SCHEDULER, //TODO: Add it to global docker-compose.
Expand Down
7 changes: 7 additions & 0 deletions php/EE/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ private function init_ee() {
$check_requirements = ( [ 'site', 'cmd-dump' ] === $this->arguments ) ? false : $check_requirements;
}

$nginx_proxy = 'services_global-nginx-proxy_1';
$launch = EE::launch( sprintf( 'cd %s && docker ps -q --no-trunc | grep $(docker-compose ps -q global-nginx-proxy)', EE_SERVICE_DIR ) );
if ( 0 === $launch->return_code ) {
$nginx_proxy = trim( $launch->stdout );
}
define( 'EE_PROXY_TYPE', $nginx_proxy );

if ( $check_requirements ) {
$this->check_requirements();
$this->maybe_trigger_migration();
Expand Down
Loading

0 comments on commit 62427d3

Please # to comment.