Capistrano · Blogs
Blogs from Capistrano on TechiSeek brings together work published by Capistrano. Open any title to read it on the original site. See the newest titles. 35 public listings.
- Cold Start (Capistrano)At this point we should have a deploy user on all the servers we intend to deploy to, that user should have permission to write to wherever…
- Configuration (Capistrano)set :application, 'MyLittleApplication' # use a lambda to delay evaluation set :special_thing, -> { "SomeThing_#{fetch :other_config}" } A…
- Remote file task (Capistrano)The remote_file task is allowing the existence of a remote file to be set as a prerequisite. These tasks can in turn depend on local files…
- Upgrading from v2.x.x (Capistrano)1. Update your Gemfile: gem 'capistrano', '~> 3.0', require: false, group: :development
- Authentication & Authorisation (Capistrano)Note: In the documentation we simply recommend creating a single deployment user, and sharing it between team members. If you know why this…
- Custom Rails Tasks (Capistrano)namespace :deploy do desc 'Runs any rake task, cap deploy:rake task=db:rollback' task rake: [:set_rails_env] do on release_roles([:db]) do…
- Remote commands with SSH Kit (Capistrano)on roles(:app), in: :sequence, wait: 5 do within "/opt/sites/example.com" do # commands in this block execute in the # directory: /opt/site…
- Role filtering (Capistrano)You may have situations where you only want to deploy to servers matching a single role. For example, you may have changed some aspect of h…
- Version Locking (Capistrano)Capistrano will, by default, include a lock command at the top of deploy.rb. This checks that the version of Capistrano running the configu…
- 3rd Party Plugins (Capistrano)Here are some Capistrano plugins you might find useful. This list is neither complete nor audited in any way.
- Properties (Capistrano)Server objects in Capistrano essentially consist of a name and a hash: The name is the DNS name (or IP address) and the hash contains the ‘…
- Preparing Your Application (Capistrano)This will focus on preparing a Rails application, but most ideas expressed here have parallels in Python, or PHP applications
- How can I get Capistrano to prompt for a password? (Capistrano)Password authentication can be done via ask in your deploy environment file (e.g.: config/environments/production.rb)
- Task Cookbook (Capistrano)These pages document common custom tasks for specific use cases. It is hoped that these will be copied and modified for your use case, and…
- Structure (Capistrano)Capistrano uses a strictly defined directory hierarchy on each remote server to organise the source code and other deployment-related data.…
- Host filtering (Capistrano)You may encounter situations where you only want to deploy to a subset of the servers defined in your configuration. For example, a single…
- What is Capistrano? (Capistrano)It supports the scripting and execution of arbitrary tasks, and includes a set of sane-default deployment workflows.
- PTYs (Capistrano)There is a configuration option which asks the backend driver to ask the remote host to assign the connection a pty. A pty is a pseudo-term…
- Overriding Capistrano tasks (Capistrano)When re-defining a task in Capistrano v2, the original task was replaced. The Rake DSL on which Capistrano v3 is built is additive however,…
- Filtering (Capistrano)Filtering
- Tasks (Capistrano)server 'example.com', roles: [:web, :app] server 'example.org', roles: [:db, :workers] desc "Report Uptimes" task :uptime do on roles(:all)…
- Before / After Hooks (Capistrano)# call an existing task before :starting, :ensure_user after :finishing, :notify # or define in block namespace :deploy do before :starting…
- Local Tasks (Capistrano)desc 'Notify service of deployment' task :notify do run_locally do with rails_env: :development do rake 'service:notify' end end end Of cou…
- Rollbacks (Capistrano)In the majority of failed deployment situations, it probably makes more sense to revert the bad code and redeploy, rather than running depl…
- How can I set Capistrano configuration paths? (Capistrano)# default deploy_config_path is 'config/deploy.rb' set :deploy_config_path, 'cap/deploy.rb' # default stage_config_path is 'config/deploy'…
- Console (Capistrano)Note: Here be dragons. The console is very immature, but it’s much more cleanly architected than previous incarnations and it’ll only get b…
- Why does something work in my SSH session, but not in Capistrano? (Capistrano)This is possibly one of the most complicated support questions that can be asked, the only real answer is it depends.
- How can I access stage configuration variables? (Capistrano)local = fetch(:configuration_variable, _default_value_) This works fine when accessing configuration variables defined within the same file…
- Property Filtering (Capistrano)Options may be passed to the roles() method (and implicitly in methods like release_roles() and primary()) that affect the set of servers r…
- Custom SCM (Capistrano)Capistrano uses what it calls “SCM plugins” (Source Code Management), to deploy your source code from a central repository. Out of the box,…
- Ignoring (Capistrano)Files committed to version control (i.e. not in .gitignore) can still be ignored when deploying. To ignore these files or directories, simp…
- Validation of variables (Capistrano)validate :some_key do |key, value| if value.length < 5 raise Capistrano::ValidationError, "Length of #{key} is too short!" end end Multiple…
- Flow (Capistrano)deploy:starting - start a deployment, make sure everything is ready deploy:started - started hook (for custom tasks) deploy:updating - upda…
- Installation (Capistrano)Capistrano can be installed as a standalone Gem, or bundled into your application.
- A remote server automation and deployment tool written in Ruby. (Capistrano)A remote server automation and deployment tool written in Ruby.