File tree Expand file tree Collapse file tree 9 files changed +30
-37
lines changed
magento2/usr/local/share/magento2
php-apache/usr/local/share/php
php-nginx/usr/local/share/php
symfony/usr/local/share/symfony
ubuntu/16.04/usr/local/share Expand file tree Collapse file tree 9 files changed +30
-37
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,7 @@ source "$DIR/replace_core_config_values.sh"
23
23
bash " $DIR /../install_magento.sh" ;
24
24
25
25
set -x
26
- set +e
27
- IS_HEM=" $( is_hem_project) "
28
- set -e
29
- if [ " $IS_HEM " == ' true' ]; then
26
+ if is_hem_project; then
30
27
# Run HEM
31
28
export HEM_RUN_ENV=" ${HEM_RUN_ENV:- local} "
32
29
for asset_env in $ASSET_DOWNLOAD_ENVIRONMENTS ; do
Original file line number Diff line number Diff line change 10
10
cd /app || exit 1
11
11
12
12
if [ -f " $ASSET_ARCHIVE_PATH " ]; then
13
- set +e
14
- IS_CHOWN_FORBIDDEN=" $( is_chown_forbidden) "
15
- set -e
13
+ IS_CHOWN_FORBIDDEN=" $( run_return_boolean is_chown_forbidden) "
16
14
17
15
if [ " $IS_CHOWN_FORBIDDEN " != ' true' ]; then
18
16
chown -R " ${CODE_OWNER} :${CODE_GROUP} " pub/media
Original file line number Diff line number Diff line change 16
16
17
17
cd /app || exit 1;
18
18
19
- set +e
20
- IS_CHOWN_FORBIDDEN=" $( is_chown_forbidden) "
21
- set -e
19
+ IS_CHOWN_FORBIDDEN=" $( run_return_boolean is_chown_forbidden) "
22
20
23
21
if [ ! -d " vendor" ] || [ ! -f " vendor/autoload.php" ]; then
24
22
as_code_owner " composer config repositories.magento composer https://repo.magento.com/"
Original file line number Diff line number Diff line change 15
15
cd /app || exit 1
16
16
17
17
set +e
18
- IS_CHOWN_FORBIDDEN=" $( is_chown_forbidden) "
18
+ IS_CHOWN_FORBIDDEN=" $( run_return_boolean is_chown_forbidden) "
19
19
set -e
20
20
21
21
if [ " $IS_CHOWN_FORBIDDEN " != ' true' ]; then
57
57
# (sad that we have to do that tho...)
58
58
59
59
# Download the static assets
60
- set +e
61
- IS_HEM=" $( is_hem_project) "
62
- set -e
63
- if [ " $IS_HEM " == ' true' ]; then
60
+ if is_hem_project; then
64
61
export HEM_RUN_ENV=" ${HEM_RUN_ENV:- local} "
65
62
for asset_env in $ASSET_DOWNLOAD_ENVIRONMENTS ; do
66
63
as_build " hem --non-interactive --skip-host-checks assets download -e $asset_env "
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ do_composer_postinstall_scripts() {
28
28
as_code_owner ' composer run-script post-install-cmd'
29
29
}
30
30
31
- has_composer_package () (
32
- set -e
31
+ has_composer_package () {
33
32
if [ ! -f " composer.lock" ]; then
34
33
return
35
34
fi
36
35
37
36
is_true " $( jq -c ' (.packages + .["packages-dev"])[] | select(.name == "' " $1 " ' ") | has("name")' composer.lock) "
38
- )
37
+ return " $? "
38
+ }
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ do_composer_postinstall_scripts() {
28
28
as_code_owner ' composer run-script post-install-cmd'
29
29
}
30
30
31
- has_composer_package () (
32
- set -e
31
+ has_composer_package () {
33
32
if [ ! -f " composer.lock" ]; then
34
33
return
35
34
fi
36
35
37
36
is_true " $( jq -c ' (.packages + .["packages-dev"])[] | select(.name == "' " $1 " ' ") | has("name")' composer.lock) "
38
- )
37
+ return " $? "
38
+ }
Original file line number Diff line number Diff line change @@ -56,14 +56,17 @@ symfony_doctrine_mode() {
56
56
57
57
uses_symfony_doctrine () {
58
58
[ " $( symfony_doctrine_mode) " != " off" ]
59
+ return " $? "
59
60
}
60
61
61
62
uses_symfony_doctrine_mode_schema () {
62
63
[ " $( symfony_doctrine_mode) " = " schema" ]
64
+ return " $? "
63
65
}
64
66
65
67
uses_symfony_doctrine_mode_migrations () {
66
68
[ " $( symfony_doctrine_mode) " = " migrations" ]
69
+ return " $? "
67
70
}
68
71
69
72
do_database_rebuild () {
Original file line number Diff line number Diff line change @@ -80,6 +80,14 @@ convert_exit_code_to_string() {
80
80
fi
81
81
}
82
82
83
+ run_return_boolean () {
84
+ if " $@ " ; then
85
+ echo ' true'
86
+ else
87
+ echo ' false'
88
+ fi
89
+ }
90
+
83
91
convert_to_boolean_string () {
84
92
if [ " $1 " == ' 1' ] || [ " $1 " == " true" ]; then
85
93
echo ' true' ;
@@ -117,30 +125,24 @@ is_false() {
117
125
}
118
126
119
127
is_hem_project () {
120
- local RESULT=1
121
- if [ -f /app/tools/hem/config.yaml ] || [ -f /app/tools/hobo/config.yaml ]; then
122
- RESULT=0
123
- fi
124
- convert_exit_code_to_string " $RESULT "
128
+ [ -f /app/tools/hem/config.yaml ] || [ -f /app/tools/hobo/config.yaml ]
129
+ return " $? "
125
130
}
126
131
127
132
is_app_mountpoint () {
128
133
grep -q -E " /app (nfs|vboxsf|fuse\\ .osxfs)" /proc/mounts
129
- local RESULT=" $? "
130
- convert_exit_code_to_string " $RESULT "
134
+ return " $? "
131
135
}
132
136
133
137
is_chown_forbidden () {
134
138
# Determine if the app directory is an NFS mountpoint, which doesn't allow chowning.
135
139
grep -q -E " /app (nfs|vboxsf)" /proc/mounts
136
- local RESULT=" $? "
137
- convert_exit_code_to_string " $RESULT "
140
+ return " $? "
138
141
}
139
142
140
143
is_vboxsf_mountpoint () {
141
144
grep -q " /app vboxsf" /proc/mounts
142
- local RESULT=" $? "
143
- convert_exit_code_to_string " $RESULT "
145
+ return " $? "
144
146
}
145
147
146
148
alias_function () {
Original file line number Diff line number Diff line change @@ -8,16 +8,14 @@ START_CRON=${START_CRON:-false}
8
8
START_CRON=" $( convert_to_boolean_string " $START_CRON " ) "
9
9
export START_CRON
10
10
11
- set +e
12
- IS_CHOWN_FORBIDDEN=" $( is_chown_forbidden) "
11
+ IS_CHOWN_FORBIDDEN=" $( run_return_boolean is_chown_forbidden) "
13
12
export IS_CHOWN_FORBIDDEN
14
13
15
- IS_VBOXSF_MOUNTPOINT=" $( is_vboxsf_mountpoint) "
14
+ IS_VBOXSF_MOUNTPOINT=" $( run_return_boolean is_vboxsf_mountpoint) "
16
15
export IS_VBOXSF_MOUNTPOINT
17
16
18
- IS_APP_MOUNTPOINT=" $( is_app_mountpoint) "
17
+ IS_APP_MOUNTPOINT=" $( run_return_boolean is_app_mountpoint) "
19
18
export IS_APP_MOUNTPOINT
20
- set -e
21
19
22
20
DEVELOPMENT_MODE=" $( convert_to_boolean_string_zero_is_true " ${DEVELOPMENT_MODE:- ${IS_APP_MOUNTPOINT} } " ) "
23
21
export DEVELOPMENT_MODE
You can’t perform that action at this time.
0 commit comments