sh magento 2初始化

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh magento 2初始化相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env bash
cd /var/www/vhosts/partyshowroom/production/htdocs/
echo 'Turning off static signing'
mysql -uroot -proot -Dparty_local<<<"UPDATE party_local.core_config_data SET value=0 WHERE path='dev/static/sign'"
composer install
echo 'Clearing magento cache...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/cache/*
echo 'Clearing page cache...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/page_cache/*
echo 'Setting developer mode'
php /var/www/vhosts/partyshowroom/production/htdocs/bin/magento deploy:mode:set developer
echo 'Restarting Varnish service'
sudo /etc/init.d/varnish restart
echo 'Clear generation files...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/generation/*
echo 'Clear view preprocessed...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/view_preprocessed/*
echo 'Clear Static files...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/pub/static/*
echo 'Upgrading modules...'
php /var/www/vhosts/partyshowroom/production/htdocs/bin/magento setup:upgrade
echo 'Running static content deploy'
php /var/www/vhosts/partyshowroom/production/htdocs/bin/magento setup:static-content:deploy en_GB
echo 'Running di compile'
php /var/www/vhosts/partyshowroom/production/htdocs/bin/magento setup:di:compile
echo 'setting user'
php /var/www/vhosts/partyshowroom/production/htdocs/bin/magento admin:user:create --admin-user="admin" --admin-password="test123456" --admin-email="testadmin@test.com" --admin-firstname="test" --admin-lastname="user"
echo 'Initialise complete'

以上是关于sh magento 2初始化的主要内容,如果未能解决你的问题,请参考以下文章

sh 安装Magento 2 cli#magento2

sh magento 2清除所有缓存文件

sh 为magento 2部署脚本

sh 安装magento 2

sh 添加Magento 2样本数据

sh 通过作曲家更新magento 2