deployable 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +13 -0
- data/LICENSE +22 -0
- data/README.md +42 -0
- data/deployable.gemspec +9 -4
- data/examples/config/deploy/production.rb +35 -0
- data/examples/config/deploy.rb +24 -0
- data/examples/scripts/initd.rb +53 -35
- data/lib/deployable/bundle.rb +45 -0
- data/lib/deployable/config_files.rb +97 -0
- data/lib/deployable/recipes/default_with_database.rb +47 -0
- data/lib/deployable/version.rb +1 -1
- data/lib/deployable.rb +1 -0
- metadata +100 -26
- data/examples/config/deploy/acceptance.rb +0 -0
- data/lib/deployable/bundler-0.7.rb +0 -23
data/.gitignore
CHANGED
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
lib/deployable/**/*.rb - README.md CHANGELOG.md LICENSE lib/deployable/*.rb
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
## 0.0.2 (January 24th, 2012)
|
2
|
+
|
3
|
+
* Added license
|
4
|
+
* Improved documentation
|
5
|
+
* Added a default recipe using a database
|
6
|
+
* New and improved initrd script (list/info commands)
|
7
|
+
* Add capistrano as a gem dependency
|
8
|
+
* Removed support for Bundler 0.7.x
|
9
|
+
|
10
|
+
|
11
|
+
## 0.0.1 (January 22nd, 2012)
|
12
|
+
|
13
|
+
Initial public release of Deployable gem.
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Digitpaint
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
Deployable: A collection of handy capistrano tasks and recipes
|
2
|
+
==============================================================
|
3
|
+
|
4
|
+
**Homepage**: [http://github.com/digitpaint/deployable](http://github.com/digitpaint/deployable)
|
5
|
+
**Git**: [git@github.com:digitpaint/deployable.git](git@github.com:digitpaint/deployable.git)
|
6
|
+
**Author**: Digitpaint
|
7
|
+
**License**: [MIT license](http://www.opensource.org/licenses/MIT)
|
8
|
+
|
9
|
+
Synopsis
|
10
|
+
--------
|
11
|
+
|
12
|
+
After years of copying our deploy script from one application to another it was time to consolidate all these variants into one authoritive source for all our deploy (and capistrano) related tasks. This library contains commonly used capistrano tasks, a couple of default recipes and example configurations.
|
13
|
+
|
14
|
+
Usage
|
15
|
+
-----
|
16
|
+
|
17
|
+
1. Add the `deployable` gem to your gemfile:
|
18
|
+
|
19
|
+
group :development do
|
20
|
+
gem "deployable"
|
21
|
+
end
|
22
|
+
|
23
|
+
2. Config your deploy script (see the `examples/config` directory for some inspiration)
|
24
|
+
|
25
|
+
|
26
|
+
Source
|
27
|
+
------
|
28
|
+
|
29
|
+
deployable's git repo is available on GitHub, which can be browsed at:
|
30
|
+
|
31
|
+
http://github.com/digitpaint/deployable
|
32
|
+
|
33
|
+
and cloned from:
|
34
|
+
|
35
|
+
git://github.com/digitpaint/deployable.git
|
36
|
+
|
37
|
+
|
38
|
+
Copyright
|
39
|
+
---------
|
40
|
+
|
41
|
+
Deployable © 2012 by [Digitpaint](mailto:info@digitpaint.nl). Licensed under the MIT
|
42
|
+
license. Please see the {file:LICENSE} for more information.
|
data/deployable.gemspec
CHANGED
@@ -7,9 +7,9 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Deployable::VERSION
|
8
8
|
s.authors = ["Digitpaint", "Flurin Egger"]
|
9
9
|
s.email = ["info@digitpaint.nl", "flurin@digitpaint.nl"]
|
10
|
-
s.homepage = ""
|
11
|
-
s.summary = %q{A collection of handy capistrano
|
12
|
-
s.description =
|
10
|
+
s.homepage = "https://github.com/DigitPaint/Deployable"
|
11
|
+
s.summary = %q{A collection of handy capistrano tasks and recipes}
|
12
|
+
s.description = %q{This library contains commonly used capistrano tasks, a couple of default recipes and example configurations.}
|
13
13
|
|
14
14
|
s.rubyforge_project = "deployable"
|
15
15
|
|
@@ -20,5 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
# specify any dependencies here; for example:
|
22
22
|
# s.add_development_dependency "rspec"
|
23
|
-
|
23
|
+
s.add_runtime_dependency "capistrano", "~> 2.9.0"
|
24
|
+
s.add_runtime_dependency "capistrano-ext", "~> 1.2.1"
|
25
|
+
|
26
|
+
# This may be deleted in future versions. Needed because in older
|
27
|
+
# rubies you get Abort Trap 6 errors in gem
|
28
|
+
s.add_runtime_dependency "highline", "1.5.2"
|
24
29
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Servers
|
2
|
+
role :app, "APPSERVER", :primary => true
|
3
|
+
role :db, "DBSERVER", :primary => true
|
4
|
+
|
5
|
+
# RVM configuration
|
6
|
+
set :rvm_ruby_string, "RUBYVERSION@#{application}-#{stage}"
|
7
|
+
set :rvm_type, :user
|
8
|
+
|
9
|
+
# Deploy location / code
|
10
|
+
set :deploy_to, "DEPLOYLOCATION/#{application}/#{stage}"
|
11
|
+
set :branch, "master"
|
12
|
+
|
13
|
+
# Passenger config
|
14
|
+
set :passenger_standalone, {
|
15
|
+
:passenger => {
|
16
|
+
:port => 10001
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
# Database config
|
21
|
+
set :database_config, {
|
22
|
+
:adapter => "mysql",
|
23
|
+
:username => "",
|
24
|
+
:host => "",
|
25
|
+
:development => "",
|
26
|
+
:test => "",
|
27
|
+
:production => ""
|
28
|
+
}
|
29
|
+
|
30
|
+
# Bundle configuration (is optional)
|
31
|
+
set :bundle_config, {
|
32
|
+
:build => {
|
33
|
+
:mysql => "--with-mysql-config='/usr/bin/mysql_config'"
|
34
|
+
}
|
35
|
+
}
|
data/examples/config/deploy.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
# ======================================
|
2
|
+
# = Base deploy script for application =
|
3
|
+
# ======================================
|
4
|
+
# Run with: bundle exec cap STAGE deploy
|
5
|
+
# ======================================
|
6
|
+
|
7
|
+
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
|
8
|
+
|
9
|
+
# ======================================
|
10
|
+
|
11
|
+
set :stages, %w(production)
|
12
|
+
set :application, "APPLICATION NAME"
|
13
|
+
set :repository, "git@reposerver:#{application}.git"
|
14
|
+
set :scm, "git"
|
15
|
+
|
16
|
+
set :deploy_via, :remote_cache
|
17
|
+
set :git_enable_submodules, 1
|
18
|
+
|
19
|
+
set :user, "admin"
|
20
|
+
set :use_sudo, false
|
21
|
+
|
22
|
+
# ======================================
|
23
|
+
|
24
|
+
require 'deployable/recipes/default_with_database'
|
data/examples/scripts/initd.rb
CHANGED
@@ -40,46 +40,46 @@ APPLICATIONS_PATH = USER_HOME_PATH + "/applications/"
|
|
40
40
|
# Main start routine.
|
41
41
|
def run!
|
42
42
|
command = ARGV.first
|
43
|
-
available_commands = %w{start stop list}
|
43
|
+
available_commands = %w{start stop list info}
|
44
44
|
raise "Use one of #{available_commands.join("|")} as first argument" unless available_commands.include?(command)
|
45
45
|
|
46
46
|
applications = Dir.glob("#{APPLICATIONS_PATH}*/*").inject({}){|mem, dir| parts = dir.split("/"); mem[parts[-2]] ||= []; mem[parts[-2]] << parts[-1]; mem}
|
47
47
|
|
48
|
+
|
48
49
|
if command == "list"
|
49
|
-
|
50
|
-
puts
|
51
|
-
puts
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
50
|
+
head = "| " + "Application".ljust(60) + " | " + "Stage".ljust(20) + " | " + "Port".ljust(6) + " | " + "RVM".ljust(80) + " |"
|
51
|
+
puts "-" * head.size
|
52
|
+
puts head
|
53
|
+
puts "-" * head.size
|
54
|
+
end
|
55
|
+
|
56
|
+
if application = ARGV[1]
|
57
|
+
unless applications.has_key?(application)
|
58
|
+
raise "Can't find application #{application}"
|
58
59
|
end
|
59
|
-
else
|
60
|
-
if application = ARGV[1]
|
61
|
-
unless applications.has_key?(application)
|
62
|
-
raise "Can't find application #{application}"
|
63
|
-
end
|
64
60
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
end
|
69
|
-
Application.new(application,stage).start_or_stop!(command)
|
70
|
-
else
|
71
|
-
applications[application].each do |stage|
|
72
|
-
Application.new(application,stage).start_or_stop!(command)
|
73
|
-
end
|
61
|
+
if stage = ARGV[2]
|
62
|
+
unless applications[application].include?(stage)
|
63
|
+
raise "Stage #{stage} not found for application #{application}"
|
74
64
|
end
|
65
|
+
Application.new(application,stage).run!(command)
|
75
66
|
else
|
76
|
-
applications.each do |
|
77
|
-
|
78
|
-
Application.new(application,stage).start_or_stop!(command)
|
79
|
-
end
|
67
|
+
applications[application].each do |stage|
|
68
|
+
Application.new(application,stage).run!(command)
|
80
69
|
end
|
81
70
|
end
|
71
|
+
else
|
72
|
+
applications.sort.each do |application, stages|
|
73
|
+
stages.each do |stage|
|
74
|
+
Application.new(application,stage).run!(command)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
if command == "list"
|
80
|
+
puts "-" * head.size
|
82
81
|
end
|
82
|
+
|
83
83
|
true
|
84
84
|
end
|
85
85
|
|
@@ -92,22 +92,40 @@ class Application
|
|
92
92
|
def initialize(application_name,stage)
|
93
93
|
@path = Pathname.new("#{APPLICATIONS_PATH}#{application_name}/#{stage}")
|
94
94
|
@name = application_name
|
95
|
-
@stage =
|
95
|
+
@stage = stage
|
96
96
|
|
97
97
|
# Sanity check!
|
98
98
|
raise "No server.yml found in '#{@path}'" unless File.exist?(@path +"server.yml")
|
99
99
|
|
100
100
|
# Load config
|
101
|
-
@config = YAML.load(File.read((@path +"server.yml").to_s))
|
101
|
+
@config = YAML.load(File.read((@path +"server.yml").to_s))
|
102
102
|
end
|
103
103
|
|
104
|
-
def
|
104
|
+
def run!(command)
|
105
105
|
case command
|
106
106
|
when "start" then self.start!
|
107
107
|
when "stop" then self.stop!
|
108
|
+
when "info" then self.info!
|
109
|
+
when "list" then self.list!
|
108
110
|
end
|
109
111
|
end
|
110
112
|
|
113
|
+
def info!
|
114
|
+
fw = 6
|
115
|
+
say "#{self.name} - #{self.stage}"
|
116
|
+
say " " + "Path".ljust(fw) + ": " + self.path.to_s
|
117
|
+
say " " + "RVM".ljust(fw) + ": " + self.config["rvm"]["rvm_ruby_string"]
|
118
|
+
say " " + "Port".ljust(fw) + ": " + self.config["passenger"]["port"]
|
119
|
+
end
|
120
|
+
|
121
|
+
def list!
|
122
|
+
say "| " + field(self.name, 60) + " | " + field(self.stage, 20) + " | " + field(self.config["passenger"]["port"],6) + " | " + field(self.config["rvm"]["rvm_ruby_string"], 80) + " |"
|
123
|
+
end
|
124
|
+
|
125
|
+
def field(txt, len)
|
126
|
+
txt.to_s.ljust(len)[0,len]
|
127
|
+
end
|
128
|
+
|
111
129
|
def start!
|
112
130
|
say "Start #{USER} #{self.name} #{self.stage}"
|
113
131
|
|
@@ -121,7 +139,7 @@ class Application
|
|
121
139
|
run_callback(:start, :before)
|
122
140
|
|
123
141
|
# Start the server
|
124
|
-
puts rvm_execute(self.config, "passenger start #{self.path + "current"} --user #{
|
142
|
+
puts rvm_execute(self.config, "passenger start #{self.path + "current"} --user #{USER} --port #{self.config['passenger']['port']} --environment production -d --pid-file #{self.path + "passenger.pid"}")
|
125
143
|
|
126
144
|
# Run the after start callback
|
127
145
|
run_callback(:start, :after)
|
@@ -146,7 +164,7 @@ class Application
|
|
146
164
|
|
147
165
|
protected
|
148
166
|
|
149
|
-
def
|
167
|
+
def run_callback(key, time)
|
150
168
|
return unless self.config.has_key?("callbacks")
|
151
169
|
|
152
170
|
callbacks = self.config["callbacks"]
|
@@ -182,9 +200,9 @@ begin
|
|
182
200
|
if run!
|
183
201
|
puts "Done!"
|
184
202
|
else
|
185
|
-
puts "Usage: passenger-standalone {start|stop|
|
203
|
+
puts "Usage: passenger-standalone {start|stop|info} [application] [stage]"
|
186
204
|
end
|
187
205
|
rescue StandardError => e
|
188
206
|
puts "ERROR: #{e.message}"
|
189
|
-
puts "Usage: passenger-standalone {start|stop|
|
207
|
+
puts "Usage: passenger-standalone {start|stop|info} [application] [stage]"
|
190
208
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# = Bundler 1.0.x related tasks
|
2
|
+
#
|
3
|
+
# == Usage
|
4
|
+
# For some dependencies you need extra config parameters. Bundler supports these by setting "bundle config ...."
|
5
|
+
# Our config takes care of this serverside. All you need to do are
|
6
|
+
#
|
7
|
+
# Set: "after 'deploy:finalize_update', 'bundle:config'" (you may want to run this after your RVM setup though)
|
8
|
+
#
|
9
|
+
# Set the config like this:
|
10
|
+
#
|
11
|
+
# set :bundle_config, {
|
12
|
+
# :build => {
|
13
|
+
# :mysql => "--with-mysql-config='/usr/bin/mysql_config'"
|
14
|
+
# }
|
15
|
+
# }
|
16
|
+
#
|
17
|
+
# == Caution!
|
18
|
+
# Warning: Do not load these with bundler below 1.0.x
|
19
|
+
#
|
20
|
+
Capistrano::Configuration.instance(true).load do
|
21
|
+
namespace :bundle do
|
22
|
+
desc "Setup bundler config on server"
|
23
|
+
task :config do
|
24
|
+
if conf = fetch(:bundle_config)
|
25
|
+
conf.each do |k1,h|
|
26
|
+
h.each do |k2,v|
|
27
|
+
bundle_cmd = fetch(:bundle_cmd, "bundle")
|
28
|
+
bundle_dir = fetch(:bundle_dir, File.join(fetch(:shared_path), 'bundle'))
|
29
|
+
|
30
|
+
current_release = fetch(:current_release)
|
31
|
+
if current_release.to_s.empty?
|
32
|
+
raise ::Capistrano::CommandError.new("Cannot detect current release path - make sure you have deployed at least once.")
|
33
|
+
end
|
34
|
+
|
35
|
+
args = ["#{k1}.#{k2} #{v}"]
|
36
|
+
args << "--path #{bundle_dir}" unless bundle_dir.to_s.empty?
|
37
|
+
|
38
|
+
run "cd #{current_release} && #{bundle_cmd} config #{args.join(" ")}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# = Config files
|
2
|
+
#
|
3
|
+
# Allows you to upload stage dependent config files with multiple strategies
|
4
|
+
#
|
5
|
+
# == Usage
|
6
|
+
#
|
7
|
+
# All you have to do is set the variable :config_files with the following structure:
|
8
|
+
#
|
9
|
+
# set :config_files, {
|
10
|
+
# "test.rb" => "#{current_release}/test.rb",
|
11
|
+
# "local.rb" => {
|
12
|
+
# :location => "#{current_release}/config/local.rb",
|
13
|
+
# :strategy => :put
|
14
|
+
# },
|
15
|
+
# "skyline_configuration.rb" => {
|
16
|
+
# :location => "#{current_release}/config/initializers/skyline_configuration.rb",
|
17
|
+
# :strategy => :copy
|
18
|
+
# }
|
19
|
+
# }
|
20
|
+
#
|
21
|
+
# Every key of the hash above is a filename of a file that resides in <tt>:stage_dir/:stage</tt> (default=config/deploy/:stage)
|
22
|
+
# The filename kan either be filename.xyz or filename.xyz.erb. If both a regular and an .erb variant are present, only the
|
23
|
+
# .erb variant is processed. And you guessed right: the .erb variant is processed by ERB before putting.
|
24
|
+
#
|
25
|
+
# The value of the hash can either be a string or another hash. The config_file configuration hash has the folowing keys
|
26
|
+
#
|
27
|
+
# [:location] The location the file will be stored on the server after deployment (final location)
|
28
|
+
# [:strategy] The strategy defines how the file will be stored on the server. The default strategy is :put, see below for more info
|
29
|
+
#
|
30
|
+
# The most simple usage is just "filename.xyz" => "location.xyz" this will assume the default strategy of :put.
|
31
|
+
#
|
32
|
+
# === Strategies
|
33
|
+
#
|
34
|
+
# [:put] The file will be processed (in case of ERB) and uploaded during every deploy
|
35
|
+
# [:copy] The file will be processed and uploaded once during setup and after that it'll be copied to the final location on each deploy
|
36
|
+
#
|
37
|
+
Capistrano::Configuration.instance(true).load do
|
38
|
+
|
39
|
+
namespace :config_files do
|
40
|
+
desc "Setup config files with strategy :copy"
|
41
|
+
task :setup do
|
42
|
+
normalize_configs.each do |filename, options|
|
43
|
+
next unless options[:strategy] == :copy
|
44
|
+
put render_config_file(filename), "#{deploy_to}/#{filename}"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "Set all config files for current stage"
|
49
|
+
task :install do
|
50
|
+
normalize_configs.each do |filename, options|
|
51
|
+
case options[:strategy]
|
52
|
+
when :put
|
53
|
+
put render_config_file(filename), options[:location]
|
54
|
+
when :copy
|
55
|
+
run "cp #{deploy_to}/#{filename} #{options[:location]}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Normalize config files so we can do {"filename.rb" => "location"} instead
|
61
|
+
# of the full syntax. The default strategy is :put
|
62
|
+
def normalize_configs
|
63
|
+
if configs = fetch(:config_files, {})
|
64
|
+
configs.inject({}) do |mem, (filename, options)|
|
65
|
+
if !options.kind_of?(Hash)
|
66
|
+
options = {:location => options, :strategy => :put}
|
67
|
+
end
|
68
|
+
mem[filename] = {}
|
69
|
+
options.each do |k,v|
|
70
|
+
mem[filename][k] = interpolate(v)
|
71
|
+
end
|
72
|
+
mem
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def interpolate(var)
|
78
|
+
if var.respond_to?(:call)
|
79
|
+
var.call
|
80
|
+
else
|
81
|
+
var
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def render_config_file(file)
|
86
|
+
location = Pathname.new(fetch(:stage_dir, "config/deploy")) + stage.to_s
|
87
|
+
if File.exist?(location + "#{file}.erb")
|
88
|
+
view = ERB.new(File.read(location + "#{file}.erb"))
|
89
|
+
view.result(binding)
|
90
|
+
elsif File.exist?(location + file)
|
91
|
+
File.read(location + file)
|
92
|
+
else
|
93
|
+
raise ::Capistrano::CommandError.new("Cannot detect current config file in #{location}.")
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# This is our default deployment script with database support and assumes the following
|
2
|
+
#
|
3
|
+
# - Capistrano Multistage
|
4
|
+
# - RVM
|
5
|
+
# - Passenger
|
6
|
+
# - Passenger Standalone
|
7
|
+
# - Bundler
|
8
|
+
#
|
9
|
+
# - Database config
|
10
|
+
|
11
|
+
Capistrano::Configuration.instance(true).load do
|
12
|
+
# Load multistage
|
13
|
+
require 'capistrano/ext/multistage'
|
14
|
+
|
15
|
+
# Load RVM
|
16
|
+
require 'rvm/capistrano'
|
17
|
+
|
18
|
+
# Overwrite the start/stop/restart tasks
|
19
|
+
require 'deployable/passenger'
|
20
|
+
|
21
|
+
# Add RVM specific tools
|
22
|
+
require "deployable/rvm"
|
23
|
+
before "deploy:setup", "rvm:create_gemset"
|
24
|
+
after "deploy:finalize_update", "rvm:set_rvmrc", "rvm:trust_rvmrc"
|
25
|
+
|
26
|
+
# Enable bundling
|
27
|
+
require 'bundler/capistrano'
|
28
|
+
require "deployable/bundle"
|
29
|
+
after "rvm:trust_rvmrc", "bundle:config"
|
30
|
+
|
31
|
+
# Handle database config
|
32
|
+
require "deployable/database"
|
33
|
+
after "deploy:setup", "database:setup"
|
34
|
+
after "deploy:update_code", "database:copy_config_to_release"
|
35
|
+
|
36
|
+
# Passenger standalone setup
|
37
|
+
require "deployable/passenger_standalone"
|
38
|
+
after "deploy:setup", "passenger_standalone:setup"
|
39
|
+
|
40
|
+
# Config files support
|
41
|
+
require "deployable/config_files"
|
42
|
+
after "deploy:setup", "config_files:setup"
|
43
|
+
after "deploy:update_code", "config_files:install"
|
44
|
+
|
45
|
+
# Cleanup
|
46
|
+
after "deploy", "deploy:cleanup"
|
47
|
+
end
|
data/lib/deployable/version.rb
CHANGED
data/lib/deployable.rb
CHANGED
metadata
CHANGED
@@ -1,62 +1,136 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: deployable
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Digitpaint
|
9
14
|
- Flurin Egger
|
10
15
|
autorequire:
|
11
16
|
bindir: bin
|
12
17
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
18
|
+
|
19
|
+
date: 2012-01-24 00:00:00 +01:00
|
20
|
+
default_executable:
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
23
|
+
name: capistrano
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 43
|
31
|
+
segments:
|
32
|
+
- 2
|
33
|
+
- 9
|
34
|
+
- 0
|
35
|
+
version: 2.9.0
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: capistrano-ext
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 29
|
47
|
+
segments:
|
48
|
+
- 1
|
49
|
+
- 2
|
50
|
+
- 1
|
51
|
+
version: 1.2.1
|
52
|
+
type: :runtime
|
53
|
+
version_requirements: *id002
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: highline
|
56
|
+
prerelease: false
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - "="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 7
|
63
|
+
segments:
|
64
|
+
- 1
|
65
|
+
- 5
|
66
|
+
- 2
|
67
|
+
version: 1.5.2
|
68
|
+
type: :runtime
|
69
|
+
version_requirements: *id003
|
70
|
+
description: This library contains commonly used capistrano tasks, a couple of default recipes and example configurations.
|
71
|
+
email:
|
17
72
|
- info@digitpaint.nl
|
18
73
|
- flurin@digitpaint.nl
|
19
74
|
executables: []
|
75
|
+
|
20
76
|
extensions: []
|
77
|
+
|
21
78
|
extra_rdoc_files: []
|
22
|
-
|
79
|
+
|
80
|
+
files:
|
23
81
|
- .gitignore
|
82
|
+
- .yardopts
|
83
|
+
- CHANGELOG.md
|
24
84
|
- Gemfile
|
85
|
+
- LICENSE
|
86
|
+
- README.md
|
25
87
|
- Rakefile
|
26
88
|
- deployable.gemspec
|
27
89
|
- examples/config/deploy.rb
|
28
|
-
- examples/config/deploy/acceptance.rb
|
29
90
|
- examples/config/deploy/production.rb
|
30
91
|
- examples/scripts/initd.rb
|
31
92
|
- lib/deployable.rb
|
32
|
-
- lib/deployable/
|
93
|
+
- lib/deployable/bundle.rb
|
94
|
+
- lib/deployable/config_files.rb
|
33
95
|
- lib/deployable/database.rb
|
34
96
|
- lib/deployable/passenger.rb
|
35
97
|
- lib/deployable/passenger_standalone.rb
|
98
|
+
- lib/deployable/recipes/default_with_database.rb
|
36
99
|
- lib/deployable/rvm.rb
|
37
100
|
- lib/deployable/version.rb
|
38
|
-
|
101
|
+
has_rdoc: true
|
102
|
+
homepage: https://github.com/DigitPaint/Deployable
|
39
103
|
licenses: []
|
104
|
+
|
40
105
|
post_install_message:
|
41
106
|
rdoc_options: []
|
42
|
-
|
107
|
+
|
108
|
+
require_paths:
|
43
109
|
- lib
|
44
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
111
|
none: false
|
46
|
-
requirements:
|
47
|
-
- -
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
|
50
|
-
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
hash: 3
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
version: "0"
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
120
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
hash: 3
|
125
|
+
segments:
|
126
|
+
- 0
|
127
|
+
version: "0"
|
56
128
|
requirements: []
|
129
|
+
|
57
130
|
rubyforge_project: deployable
|
58
|
-
rubygems_version: 1.
|
131
|
+
rubygems_version: 1.3.7
|
59
132
|
signing_key:
|
60
133
|
specification_version: 3
|
61
|
-
summary: A collection of handy capistrano
|
134
|
+
summary: A collection of handy capistrano tasks and recipes
|
62
135
|
test_files: []
|
136
|
+
|
File without changes
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# = Bundler 0.7.x related tasks
|
2
|
-
#
|
3
|
-
# Warning: Do not load 0.7.x AND 1.0.x tasks at the same time!
|
4
|
-
Capistrano::Configuration.instance(true).load do
|
5
|
-
namespace :bundler do
|
6
|
-
desc "Setup bundler dirs in shared"
|
7
|
-
task :setup, :roles => [:app] do
|
8
|
-
run "mkdir -p #{deploy_to}/shared/bundler_gems/gems #{deploy_to}/shared/bundler_gems/specifications"
|
9
|
-
end
|
10
|
-
|
11
|
-
desc "Bundle gems in release_path/vendor/bundler_gems (symlinked to shared)"
|
12
|
-
task :bundle, :roles => [:app] do
|
13
|
-
run "cd #{release_path}/vendor/bundler_gems; ln -fs #{deploy_to}/shared/bundler_gems/gems"
|
14
|
-
run "cd #{release_path}/vendor/bundler_gems; ln -fs #{deploy_to}/shared/bundler_gems/specifications"
|
15
|
-
run "cd #{release_path}; gem bundle --cached"
|
16
|
-
end
|
17
|
-
|
18
|
-
desc "Install bundler"
|
19
|
-
task :install, :roles => [:app] do
|
20
|
-
run "gem install bundler --version=0.7.2"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|