Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AshishDhamalaAD/31decb8d393bcb090956d36bb094111b to your computer and use it in GitHub Desktop.
Save AshishDhamalaAD/31decb8d393bcb090956d36bb094111b to your computer and use it in GitHub Desktop.

Git post-receive for laravel project deployment

#!/bin/sh
echo -e "\e[92m Cd into project directory \e[97m"
cd /path/to/project/

echo -e "\e[92m composer install \e[97m"
/usr/local/bin/php /usr/local/bin/composer/composer.phar install --no-dev

echo -e "\e[92m php artisan migrate \e[97m"
/usr/local/bin/php artisan migrate --force

echo -e "\e[92m php artisan route:cache \e[97m"
/usr/local/bin/php artisan route:cache

echo -e "\e[92m php artisan config:cache \e[97m"
/usr/local/bin/php artisan config:cache

echo -e "\e[92m php artisan queue:restart \e[97m"
/usr/local/bin/php artisan queue:restart

echo -e "\e[92m npm install \e[97m"
/usr/bin/npm install

echo -e "\e[92m npm run prod \e[97m"
/usr/bin/npm run prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment