Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Settings up deployments

Koen edited this page Aug 1, 2019 · 3 revisions

For deployments we use Capistrano, which is exposed on the CLI by the cap command.

Configuring Capistrano

You'll need to set a few thing before we can do the first time server setup:

In config/deploy.rb:

  • Set the application name (in kebab-casing)
  • Set the repo_url

In config/deploy/<environment>.rb:

  • Set the server hostname or IP address
  • Set the SSH user
  • Set the deploy_to directory

First time server setup

Initial server setup can be done via:

$ cap <environment> deploy:setup

This will create a few directories, install Composer and WP-CLI, and copy some files which need to be persistent between deploys (eg. files in de shared folder and an initial .env file).

Resolving issues

Capistrano is not always clear on what the issue is and where it comes from. Some common pitfalls:

  • Make sure your SSH key is forwarded
  • Make sure your SSH key is added to your shell. Add this to your .bash_profile (or alternative) will ensure it is loaded every time: ssh-add ~/.ssh/id_rsa > /dev/null 2>&1
  • Make sure the branch or tag you're trying to deploy exist

See also: