mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
added documentation to allow using capistrano from ruby script
This commit is contained in:
parent
d04d43c296
commit
45c72dc4b4
2 changed files with 25 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
|
||||
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
|
||||
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
|
||||
<li><a href="/documentation/getting-started/capistrano-in-ruby-script/">Capistrano in ruby script</a></li>
|
||||
<li class="divider"></li>
|
||||
<h5>Framework Extensions</h5>
|
||||
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
title: Capistrano in ruby script
|
||||
layout: default
|
||||
---
|
||||
Instead of building a config folder and deploy, you may want to programmatically set everything in a single ruby script. This could be done as follows:
|
||||
{% prism ruby %}
|
||||
require 'capistrano/all'
|
||||
|
||||
stages = "production"
|
||||
set :application, 'my_app_name'
|
||||
set :repo_url, 'git@github.com:capistrano/capistrano.git'
|
||||
set :deploy_to, '/var/www/'
|
||||
set :stage, :production
|
||||
role :app, %w{}
|
||||
|
||||
require 'capistrano/setup'
|
||||
require 'capistrano/deploy'
|
||||
Dir.glob('capistrano/tasks/*.cap').each { |r| import r }
|
||||
|
||||
Capistrano::Application.invoke("production")
|
||||
Capistrano::Application.invoke("deploy")
|
||||
{% endprism%}
|
||||
|
||||
Note that the require order is important as the stage needs to be set before you load setup and deploy.
|
Loading…
Add table
Add a link
Reference in a new issue