From 422895193f2e3fe4ec0ec170e984d0492b5e9f70 Mon Sep 17 00:00:00 2001 From: Jordi Puigdellivol Date: Thu, 22 Mar 2018 17:20:23 +0100 Subject: [PATCH] added deploy script --- deploy.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 00000000..16a0b257 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +main() { + # Getting last version + git pull + + # Shutdown the laravel app + php artisan down + + # Install new composer packages + composer install --no-dev --prefer-dist --optimize-autoloader + + # Cache boost configuration and routes + php artisan cache:clear + php artisan config:cache + php artisan route:cache + php artisan queue:restart + + # Sync database changes + if [ "$1" == "migrate" ] + then + php artisan migrate + fi + + # Rise from the ashes + php artisan up + + echo '' + echo '🔥 Deploy finished 🔥' + echo '' +} + +main $1