Last active
June 2, 2022 11:53
-
-
Save cfxd/8a12db41571b593f0822 to your computer and use it in GitHub Desktop.
Deploy WordPress (Bedrock) with Capistrano to a Shared Host (Bluehost). See http://cfxdesign.com/deploy-wordpress-with-capistrano-on-bluehost/
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
RewriteEngine on | |
#change dev.example.com to your domain name | |
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$ | |
RewriteCond %{REQUEST_URI} !^/current/web/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /current/web/$1 | |
#change dev.example.com to your domain name | |
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$ | |
RewriteRule ^(/)?$ current/web/index.php [L] |
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
set :application, 'dev.example.com' | |
set :repo_url, '[email protected]:username/repo.git' | |
set :branch, :master | |
set :deploy_to, -> { "/home2/whatever/public_html/#{fetch(:application)}" } | |
set :log_level, :debug | |
set :linked_files, %w{.env web/.htaccess} | |
set :linked_dirs, %w{web/app/uploads} | |
set :tmp_dir, "/home2/whatever/capistrano_tmp" | |
SSHKit.config.command_map[:bash] = "/usr/bin/bash" | |
SSHKit.config.command_map[:composer] = "php-cli /home2/whatever/composer.phar" | |
namespace :deploy do | |
desc 'Restart application' | |
task :restart do | |
on roles(:app), in: :sequence, wait: 5 do | |
# Your restart mechanism here, for example: | |
# execute :service, :nginx, :reload | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment