File tree Expand file tree Collapse file tree 4 files changed +19
-12
lines changed
Process/Deploy/InstallUpdate
Test/Unit/Process/Deploy/InstallUpdate Expand file tree Collapse file tree 4 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -112,10 +112,13 @@ public function execute()
112
112
}
113
113
114
114
try {
115
+ $ installUpgradeLog = $ this ->fileList ->getInstallUpgradeLog ();
116
+
117
+ $ this ->shell ->execute ('echo \'Installation time: \'$(date) | tee -a ' . $ installUpgradeLog );
115
118
$ this ->shell ->execute (sprintf (
116
119
'/bin/bash -c "set -o pipefail; %s | tee -a %s" ' ,
117
120
escapeshellcmd ($ command ),
118
- $ this -> fileList -> getInstallUpgradeLog ()
121
+ $ installUpgradeLog
119
122
));
120
123
} catch (ShellException $ exception ) {
121
124
throw new ProcessException ($ exception ->getMessage (), $ exception ->getCode (), $ exception );
@@ -143,7 +146,7 @@ private function getBaseCommand(): string
143
146
. ' --backend-frontname= ' . escapeshellarg ($ this ->environment ->getAdminUrl ()
144
147
?: Environment::DEFAULT_ADMIN_URL )
145
148
. ($ this ->environment ->getAdminEmail () ? $ this ->getAdminCredentials () : '' )
146
- . ' --use-secure-admin=1 --ansi --no-interaction ' ;
149
+ . ' --use-secure-admin=1 --use-rewrites=1 -- ansi --no-interaction ' ;
147
150
}
148
151
149
152
/**
Original file line number Diff line number Diff line change @@ -93,13 +93,15 @@ public function execute()
93
93
94
94
try {
95
95
$ verbosityLevel = $ this ->stageConfig ->get (DeployInterface::VAR_VERBOSE_COMMANDS );
96
+ $ installUpgradeLog = $ this ->fileList ->getInstallUpgradeLog ();
96
97
97
98
$ this ->logger ->info ('Running setup upgrade. ' );
98
99
100
+ $ this ->shell ->execute ('echo \'Updating time: \'$(date) | tee -a ' . $ installUpgradeLog );
99
101
$ this ->shell ->execute (sprintf (
100
102
'/bin/bash -c "set -o pipefail; %s | tee -a %s" ' ,
101
103
'php ./bin/magento setup:upgrade --keep-generated --ansi --no-interaction ' . $ verbosityLevel ,
102
- $ this -> fileList -> getInstallUpgradeLog ()
104
+ $ installUpgradeLog
103
105
));
104
106
} catch (\RuntimeException $ exception ) {
105
107
//Rollback required by database
Original file line number Diff line number Diff line change @@ -184,18 +184,19 @@ public function testExecute(
184
184
. ' --admin-firstname= \'' . $ adminFirstnameExpected . '\' --admin-lastname= \'' . $ adminLastnameExpected
185
185
. '\' --admin-email= \'' . $ adminEmail . '\' --admin-password= \'' . $ adminPasswordExpected . '\''
186
186
: '' ;
187
- $ this ->shellMock ->expects ($ this ->once ( ))
187
+ $ this ->shellMock ->expects ($ this ->exactly ( 2 ))
188
188
->method ('execute ' )
189
- ->with (
190
- '/bin/bash -c "set -o pipefail; '
189
+ ->withConsecutive (
190
+ ['echo \'Installation time: \'$(date) | tee -a ' . $ installUpgradeLog ],
191
+ ['/bin/bash -c "set -o pipefail; '
191
192
. ' php ./bin/magento setup:install -n --session-save=db --cleanup-database --currency= \'USD \''
192
193
. ' --base-url= \'http://unsecure.url \' --base-url-secure= \'https://secure.url \' --language= \'fr_FR \''
193
194
. ' --timezone=America/Los_Angeles --db-host= \'localhost \' --db-name= \'magento \' --db-user= \'user \''
194
195
. ' --backend-frontname= \'' . $ adminUrlExpected . '\''
195
196
. $ adminCredential
196
- . ' --use-secure-admin=1 --ansi --no-interaction '
197
+ . ' --use-secure-admin=1 --use-rewrites=1 -- ansi --no-interaction '
197
198
. ' --db-password= \'password \' -v '
198
- . ' | tee -a ' . $ installUpgradeLog . '" '
199
+ . ' | tee -a ' . $ installUpgradeLog . '" ' ]
199
200
);
200
201
201
202
$ this ->process ->execute ();
Original file line number Diff line number Diff line change @@ -105,12 +105,13 @@ public function testExecute()
105
105
$ this ->flagManagerMock ->expects ($ this ->exactly (2 ))
106
106
->method ('delete ' )
107
107
->with (FlagManager::FLAG_REGENERATE );
108
- $ this ->shellMock ->expects ($ this ->once ( ))
108
+ $ this ->shellMock ->expects ($ this ->exactly ( 2 ))
109
109
->method ('execute ' )
110
- ->with (
111
- '/bin/bash -c "set -o pipefail; php ./bin/magento setup:upgrade '
110
+ ->withConsecutive (
111
+ ['echo \'Updating time: \'$(date) | tee -a ' . $ installUpgradeLog ],
112
+ ['/bin/bash -c "set -o pipefail; php ./bin/magento setup:upgrade '
112
113
. '--keep-generated --ansi --no-interaction -v | tee -a '
113
- . $ installUpgradeLog . '" '
114
+ . $ installUpgradeLog . '" ' ]
114
115
);
115
116
$ this ->loggerMock ->expects ($ this ->once ())
116
117
->method ('info ' )
You can’t perform that action at this time.
0 commit comments