Skip to content

Commit 8538289

Browse files
committed
Up previously runnign containers only
1 parent 504c6ea commit 8538289

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

migrations/container/20181225063950_service-command_change_global_service_container_names.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function up() {
7070
'EE\Migration\SiteContainers::backup_restore',
7171
'EE\Migration\ChangeGlobalServiceContainerNames::restore_yml_file',
7272
[ $global_compose_file_path, $global_compose_file_backup_path ],
73-
[ $global_compose_file_backup_path, $global_compose_file_path ]
73+
[ $global_compose_file_backup_path, $global_compose_file_path, $running_containers ]
7474
);
7575

7676
/**
@@ -147,13 +147,18 @@ public function down() {
147147
*
148148
* @param $source string path of source file.
149149
* @param $destination string path of destination.
150+
* @param $containers array of running containers.
151+
*
152+
* @throws \Exception
150153
*/
151-
public static function restore_yml_file( $source, $destination ) {
154+
public static function restore_yml_file( $source, $destination, $containers ) {
152155
EE\Migration\SiteContainers::backup_restore( $source, $destination );
153-
154156
chdir( EE_SERVICE_DIR );
155157

156-
EE::exec( 'docker-compose up -d' );
158+
$running_containers = implode( ' ', $containers );
159+
if ( ! EE::exec( sprintf( 'docker-compose up -d %s', $running_containers ) ) ) {
160+
throw new \Exception( 'Unable to start ee-containers' );
161+
}
157162
}
158163

159164
/**

0 commit comments

Comments
 (0)