Pulsar allows you to run capistrano tasks via a separate repository where all your deploy configurations are stored.
You don’t need to have the application locally to deploy (and neither have all your application dependencies installed).
Once you have your own repository, you can gradully add configurations and recipes so that you never have to duplicate code again.
Pulsar is easy to integrate, you just need access to the configurations repository and the ability to run a command.
The most useful way of installing Pulsar is as a system gem:
$ gem install pulsar
This will install two commands:
pulsar-utils. The first command is required to run capistrano, the other is for everything else.
You'll need to create your own configuration repo:
$ pulsar-utils init ~/Desktop/pulsar-conf
This will create a basic start point for building your configuration repository. As soon as you're done configuring you should consider storing this folder as an actual git repository.
This is an example repository configuration layout:
pulsar-conf/ |── Gemfile ├── Gemfile.lock ├── apps │ ├── base.rb │ └── my_application │ ├── defaults.rb │ ├── production.rb │ ├── recipes │ │ └── custom_recipe.rb │ └── staging.rb └── recipes ├── generic │ ├── cleanup.rb │ ├── maintenance_mode.rb │ ├── notify.rb │ └── utils.rb ├── rails │ ├── passenger.rb │ ├── repair_permissions.rb │ ├── symlink_configs.rb │ ├── unicorn.rb │ └── whenever.rb └── spree_1 └── symlink_assets.rb
Pulsar uses these files to build capistrano configurations on the fly, depending on how you invoke the pulsar command. Since Pulsar it's basically a capistrano wrapper, the content of these files is plain old capistrano syntax.
After the repository is ready, running Pulsar is straightforward. To
deploy my_application to production:
$ pulsar my_application production
As a rule of thumb, anything that's added at the end of the command is passed to capistrano. Some examples:
$ pulsar my_application production --tasks $ pulsar my_application staging deploy:migrations $ pulsar my_application staging shell # # Deploy multiple apps by using commas # $ pulsar my_app1,my_app2,my_app3 production # # Deploy multiple apps by using pattern matching # (uses Dir.glob) # $ pulsar my_app* production # or $ pulsar *worker staging
In case you frequently work from a Rack application and would like a workflow similar to that of capistrano, Pulsar supports running from inside a Rack application directory. If you use this a lot, you should consider installing Pulsar via the application Gemfile.
When deploying from inside a Rack application you can omit the application name:
$ cd /path/to/my_application $ pulsar production $ pulsar staging deploy:migrations
More in-depth documentation on Github.