Skip to content

Instantly share code, notes, and snippets.

@mneuhaus
Created September 6, 2019 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mneuhaus/677ab0a3757f8f277ea30352b7fa103d to your computer and use it in GitHub Desktop.
Save mneuhaus/677ab0a3757f8f277ea30352b7fa103d to your computer and use it in GitHub Desktop.
# ----------------------------------------------------------------------#
# 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