Created
September 6, 2019 08:16
-
-
Save mneuhaus/677ab0a3757f8f277ea30352b7fa103d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# ----------------------------------------------------------------------# | |
# Live environment # | |
# ----------------------------------------------------------------------# | |
production/host = foo.com | |
production/user = bar | |
production/port = 22 | |
production/path = /var/www/foo.com/ | |
define production/shell | |
ssh $(production/user)@$(production/host) -p$(production/port) 'cd $(production/path) &&$1' | |
endef | |
production/deploy: build/production | |
git -C ./ ls-files --exclude-standard -oi --directory > /tmp/excludes; | |
rsync -rz \ | |
--exclude=".git" \ | |
--exclude-from="/tmp/excludes" \ | |
-e 'ssh -p$(production/port)' \ | |
'./' \ | |
'$(production/user)@$(production/host):$(production/path)' | |
rsync -rz \ | |
-e 'ssh -p$(production/port)' \ | |
'./$(asset_path)/Build/' \ | |
'$(production/user)@$(production/host):$(production/path)$(asset_path)/Build/' | |
$(call production/shell, composer install --ignore-platform-reqs) | |
$(call production/shell, ./bin/console doctrine:migrations:migrate --no-interaction) | |
$(call production/shell, ./bin/console assets:install) | |
$(call production/shell, ./bin/console cache:clear --env=prod) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment