0

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
3
  • why would you want to uninstall/install it every night? Commented May 7, 2015 at 9:18
  • We report/share code/try to improve Magento. And for this often the Mage2 team asks if we are running last version. Also - for testing purposes I would really not like to spend a lot if time on installation. Rather I would like to call a script. Get the last version. Test whatever I want to verify. Doesn't seem so strange if you ask me. I have seen many systems that have nightly updates. Have you seen/made such a script? Commented May 7, 2015 at 9:20
  • Also - to date we have not found a public demo (last version) - so we need to install it on our own server. Or are Mage2 public demo's available? Not being alpha etc Commented May 7, 2015 at 9:21

1 Answer 1

1

This tweet by Mark Shust might help - Docker installations of Magento 2. (But note that at GA, the recommended way to develop will be via Composer builds, not git clone, so the code will only update when a patch etc is released.) https://twitter.com/markshust/status/608818961275211777

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.