File tree Expand file tree Collapse file tree 4 files changed +24
-7
lines changed Expand file tree Collapse file tree 4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ jobs:
127127
128128 - name : Install docker-compose
129129 run : |
130- sudo curl -L https://github.com/docker/compose/releases/download/v2.26.1 /docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
130+ sudo curl -L https://github.com/docker/compose/releases/download/v2.27.0 /docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
131131 sudo chmod +x /usr/local/bin/docker-compose
132132
133133 - name : Install dependencies
Original file line number Diff line number Diff line change 88
99class CheckAndUpdateDockerOne extends Base {
1010
11+ public function __construct () {
12+
13+ if ( $ this ->is_first_execution ) {
14+ $ this ->skip_this_migration = true ;
15+ }
16+ }
17+
1118 /**
1219 * Execute create table query for site and sitemeta table.
1320 *
1421 * @throws EE\ExitException
1522 */
1623 public function up () {
1724
25+ if ( $ this ->skip_this_migration ) {
26+ EE ::debug ( 'Skipping migration as it is not needed. ' );
27+
28+ return ;
29+ }
30+
1831 EE ::log ( 'Checking Docker version. ' );
1932 $ docker_version = trim ( EE ::launch ( 'docker version --format "{{.Server.Version}}" ' )->stdout );
2033
@@ -45,7 +58,7 @@ public function up() {
4558 }
4659 $ fs ->copy ( $ docker_compose_path , $ docker_compose_backup_path );
4760
48- if ( version_compare ( '1.29.2 ' , $ docker_compose_version , '> ' ) ) {
61+ if ( version_compare ( '1.29.2 ' , $ docker_compose_version , '!= ' ) ) {
4962 EE ::exec ( "curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o $ docker_compose_path && chmod +x $ docker_compose_path " );
5063 }
5164
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ public static function start_container_migration() {
5858 }
5959
6060 if ( empty ( $ updated_images ) ) {
61+
6162 return ;
6263 }
6364
@@ -131,13 +132,15 @@ public static function update_docker_compose() {
131132 $ docker_compose_path = EE ::launch ( 'command -v docker-compose ' )->stdout ;
132133 $ docker_compose_path = trim ( $ docker_compose_path );
133134 $ docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup ' ;
134- $ fs = new Filesystem ();
135- if ( ! $ fs ->exists ( EE_BACKUP_DIR ) ) {
136- $ fs ->mkdir ( EE_BACKUP_DIR );
137- }
138- $ fs ->copy ( $ docker_compose_path , $ docker_compose_backup_path );
139135
140136 if ( version_compare ( '2.27.0 ' , $ docker_compose_version , '> ' ) ) {
137+
138+ $ fs = new Filesystem ();
139+ if ( ! $ fs ->exists ( EE_BACKUP_DIR ) ) {
140+ $ fs ->mkdir ( EE_BACKUP_DIR );
141+ }
142+ $ fs ->copy ( $ docker_compose_path , $ docker_compose_backup_path );
143+
141144 EE ::exec ( "curl -L https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m) -o $ docker_compose_path && chmod +x $ docker_compose_path " );
142145 }
143146 }
Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ private function migrate() {
138138 $ rsp ->add_step ( 'ee-db-migrations ' , 'EE\Migration\Executor::execute_migrations ' );
139139 $ rsp ->add_step ( 'ee-custom-container-migrations ' , 'EE\Migration\CustomContainerMigrations::execute_migrations ' );
140140 $ rsp ->add_step ( 'ee-docker-image-migrations ' , 'EE\Migration\Containers::start_container_migration ' );
141+ $ rsp ->add_step ( 'ee-update-docker-compose ' , 'EE\Migration\Containers::update_docker_compose ' );
141142 return $ rsp ->execute ();
142143 }
143144
You can’t perform that action at this time.
0 commit comments