Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added lot of options for advanced deployment scenario #4

Merged
merged 3 commits into from
Aug 17, 2018
Merged

Added lot of options for advanced deployment scenario #4

merged 3 commits into from
Aug 17, 2018

Conversation

SagePtr
Copy link
Contributor

@SagePtr SagePtr commented Jun 21, 2018

These options are useful if you want to push source files and build project (or part of project):

  • EXCLUDE_FILES - specify which files should not to be copied to TARGET_DIR (usually source files, composer.json, etc. By default: .git)

  • RSYNC_FLAGS - specify rsync flags without modifying deploy.php (useful if your TARGET_DIR should keep certain owner:group, but rsync resets them)

  • COMMANDS_BEFORE_RSYNC - run certain commands under GIT_DIR between pulling updates from remote repo and doing rsync (composer install, webpack, etc)

  • COMMANDS_AFTER_RSYNC - run certain commands under TARGET_DIR after doing rsync (this can be rm cache/*.php -f for example)

  • CLEANUP_WORK_TREE - clean up GIT_DIR repo work tree after running all custom commands, resetting it to clean state (set to true it if you wish intermediate files not to survive between builds, does not affect TARGET_DIR content at all)

All these new options do not affect older config files. If they are missing in config, new functionality will be just ignored or set to default values (like hardcoded in old deploy.php).

EXCLUDE_FILES - specify files should not be copied to TARGET_DIR, default: .git
RSYNC_FLAGS - specify flags for rsync commands, default: -rltgoDzvO

If any of these options is not defined, default value will be used instead (the same as hardcoded before this commit)
COMMANDS_BEFORE_RSYNC - these commands will be run before checkout and rsync (useful for running build, etc)
COMMANDS_AFTER_RSYNC - these commands will be run after rsync (useful for cleaning cache folder on server, etc)

Doesn't break existing configs if they lack defines
Cleans git work tree after running custom commands. Does not clean TARGET_DIR
@lyquix-owner
Copy link
Member

Thank you for your contribution, these are great features!
Let me review them and if it all looks good I will merge this PR.

@lyquix-owner lyquix-owner merged commit 6189a40 into Lyquix:master Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants