You'll need about one minute to read this article.
You can deploy any kind of application with Capistrano. For detailed information about Capistrano check capistranorb.com. Don’t forget to include Capistrano in your projects as it’s not preinstalled on our build servers.
To setup a Capistrano deployment on Codeship, first create a new custom script deployment. From there you can add any commands you need, including installing and calling your Capistrano deployment.
gem install capistrano
bundle exec cap $STAGE deploy
Usually Capistrano relies on a SSH connection to copy files and execute remote commands. If connecting to your server fails with an error message (e.g. asking for a password), please take a look at our documentation on authenticating via SSH public keys for more information.
If you don’t have Capistrano in your Gemfile
you need to install it first. Simply add the following command to a script based deployment which runs before the Capistrano deployment.
gem install capistrano
Because Codeship only fetches the last 50 commits as well as checks out your repository in detached head mode, Capistrano may fail the deployment. If this is the case for your setup, please add the following two commands to your deployment script. They will fetch the full history of the repository and switch to the branch you are currently testing.
git fetch --unshallow || true
git checkout "${CI_BRANCH}"
You can post on Stack Overflow using the tag #codeship
or contact our Helpdesk.
We also have a couple of code examples and sample projects available.