-
Notifications
You must be signed in to change notification settings - Fork 5
/
deploy-zdd.sh
28 lines (27 loc) · 1.49 KB
/
deploy-zdd.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
/usr/share/stratus/cli crons.stop;
### PUSH NEW CODE/UPDATES HERE
### git pull etc
/usr/local/bin/php -dmemory_limit=20000M bin/magento setup:upgrade;
/usr/local/bin/php -dmemory_limit=20000M bin/magento setup:di:compile;
/usr/local/bin/php -dmemory_limit=20000M /usr/local/bin/composer dump-autoload --no-dev --optimize --apcu;
/usr/local/bin/php -dmemory_limit=20000M bin/magento setup:static-content:deploy --jobs=$(nproc);
/usr/share/stratus/cli zerodowntime.init;
/usr/share/stratus/cli zerodowntime.switch;
echo "\e[41m****Flushing Magento, Varnish, Redis and CloudFront CDN cache at this stage****";
/usr/local/bin/php -dmemory_limit=20000M bin/magento cache:clean;
/usr/local/bin/php -dmemory_limit=20000M bin/magento cache:flush;
/usr/share/stratus/cli cache.opcache.flush;
/usr/share/stratus/cli cache.cloudfront.invalidate;
/usr/share/stratus/cli cache.varnish.clear;
redis-cli -h redis flushall && redis-cli -h redis-config-cache -p 6381 flushall;
echo "\e[41m****Deployment Finished Site Enabled and tested****";
status_code=$(curl -kI --header 'Host: {yourhost}.com' --write-out %{http_code} --silent --output /dev/null 'https://nginx/')
if [[ "$status_code" -ne 200 ]] ; then
echo "Site not active $status_code please push script again"
else
echo "\e[41m****Beginning Indexing****";
n98-magerun2 sys:cron:run indexer_reindex_all_invalid;
n98-magerun2 sys:cron:run indexer_update_all_views;
/usr/share/stratus/cli crons.start
echo "\e[41m****Activity Completed please visit store and test****";
fi