@@ -68,30 +68,30 @@ private static function pull_or_error( $image, $version ) {
6868 * Migrates all containers of existing sites
6969 */
7070 private static function migrate_site_containers () {
71- $ sites = \EE_DB ::select ( [ 'sitename ' , 'site_path ' , 'site_type ' , 'cache_type ' , 'is_ssl ' , 'db_host ' ] );
71+ $ sites = \EE_DB ::select ( [ 'site_url ' , 'site_fs_path ' , 'site_type ' , 'cache_nginx_browser ' , 'site_ssl ' , 'db_host ' ] );
7272 $ site_docker = new \Site_Docker ();
7373
7474 foreach ( $ sites as $ site ) {
7575
7676 $ data = [];
7777 $ data [] = $ site ['site_type ' ];
78- $ data [] = $ site ['cache_type ' ];
79- $ data [] = $ site ['is_ssl ' ];
78+ $ data [] = $ site ['cache_nginx_browser ' ];
79+ $ data [] = $ site ['site_ssl ' ];
8080 $ data [] = $ site ['db_host ' ];
8181
8282 $ docker_compose_contents = $ site_docker ->generate_docker_compose_yml ( $ data );
83- $ docker_compose_path = $ site ['site_path ' ] . '/docker-compose.yml ' ;
84- $ docker_compose_backup_path = $ site ['site_path ' ] . '/docker-compose.yml.bak ' ;
83+ $ docker_compose_path = $ site ['site_fs_path ' ] . '/docker-compose.yml ' ;
84+ $ docker_compose_backup_path = $ site ['site_fs_path ' ] . '/docker-compose.yml.bak ' ;
8585
8686 self ::$ rsp ->add_step (
87- "upgrade- $ {site['sitename ' ]}-copy-compose-file " ,
87+ "upgrade- $ {site['site_url ' ]}-copy-compose-file " ,
8888 'EE\Migration\Containers::site_copy_compose_file_up ' ,
8989 null ,
9090 [ $ site , $ docker_compose_path , $ docker_compose_backup_path ]
9191 );
9292
9393 self ::$ rsp ->add_step (
94- "upgrade- $ {site['sitename ' ]}-containers " ,
94+ "upgrade- $ {site['site_url ' ]}-containers " ,
9595 'EE\Migration\Containers::site_containers_up ' ,
9696 'EE\Migration\Containers::site_containers_down ' ,
9797 [ $ site , $ docker_compose_backup_path , $ docker_compose_path , $ docker_compose_contents ],
@@ -212,7 +212,7 @@ public static function cron_container_down( $existing_cron_image ) {
212212 */
213213 public static function site_copy_compose_file_up ( $ site , $ docker_compose_path , $ docker_compose_backup_path ) {
214214 if ( ! default_launch ( "cp $ docker_compose_path $ docker_compose_backup_path " ) ) {
215- throw new \Exception ( "Unable to find docker-compose.yml in $ {site['site_path ' ]} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there " );
215+ throw new \Exception ( "Unable to find docker-compose.yml in $ {site['site_fs_path ' ]} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there " );
216216 }
217217 }
218218
@@ -228,10 +228,10 @@ public static function site_copy_compose_file_up( $site, $docker_compose_path, $
228228 */
229229 public static function site_containers_up ( $ site , $ docker_compose_backup_path , $ docker_compose_path , $ docker_compose_contents ) {
230230 file_put_contents ( $ docker_compose_path , $ docker_compose_contents );
231- $ container_upgraded = default_launch ( "cd $ {site['site_path ' ]} && docker-compose up -d " );
231+ $ container_upgraded = default_launch ( "cd $ {site['site_fs_path ' ]} && docker-compose up -d " );
232232
233233 if ( ! $ container_upgraded ) {
234- throw new \Exception ( "Unable to upgrade containers of site: $ {site['sitename ' ]}. Please check logs for more details. " );
234+ throw new \Exception ( "Unable to upgrade containers of site: $ {site['site_url ' ]}. Please check logs for more details. " );
235235 }
236236 }
237237
@@ -246,10 +246,10 @@ public static function site_containers_up( $site, $docker_compose_backup_path, $
246246 */
247247 public static function site_containers_down ( $ site , $ docker_compose_backup_path , $ docker_compose_path ) {
248248 rename ( $ docker_compose_backup_path , $ docker_compose_path );
249- $ container_downgraded = default_launch ( "cd $ {site['site_path ' ]} && docker-compose up -d " );
249+ $ container_downgraded = default_launch ( "cd $ {site['site_fs_path ' ]} && docker-compose up -d " );
250250
251251 if ( ! $ container_downgraded ) {
252- throw new \Exception ( "Unable to downgrade containers of $ {site['sitename ' ]} site. Please check logs for more details. " );
252+ throw new \Exception ( "Unable to downgrade containers of $ {site['site_url ' ]} site. Please check logs for more details. " );
253253 }
254254 }
255255}
0 commit comments