I was wondering if there is way to install/upgrade Magento2 every night using a shell install script run by cron. Our server runs Centos/Nginx/Php-fpm.
Question: I was fiddling with some code and thought I'd share it now - because maybe an auto-cron isntall script for Magento2 already exists?
#!/bin/sh
su myusername
MAGEDIR="/home/myusername/domains/example.com/public_html/"
cd $MAGEDIR
rm -rf $MAGEDIR*
git clone https://github.com/magento/magento2.git
chown -R myusername $MAGEDIR
sudo find $MAGEDIR -type d -exec chmod 700 {} \;
sudo find $MAGEDIR -type f -exec chmod 600 {} \;
composer install
chown -R myusername $MAGEDIR
check for complete reinstall flag or nightly update
cd $MAGEDIR/bin
if {update}
php magento setup:install --base_url=http://example.com --backend_frontname=beheer --db_host --db_name --db_user --db_password --admin_firstname=admin --admin_lastname=admin [email protected] --admin_user=admin --admin_password=MYPASSWD --language=en_US --currency=dollar --timezone=Ams/nl
{else}
complete reinstall here
--clean_database
check for sample data flag