Skip to content

Instantly share code, notes, and snippets.

@raphaelbruno
Created September 12, 2021 00:28
Show Gist options
  • Save raphaelbruno/0f9649e030ef6a09858f3eb028d637cb to your computer and use it in GitHub Desktop.
Save raphaelbruno/0f9649e030ef6a09858f3eb028d637cb to your computer and use it in GitHub Desktop.
Hook post-reveice (git init --bare)
#!/bin/bash
APP=/var/www/html
echo "================= Git Checkout ==================="
GIT_WORK_TREE=${APP} git checkout -f
echo "Updated ${APP}"
echo "============== Delete Unused Files ==============="
rm ${APP}/README.md
rm ${APP}/docker-compose.yml.example
rm ${APP}/.env.example
rm -r ${APP}/.docker
echo "Files deleted"
echo "============= Update Migrations =============="
php ${APP}/artisan migrate
echo "========== Update Composer Dependencies =========="
composer install -d ${APP}
echo "Finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment