Last active
June 6, 2020 00:06
-
-
Save ccfelix/b300e42851ae43f01e9ea0165e2d47df to your computer and use it in GitHub Desktop.
post-receive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GIT_WORK_TREE=/var/www/sub_temp git checkout -f | |
changedfiles=( `git diff-tree --no-commit-id --name-only HEAD^ HEAD` ) | |
cd /var/www/sub_temp/ | |
# check if composer has been updated, if so install | |
# Check if the composer.lock file is present | |
if [[ "${changedfiles[*]}" =~ "composer.lock" ]]; then | |
# Install or update packages specified in the lock file | |
echo "****** composer.lock has been updated - do install ******" | |
composer install --no-dev | |
fi | |
php artisan config:cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment