Home › Forums › ACF PRO › Composer Support › Reply To: Composer Support
Hey Tommy, I’ve got a similar approach with Bedrock but I’m running composer and wpcli tasks automatically in my deploy.rb. Kinda think having to SSH manually goes against the reason for using automated deploys.
You need gem 'capistrano-composer'
in your gemfile (+ run bundle install). Looks like you’re already using the capistrano-wpcli one though?
So I assume you’ve set the remote url in your stage rb files:
e.g. set :wpcli_remote_url, 'http://staging.yoursite.com'
for staging.rb
Then you need the WP-cli config in your deploy.rb, e.g:
# WPCLI config
set :wpcli_local_url, 'http://local.yoursite.com'
set :wpcli_local_uploads_dir, 'web/app/uploads/'
set :wpcli_remote_uploads_dir, -> { shared_path.join('web/app/uploads') }
set :wpcli_rsync_options, '-rlvz -e "ssh -p4444" --stats --delete --delete-after'
Note, I also push uploads and I need a custom port for ssh, not everyone would need that.
THEN add a task to run sync in your namespace :deploy do
desc 'Keep WP synced'
task :wp_sync do
on roles(:db) do
info "Push local database and uploads"
within release_path do
invoke 'wpcli:db:push'
invoke 'wpcli:rewrite:flush'
invoke 'wpcli:uploads:rsync:push'
end
end
end
Then (usually) at the end of your deploy namespace, you need to attach the tasks to the Capistrano flow, with after :updated, 'deploy:wp_sync'
As for your “Invalid post type” error, I can’t help you though. Just tried the same process and mine works. :/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.