forked from aws-samples/magento-ecs-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
01-install-sample-data.sh
executable file
·66 lines (59 loc) · 2.25 KB
/
01-install-sample-data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
install_sample(){
# chown -R daemon:daemon /bitnami/magento/
echo "*Enabling Maintenance Mode*"
bin/magento maintenance:enable
echo "**Installing Sample Application"
# php bin/magento config:set dev/js/minify_files 1
# php bin/magento config:set dev/css/minify_files 1
# php bin/magento config:set dev/js/enable_js_bundling 1
# php bin/magento config:set dev/css/merge_css_files 1
# php bin/magento config:set dev/static/sign 1
# php bin/magento config:set dev/js/minify_files 1
echo "**Installing Sample Application - setup:upgrade"
php -d memory_limit=-1 bin/magento setup:upgrade
echo "**Installing Sample Application - sampledata:deploy"
php -d memory_limit=-1 bin/magento sampledata:deploy
echo "**Installing Sample Application - setup:static-content:deploy -f"
php -d memory_limit=-1 bin/magento setup:static-content:deploy -f
echo "**Installing Sample Application - indexer:reindex"
php -d memory_limit=-1 bin/magento indexer:reindex
echo "**Installing Sample Application - catalog:image:resize"
php -d memory_limit=-1 bin/magento catalog:image:resize
echo "**Installing Sample Application - cache:flush"
php -d memory_limit=-1 bin/magento cache:flush
echo "*disabling maintenance mode*"
bin/magento maintenance:disable
}
# Install Magento sample datas.
#su daemon -s /bin/bash
if [[ "$MAGENTO_ADMIN_TASK" = "yes" && ! -f /bitnami/magento/__INIT_IS_OK__ ]]; then
echo "--- STARTING INIT ---"
cd /bitnami/magento
echo "**update magento credentials"
#TODO: do it only on Admin ?
cd /bitnami/magento
mkdir -p /bitnami/magento/var/composer_home/
cat <<END > /bitnami/magento/var/composer_home/auth.json
{
"http-basic": {
"repo.magento.com": {
"username": "$MAGENTO_MARKETPLACE_PUBLIC_KEY",
"password": "$MAGENTO_MARKETPLACE_PRIVATE_KEY"
}
}
}
END
echo "*Install 1*"
install_sample
echo "*writing INIT result file*"
touch /bitnami/magento/__INIT_IS_OK__
else
echo "--- STARTING DO NOTHING ---"
fi
if [[ "$MAGENTO_ADMIN_TASK" = "yes" ]]; then
echo "Ensure all is good for magento"
php -d memory_limit=-1 bin/magento setup:upgrade
php -d memory_limit=-1 bin/magento setup:static-content:deploy -f
php -d memory_limit=-1 bin/magento cache:flush
fi