@@ -28,7 +28,7 @@ public function up() {
28
28
return ;
29
29
}
30
30
31
- EE ::log ( 'Checking Docker version. ' );
31
+ EE ::debug ( 'Checking Docker version. ' );
32
32
$ docker_version = trim ( EE ::launch ( 'docker version --format "{{.Server.Version}}" ' )->stdout );
33
33
34
34
if ( version_compare ( $ docker_version , '20.10.10 ' , '< ' ) ) {
@@ -42,24 +42,26 @@ public function up() {
42
42
43
43
// If it is Linux, proceed with update.
44
44
if ( 'Linux ' === PHP_OS ) {
45
- EE ::log ( 'Updating Docker... ' );
45
+ EE ::debug ( 'Updating Docker... ' );
46
46
EE ::launch ( 'curl -fsSL https://get.docker.com | sh ' );
47
47
}
48
48
}
49
49
50
- EE ::log ( 'Checking docker-compose version ' );
50
+ EE ::debug ( 'Checking docker-compose version ' );
51
51
$ docker_compose_version = trim ( EE ::launch ( 'docker-compose version --short ' )->stdout );
52
52
$ docker_compose_path = EE ::launch ( 'command -v docker-compose ' )->stdout ;
53
53
$ docker_compose_path = trim ( $ docker_compose_path );
54
54
$ docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup ' ;
55
+ $ docker_compose_new_path = EE_BACKUP_DIR . '/docker-compose ' ;
55
56
$ fs = new Filesystem ();
56
57
if ( ! $ fs ->exists ( EE_BACKUP_DIR ) ) {
57
58
$ fs ->mkdir ( EE_BACKUP_DIR );
58
59
}
59
60
$ fs ->copy ( $ docker_compose_path , $ docker_compose_backup_path );
60
61
61
62
if ( version_compare ( '1.29.2 ' , $ docker_compose_version , '!= ' ) ) {
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 " );
63
+ EE ::exec ( "curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o $ docker_compose_new_path && chmod +x $ docker_compose_new_path " );
64
+ EE ::exec ( "mv $ docker_compose_new_path $ docker_compose_path " );
63
65
}
64
66
65
67
// Check the version again post update.
0 commit comments