Last active
October 11, 2018 23:14
-
-
Save diegogurpegui/a24c7474ddcd16dc546d970ba40895b9 to your computer and use it in GitHub Desktop.
Script to deploy a Symfony project from a Git repository
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 | |
# Fetch from repository | |
git fetch origin | |
reslog=$(git log HEAD..origin/master --oneline) | |
git reset --hard origin/master | |
if [ "${reslog}" != "" ] ; then | |
git merge origin/master # completing the pull | |
# Symfony deployment | |
export SYMFONY_ENV=prod | |
composer install --no-dev --optimize-autoloader | |
# Clear Symfony cache | |
php bin/console cache:clear --env=prod --no-debug | |
# Dump assetic assets | |
php bin/console assetic:dump --env=prod --no-debug | |
# Remove cache dir so it can be created with httpd user | |
rm -R var/cache/prod | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment