Simple Magento Deployment Script

Here is a quick bash script I created to do a magento deployment. This assumes your magento code is managed by git and you have n98-magerun installed on the server. Run this in your project root like “bash mybranchname;” .

echo "creating maintenance file";
touch maintenance.flag;
echo "fetching and checking out " $1;
git fetch && git checkout $1;
echo "clearing cache";
n98-magerun cache:flush;
echo "running installers";
n98-magerun sys:setup:run;
echo "removing maintenance file";
rm maintenance.flag;
echo "done";

Leave a comment

Your email address will not be published. Required fields are marked *