Last active
October 16, 2022 10:13
-
-
Save TheJotob/20f3640af2476b1c93a71e4a4e1a2d2f to your computer and use it in GitHub Desktop.
Deployer configuration Wordpress
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
<?php | |
namespace Deployer; | |
require 'recipe/common.php'; | |
inventory('.deployer/hosts.yml'); | |
set('webroot', 'web'); | |
// Shared files/dirs between deploys | |
set('shared_files', [ | |
'.env' | |
]); | |
set('shared_dirs', [ | |
'{{webroot}}/app/uploads', | |
'{{webroot}}/app/cache', | |
'{{webroot}}/app/languages', | |
]); | |
// Writable dirs by web server | |
set('writable_dirs', [ | |
'{{webroot}}/app/uploads', | |
'{{webroot}}/app/cache', | |
'{{webroot}}/app/languages', | |
]); | |
task('deploy:update_code', function () { | |
upload('.', '{{release_path}}'); | |
}); | |
// Tasks | |
desc('Deploy your project'); | |
task('deploy', [ | |
'deploy:info', | |
'deploy:prepare', | |
'deploy:lock', | |
'deploy:release', | |
'deploy:update_code', | |
'deploy:shared', | |
'deploy:writable', | |
'deploy:clear_paths', | |
'deploy:symlink', | |
'deploy:unlock', | |
'cleanup', | |
'success' | |
]); | |
// [Optional] If deploy fails automatically unlock. | |
after('deploy:failed', 'deploy:unlock'); |
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
# In subdirectory .deployer | |
.base: &base | |
bin/php: php | |
configFile: .deployer/ssh_config | |
http_user: <php user> | |
hostname: <hostname in ssh_config> | |
sshOptions: | |
StrictHostKeyChecking: no | |
production: | |
<<: *base | |
stage: production | |
deploy_path: </absolute/path/to/root/directory> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment