@@ -159,7 +159,7 @@ function do_magento_install_finalise_custom() {
159159 fi
160160}
161161
162- function do_magento_drop_database() {
162+ function do_magento_drop_database() (
163163 set +x
164164
165165 if [ " $FORCE_DATABASE_DROP " != ' true' ]; then
@@ -172,9 +172,9 @@ function do_magento_drop_database() {
172172 else
173173 mysql -h" $DATABASE_HOST " -uroot -e " DROP DATABASE IF EXISTS $DATABASE_NAME " || exit 1
174174 fi
175- }
175+ )
176176
177- function check_magento_database_exists() {
177+ function check_magento_database_exists() (
178178 set +e
179179 local DATABASE_EXISTS
180180 if [ -n " $DATABASE_PASSWORD " ]; then
@@ -189,7 +189,7 @@ function check_magento_database_exists() {
189189 else
190190 echo " false" ;
191191 fi
192- }
192+ )
193193
194194function do_magento_database_create() {
195195 echo ' Create Magento database'
@@ -200,14 +200,13 @@ function do_magento_database_create() {
200200 fi
201201}
202202
203- function do_magento_database_install() {
203+ function do_magento_database_install() (
204204 set +x
205205 if [ -f " $DATABASE_ARCHIVE_PATH " ]; then
206206 do_magento_drop_database
207207
208208 local DATABASE_EXISTS
209209 DATABASE_EXISTS=" $( check_magento_database_exists) "
210- set -e
211210
212211 if [ " $DATABASE_EXISTS " != " true" ]; then
213212 do_magento_database_create
@@ -221,16 +220,15 @@ function do_magento_database_install() {
221220 fi
222221 fi
223222 set -x
224- }
223+ )
225224
226- function do_magento_installer_install() {
225+ function do_magento_installer_install() (
227226 set +x
228227 do_magento_wait_for_database
229228 do_magento_drop_database
230229
231230 local DATABASE_EXISTS
232231 DATABASE_EXISTS=" $( check_magento_database_exists) "
233- set -e
234232
235233 if [ " $DATABASE_EXISTS " != " true" ]; then
236234 do_magento_database_create
@@ -253,9 +251,7 @@ function do_magento_installer_install() {
253251 --use-rewrites=1 \
254252 --session-save=db"
255253 fi
256-
257- set -x
258- }
254+ )
259255
260256function do_magento_wait_for_database() {
261257 if [ " $DATABASE_HOST " != ' localhost' ]; then
@@ -301,8 +297,7 @@ function do_magento_install_development_custom() {
301297 fi
302298}
303299
304- function do_replace_core_config_values() {
305- set +x
300+ function do_replace_core_config_values() (
306301 local SQL
307302 SQL=" DELETE from core_config_data WHERE path LIKE 'web/%base_url';
308303 DELETE from core_config_data WHERE path LIKE 'system/full_page_cache/varnish%';
@@ -321,9 +316,7 @@ function do_replace_core_config_values() {
321316 else
322317 echo " $SQL " | mysql -h" $DATABASE_HOST " -u" $DATABASE_USER " " $DATABASE_NAME "
323318 fi
324-
325- set -x
326- }
319+ )
327320
328321function do_magento_build_start_mysql() {
329322 apt-get update -qq -y
@@ -393,10 +386,9 @@ function do_magento_tail_logs() {
393386 /app/var/log/system.log
394387}
395388
396- function do_magento_create_admin_user() {
389+ function do_magento_create_admin_user() (
397390 set +x
398391 if [ -z " ${MAGENTO_ADMIN_USERNAME} " ] || [ -z " ${MAGENTO_ADMIN_PASSWORD} " ]; then
399- set -x
400392 return 0
401393 fi
402394 local SQL=" SELECT 1 FROM admin_user WHERE username='$MAGENTO_ADMIN_USERNAME '"
@@ -412,7 +404,6 @@ function do_magento_create_admin_user() {
412404 set -e
413405
414406 if [ " $HAS_ADMIN_USER " != 0 ]; then
415- set +x
416407 as_code_owner " bin/magento admin:user:create \
417408 --admin-user='${MAGENTO_ADMIN_USERNAME} ' \
418409 --admin-password='${MAGENTO_ADMIN_PASSWORD} ' \
@@ -421,7 +412,7 @@ function do_magento_create_admin_user() {
421412 --admin-lastname='Admin'"
422413 set -x
423414 fi
424- }
415+ )
425416
426417function do_magento2_build() {
427418
0 commit comments