File tree 4 files changed +24
-7
lines changed
4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ jobs:
127
127
128
128
- name : Install docker-compose
129
129
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
131
131
sudo chmod +x /usr/local/bin/docker-compose
132
132
133
133
- name : Install dependencies
Original file line number Diff line number Diff line change 8
8
9
9
class CheckAndUpdateDockerOne extends Base {
10
10
11
+ public function __construct () {
12
+
13
+ if ( $ this ->is_first_execution ) {
14
+ $ this ->skip_this_migration = true ;
15
+ }
16
+ }
17
+
11
18
/**
12
19
* Execute create table query for site and sitemeta table.
13
20
*
14
21
* @throws EE\ExitException
15
22
*/
16
23
public function up () {
17
24
25
+ if ( $ this ->skip_this_migration ) {
26
+ EE ::debug ( 'Skipping migration as it is not needed. ' );
27
+
28
+ return ;
29
+ }
30
+
18
31
EE ::log ( 'Checking Docker version. ' );
19
32
$ docker_version = trim ( EE ::launch ( 'docker version --format "{{.Server.Version}}" ' )->stdout );
20
33
@@ -45,7 +58,7 @@ public function up() {
45
58
}
46
59
$ fs ->copy ( $ docker_compose_path , $ docker_compose_backup_path );
47
60
48
- if ( version_compare ( '1.29.2 ' , $ docker_compose_version , '> ' ) ) {
61
+ if ( version_compare ( '1.29.2 ' , $ docker_compose_version , '!= ' ) ) {
49
62
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 " );
50
63
}
51
64
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ public static function start_container_migration() {
58
58
}
59
59
60
60
if ( empty ( $ updated_images ) ) {
61
+
61
62
return ;
62
63
}
63
64
@@ -131,13 +132,15 @@ public static function update_docker_compose() {
131
132
$ docker_compose_path = EE ::launch ( 'command -v docker-compose ' )->stdout ;
132
133
$ docker_compose_path = trim ( $ docker_compose_path );
133
134
$ 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 );
139
135
140
136
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
+
141
144
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 " );
142
145
}
143
146
}
Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ private function migrate() {
138
138
$ rsp ->add_step ( 'ee-db-migrations ' , 'EE\Migration\Executor::execute_migrations ' );
139
139
$ rsp ->add_step ( 'ee-custom-container-migrations ' , 'EE\Migration\CustomContainerMigrations::execute_migrations ' );
140
140
$ 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 ' );
141
142
return $ rsp ->execute ();
142
143
}
143
144
You can’t perform that action at this time.
0 commit comments