capistrano-exts 1.11.0 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/capistrano-exts.gemspec +1 -0
- data/examples/rails_passenger/deploy/development.rb +1 -0
- data/examples/rails_passenger/deploy/production.rb +1 -0
- data/examples/rails_passenger/deploy/staging.rb +1 -0
- data/examples/rails_reverse_proxy/deploy/development.rb +1 -0
- data/examples/rails_reverse_proxy/deploy/production.rb +1 -0
- data/examples/rails_reverse_proxy/deploy/staging.rb +1 -0
- data/lib/capistrano-exts.rb +16 -1
- data/lib/capistrano-exts/receipts/contao.rb +2 -2
- data/lib/capistrano-exts/receipts/contents.rb +2 -2
- data/lib/capistrano-exts/receipts/deploy.rb +4 -4
- data/lib/capistrano-exts/receipts/files.rb +6 -0
- data/lib/capistrano-exts/receipts/functions.rb +33 -5
- data/lib/capistrano-exts/receipts/git.rb +2 -2
- data/lib/capistrano-exts/receipts/multistage.rb +1 -1
- data/lib/capistrano-exts/receipts/mysql.rb +14 -36
- data/lib/capistrano-exts/receipts/rails.rb +31 -14
- data/lib/capistrano-exts/receipts/servers/web_server.rb +7 -3
- data/lib/capistrano-exts/templates/multistage.rb +1 -0
- data/lib/capistrano-exts/version.rb +1 -1
- metadata +26 -15
data/README.md
CHANGED
data/capistrano-exts.gemspec
CHANGED
@@ -27,6 +27,7 @@ set :deploy_to, -> { "/home/vhosts/#{fetch :stage}/#{fetch :application}" }
|
|
27
27
|
set :logs_path, -> { "#{fetch :deploy_to}/logs" }
|
28
28
|
set :public_path, -> { "#{fetch :current_path}/public" }
|
29
29
|
set :backup_path, -> { "#{fetch :deploy_to}/backups" }
|
30
|
+
set :rails_env, "development"
|
30
31
|
|
31
32
|
# How should we deploy?
|
32
33
|
# Valid options:
|
@@ -27,6 +27,7 @@ set :deploy_to, -> { "/home/vhosts/#{fetch :stage}/#{fetch :application}" }
|
|
27
27
|
set :logs_path, -> { "#{fetch :deploy_to}/logs" }
|
28
28
|
set :public_path, -> { "#{fetch :current_path}/public" }
|
29
29
|
set :backup_path, -> { "#{fetch :deploy_to}/backups" }
|
30
|
+
set :rails_env, "production"
|
30
31
|
|
31
32
|
# How should we deploy?
|
32
33
|
# Valid options:
|
@@ -27,6 +27,7 @@ set :deploy_to, -> { "/home/vhosts/#{fetch :stage}/#{fetch :application}" }
|
|
27
27
|
set :logs_path, -> { "#{fetch :deploy_to}/logs" }
|
28
28
|
set :public_path, -> { "#{fetch :current_path}/public" }
|
29
29
|
set :backup_path, -> { "#{fetch :deploy_to}/backups" }
|
30
|
+
set :rails_env, "staging"
|
30
31
|
|
31
32
|
# How should we deploy?
|
32
33
|
# Valid options:
|
@@ -27,6 +27,7 @@ set :deploy_to, -> { "/home/vhosts/#{fetch :stage}/#{fetch :application}" }
|
|
27
27
|
set :logs_path, -> { "#{fetch :deploy_to}/logs" }
|
28
28
|
set :public_path, -> { "#{fetch :current_path}/public" }
|
29
29
|
set :backup_path, -> { "#{fetch :deploy_to}/backups" }
|
30
|
+
set :rails_env, "development"
|
30
31
|
|
31
32
|
# How should we deploy?
|
32
33
|
# Valid options:
|
@@ -27,6 +27,7 @@ set :deploy_to, -> { "/home/vhosts/#{fetch :stage}/#{fetch :application}" }
|
|
27
27
|
set :logs_path, -> { "#{fetch :deploy_to}/logs" }
|
28
28
|
set :public_path, -> { "#{fetch :current_path}/public" }
|
29
29
|
set :backup_path, -> { "#{fetch :deploy_to}/backups" }
|
30
|
+
set :rails_env, "production"
|
30
31
|
|
31
32
|
# How should we deploy?
|
32
33
|
# Valid options:
|
@@ -27,6 +27,7 @@ set :deploy_to, -> { "/home/vhosts/#{fetch :stage}/#{fetch :application}" }
|
|
27
27
|
set :logs_path, -> { "#{fetch :deploy_to}/logs" }
|
28
28
|
set :public_path, -> { "#{fetch :current_path}/public" }
|
29
29
|
set :backup_path, -> { "#{fetch :deploy_to}/backups" }
|
30
|
+
set :rails_env, "staging"
|
30
31
|
|
31
32
|
# How should we deploy?
|
32
33
|
# Valid options:
|
data/lib/capistrano-exts.rb
CHANGED
@@ -7,8 +7,23 @@ $: << ROOT_PATH if File.directory?(ROOT_PATH) and not $:.include?(ROOT_PATH)
|
|
7
7
|
# Require our core extensions
|
8
8
|
require 'capistrano-exts/core_ext'
|
9
9
|
|
10
|
+
# require Capistrano colors
|
11
|
+
require 'capistrano/configuration'
|
12
|
+
require 'capistrano/logger'
|
13
|
+
require 'capistrano_colors/configuration'
|
14
|
+
require 'capistrano_colors/logger'
|
15
|
+
|
16
|
+
# Printed credentials
|
17
|
+
Capistrano::Logger.add_color_matcher({ :match => /adapter:|hostname:|username:|password:/, :color => :red, :level => Capistrano::Logger::TRACE, :prio => -20, :attribute => :blink })
|
18
|
+
|
19
|
+
# Warnings
|
20
|
+
Capistrano::Logger.add_color_matcher({ :match => /WARNING:/, :color => :yellow, :level => Capistrano::Logger::INFO, :prio => -20 })
|
21
|
+
|
22
|
+
# Errors
|
23
|
+
Capistrano::Logger.add_color_matcher({ :match => /ERROR:/, :color => :red, :level => Capistrano::Logger::IMPORTANT, :prio => -20 })
|
24
|
+
|
10
25
|
# Require requested receipts
|
11
|
-
require 'capistrano-exts/receipts'
|
26
|
+
require 'capistrano-exts/receipts'
|
12
27
|
|
13
28
|
# Require all servers
|
14
29
|
Dir["#{ROOT_PATH}/capistrano-exts/servers/*.rb"].each { |f| require f }
|
@@ -48,7 +48,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
48
48
|
|
49
49
|
# localconfig
|
50
50
|
if mysql_credentials.blank?
|
51
|
-
|
51
|
+
logger.info "WARNING: The mysql credential file can't be found, localconfig has just been copied from the sample file"
|
52
52
|
end
|
53
53
|
|
54
54
|
# Add MySQL credentials
|
@@ -61,7 +61,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
61
61
|
|
62
62
|
put localconfig, localconfig_php_config_path
|
63
63
|
else
|
64
|
-
|
64
|
+
logger.info "WARNING: The file '#{localconfig_php_config_path}' already exists, not overwriting."
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -92,7 +92,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
92
92
|
# Tranfer the contents to the local system
|
93
93
|
get latest_contents_backup, export_filename
|
94
94
|
|
95
|
-
|
95
|
+
logger.info "Contents has been downloaded to #{export_filename}"
|
96
96
|
exit 0
|
97
97
|
end
|
98
98
|
|
@@ -102,7 +102,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
102
102
|
argv_file_index = ARGV.index("contents:import") + 1
|
103
103
|
|
104
104
|
unless ARGV.size >= (argv_file_index + 1) and File.exists?(ARGV[argv_file_index])
|
105
|
-
|
105
|
+
logger.important "ERROR: please run 'cap import <gzipped tar>'"
|
106
106
|
exit 1
|
107
107
|
else
|
108
108
|
# The contents file name
|
@@ -13,8 +13,8 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
13
13
|
desc "Check if the remote is ready, should we run cap deploy:setup?"
|
14
14
|
task :check_if_remote_ready, :roles => :web do
|
15
15
|
unless remote_file_exists?("#{shared_path}")
|
16
|
-
|
17
|
-
|
16
|
+
logger.important "ERROR: The project is not ready for deployment."
|
17
|
+
logger.important "please run `cap deploy:setup"
|
18
18
|
exit
|
19
19
|
end
|
20
20
|
end
|
@@ -67,12 +67,12 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
67
67
|
#{try_sudo} ln -nsf #{fetch :public_path} #{deploy_to}/#{folder}
|
68
68
|
CMD
|
69
69
|
rescue Capistrano::CommandError
|
70
|
-
|
70
|
+
logger.info "WARNING: I couldn't replace the old htdocs please do so manually"
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
|
75
|
+
logger.info "The public folders has been moved to the old folder"
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -12,6 +12,9 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
12
12
|
desc "[internal] Shared items"
|
13
13
|
task :shared_items, :roles => :app, :except => { :no_release => true } do
|
14
14
|
if exists?(:shared_items)
|
15
|
+
run <<-CMD
|
16
|
+
#{try_sudo} mkdir -p #{fetch :shared_path}/items
|
17
|
+
CMD
|
15
18
|
link_files "#{fetch :shared_path}/items", fetch(:shared_items)
|
16
19
|
end
|
17
20
|
end
|
@@ -19,6 +22,9 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
19
22
|
desc "[internal] Configuration files"
|
20
23
|
task :config_files, :roles => :app, :except => { :no_release => true } do
|
21
24
|
if exists?(:configuration_files)
|
25
|
+
run <<-CMD
|
26
|
+
#{try_sudo} mkdir -p #{fetch :shared_path}/config
|
27
|
+
CMD
|
22
28
|
link_files "#{fetch :shared_path}/config", fetch(:configuration_files)
|
23
29
|
end
|
24
30
|
end
|
@@ -38,7 +38,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
38
38
|
run <<-CMD
|
39
39
|
#{try_sudo} touch #{path}/#{file_name}
|
40
40
|
CMD
|
41
|
-
|
41
|
+
logger.info "WARNING: You should edit '#{path}/#{file_name}' or re-create it as a folder if that's your intention."
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -88,11 +88,39 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
# Helper for some mysql tasks
|
91
|
-
def
|
91
|
+
def credentials_formatted(credentials, adapter_mapping = {})
|
92
|
+
if adapter_mapping.include?(credentials[:adapter])
|
93
|
+
adapter = adapter_mapping[credentials[:adapter]]
|
94
|
+
else
|
95
|
+
adapter = credentials[:adapter]
|
96
|
+
end
|
97
|
+
|
98
|
+
return <<-EOS
|
99
|
+
adapter: #{adapter}
|
100
|
+
hostname: #{credentials[:host]}
|
101
|
+
username: #{credentials[:user]}
|
102
|
+
password: #{credentials[:pass]}
|
103
|
+
EOS
|
104
|
+
end
|
105
|
+
|
106
|
+
# Helper for rails database.yml generator
|
107
|
+
def rails_database_yml(credentials, adapter_mapping = {})
|
108
|
+
if adapter_mapping.include?(credentials[:adapter])
|
109
|
+
adapter = adapter_mapping[credentials[:adapter]]
|
110
|
+
else
|
111
|
+
adapter = credentials[:adapter]
|
112
|
+
end
|
113
|
+
|
92
114
|
return <<-EOS
|
93
|
-
|
94
|
-
|
95
|
-
|
115
|
+
#{fetch :rails_env}:
|
116
|
+
adapter: #{adapter}
|
117
|
+
encoding: utf8
|
118
|
+
reconnect: false
|
119
|
+
pool: 10
|
120
|
+
host: #{credentials[:host]}
|
121
|
+
username: #{credentials[:user]}
|
122
|
+
password: #{credentials[:pass]}
|
123
|
+
database: #{fetch :mysql_db_name}
|
96
124
|
EOS
|
97
125
|
end
|
98
126
|
|
@@ -12,8 +12,8 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
12
12
|
desc "Check if the branch is ready"
|
13
13
|
task :check_if_branch_is_ready, :roles => :app, :except => { :no_release => true } do
|
14
14
|
unless `git rev-parse #{branch}` == `git rev-parse origin/#{branch}`
|
15
|
-
|
16
|
-
|
15
|
+
logger.important "ERROR: #{branch} is not the same as origin/#{branch}"
|
16
|
+
logger.important "Run `git push` to sync changes."
|
17
17
|
exit
|
18
18
|
end
|
19
19
|
end
|
@@ -70,7 +70,7 @@ Capistrano::Configuration.instance.load do
|
|
70
70
|
f.write File.read(File.expand_path(File.join File.dirname(__FILE__), '..', 'templates', 'multistage.rb'))
|
71
71
|
end
|
72
72
|
|
73
|
-
|
73
|
+
logger.info "#{name} configurations has been written to #{file}, please open and edit it."
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
@@ -38,7 +38,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
38
38
|
#{try_sudo} bzip2 -9 '#{latest_db_dump}'
|
39
39
|
CMD
|
40
40
|
rescue Capistrano::CommandError
|
41
|
-
|
41
|
+
logger.info "WARNING: The database doesn't exist."
|
42
42
|
end
|
43
43
|
else
|
44
44
|
abort "MySQL credentials are empty"
|
@@ -61,7 +61,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
61
61
|
'#{mysql_db_name}'
|
62
62
|
CMD
|
63
63
|
rescue Capistrano::CommandError
|
64
|
-
|
64
|
+
logger.info "WARNING: The database doesn't exist or you do not have permissions to drop it, trying to drop all tables inside of it."
|
65
65
|
begin
|
66
66
|
run <<-CMD
|
67
67
|
mysqldump \
|
@@ -77,7 +77,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
77
77
|
'#{mysql_db_name}'
|
78
78
|
CMD
|
79
79
|
rescue Capistrano::CommandError
|
80
|
-
|
80
|
+
logger.info "WARNING: The database doesn't exist or you do not have permissions to drop it."
|
81
81
|
end
|
82
82
|
end
|
83
83
|
end
|
@@ -126,7 +126,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
126
126
|
|
127
127
|
find_and_execute_task("mysql:write_credentials")
|
128
128
|
rescue Capistrano::CommandError
|
129
|
-
|
129
|
+
logger.info "WARNING: The user #{application} already exists or you do not have permissions to create it."
|
130
130
|
find_and_execute_task("mysql:print_credentials")
|
131
131
|
end
|
132
132
|
end
|
@@ -147,7 +147,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
147
147
|
create '#{mysql_db_name}'
|
148
148
|
CMD
|
149
149
|
rescue Capistrano::CommandError
|
150
|
-
|
150
|
+
logger.info "WARNING: The database already exists or you do not have permissions to create it."
|
151
151
|
end
|
152
152
|
end
|
153
153
|
end
|
@@ -161,7 +161,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
161
161
|
argv_file_index = ARGV.index("mysql:import_db_dump") + 1
|
162
162
|
|
163
163
|
unless ARGV.size >= (argv_file_index + 1) and File.exists?(ARGV[argv_file_index])
|
164
|
-
|
164
|
+
logger.important "ERROR: please run 'cap mysql:import_db_dump <sql dump>'"
|
165
165
|
exit 1
|
166
166
|
else
|
167
167
|
# The database dump name
|
@@ -242,7 +242,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
242
242
|
rm -f /tmp/#{File.basename latest_db_dump}
|
243
243
|
CMD
|
244
244
|
|
245
|
-
|
245
|
+
logger.info "Mysql dump has been downloaded to #{export_filename}"
|
246
246
|
exit 0
|
247
247
|
end
|
248
248
|
end
|
@@ -250,15 +250,16 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
250
250
|
['credentials', 'root_credentials'].each do |var|
|
251
251
|
desc "print database #{var.gsub(/_/, ' ')}"
|
252
252
|
task "print_#{var}" do
|
253
|
-
|
253
|
+
logger.trace credentials_formatted(fetch "mysql_#{var}".to_sym)
|
254
254
|
end
|
255
255
|
|
256
256
|
desc "[internal] write database #{var.gsub(/_/, ' ')}"
|
257
257
|
task "write_#{var}" do
|
258
258
|
unless exists?("mysql_#{var}_file".to_sym) and remote_file_exists?(fetch "mysql_#{var}_file".to_sym)
|
259
259
|
mysql_credentials_file = fetch "mysql_#{var}_file".to_sym
|
260
|
-
|
261
|
-
|
260
|
+
credentials_formatted_content = credentials_formatted(fetch "mysql_#{var}".to_sym)
|
261
|
+
random_file = random_tmp_file(credentials_formatted_content)
|
262
|
+
put credentials_formatted_content, random_file
|
262
263
|
|
263
264
|
begin
|
264
265
|
run <<-CMD
|
@@ -266,11 +267,11 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
266
267
|
#{try_sudo} rm -f #{random_file}
|
267
268
|
CMD
|
268
269
|
rescue Capistrano::CommandError
|
269
|
-
|
270
|
+
logger.info "WARNING: Apparently you do not have permissions to write to #{mysql_credentials_file}."
|
270
271
|
find_and_execute_task("mysql:print_#{var}")
|
271
272
|
end
|
272
273
|
else
|
273
|
-
|
274
|
+
logger.info "WARNING: mysql_#{var}_file is not defined or it already exists on the server."
|
274
275
|
find_and_execute_task("mysql:print_#{var}") unless ARGV.include?("mysql:print_#{var}")
|
275
276
|
end
|
276
277
|
end
|
@@ -303,6 +304,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
303
304
|
|
304
305
|
unless mysql_credentials_file_contents.blank?
|
305
306
|
mysql_credentials = {
|
307
|
+
adapter: 'mysql',
|
306
308
|
host: mysql_credentials_file_contents.match(mysql_credentials_host_regex).try(:[], mysql_credentials_host_regex_match).try(:chomp),
|
307
309
|
user: mysql_credentials_file_contents.match(mysql_credentials_user_regex).try(:[], mysql_credentials_user_regex_match).try(:chomp),
|
308
310
|
pass: mysql_credentials_file_contents.match(mysql_credentials_pass_regex).try(:[], mysql_credentials_pass_regex_match).try(:chomp),
|
@@ -334,27 +336,6 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
334
336
|
end
|
335
337
|
end
|
336
338
|
end
|
337
|
-
|
338
|
-
desc "Create database.yml in shared path"
|
339
|
-
task :write_database_yml, :roles => :db, :except => { :no_release => true } do
|
340
|
-
mysql_credentials = fetch :mysql_credentials
|
341
|
-
|
342
|
-
db_config = <<-EOF
|
343
|
-
production:
|
344
|
-
adapter: mysql2
|
345
|
-
encoding: utf8
|
346
|
-
reconnect: false
|
347
|
-
pool: 10
|
348
|
-
database: #{fetch :mysql_db_name}
|
349
|
-
username: #{mysql_credentials[:user]}
|
350
|
-
password: #{mysql_credentials[:pass]}
|
351
|
-
EOF
|
352
|
-
|
353
|
-
run <<-CMD
|
354
|
-
mkdir -p #{shared_path}/config
|
355
|
-
CMD
|
356
|
-
put db_config, "#{shared_path}/config/database.yml"
|
357
|
-
end
|
358
339
|
end
|
359
340
|
end
|
360
341
|
|
@@ -368,7 +349,4 @@ EOF
|
|
368
349
|
|
369
350
|
before "mysql:print_credentials", "mysql:credentials"
|
370
351
|
before "mysql:print_root_credentials", "mysql:root_credentials"
|
371
|
-
|
372
|
-
# Write database.yml to shared path when using rails
|
373
|
-
after "mysql:write_credentials", "mysql:write_database_yml" if exists?(:capistrano_extensions) and capistrano_extensions.include?(:rails)
|
374
352
|
end
|
@@ -7,24 +7,38 @@ unless Capistrano::Configuration.respond_to?(:instance)
|
|
7
7
|
abort "This extension requires Capistrano 2"
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
RAILS_DB_ADAPTER_MAPPING = {
|
11
|
+
'mysql' => 'mysql2'
|
12
|
+
}
|
13
13
|
|
14
14
|
Capistrano::Configuration.instance(:must_exist).load do
|
15
15
|
|
16
16
|
namespace :rails do
|
17
|
-
desc "
|
18
|
-
task :
|
19
|
-
|
20
|
-
|
17
|
+
desc "[internal] Create database.yml in shared path"
|
18
|
+
task :write_database_yml, :roles => :app, :except => { :no_release => true } do
|
19
|
+
database_yml_config_path = "#{fetch :shared_path}/config/config_database.yml"
|
20
|
+
unless remote_file_exists?(database_yml_config_path)
|
21
|
+
on_rollback { run "rm -f #{database_yml_config_path}" }
|
22
|
+
mysql_credentials = fetch :mysql_credentials
|
23
|
+
|
24
|
+
# Get the db_config
|
25
|
+
db_config = rails_database_yml(mysql_credentials, RAILS_DB_ADAPTER_MAPPING)
|
26
|
+
|
27
|
+
# Generate a remote file name
|
28
|
+
random_file = random_tmp_file(db_config)
|
29
|
+
put db_config, random_file
|
30
|
+
|
31
|
+
begin
|
32
|
+
run <<-CMD
|
33
|
+
#{try_sudo} cp #{random_file} #{database_yml_config_path}; \
|
34
|
+
#{try_sudo} rm -f #{random_file}
|
35
|
+
CMD
|
36
|
+
rescue Capistrano::CommandError
|
37
|
+
logger.info "WARNING: Apparently you do not have permissions to write to #{mysql_credentials_file}."
|
38
|
+
find_and_execute_task("mysql:print_#{var}")
|
39
|
+
end
|
21
40
|
end
|
22
41
|
end
|
23
|
-
|
24
|
-
desc "Install rvm config file"
|
25
|
-
task :install_rvmrc_file, :roles => :app do
|
26
|
-
link_file(File.join(fetch(:shared_path), 'rvmrc'), File.join(fetch(:release_path), '.rvmrc'))
|
27
|
-
end
|
28
42
|
end
|
29
43
|
|
30
44
|
namespace :deploy do
|
@@ -33,8 +47,11 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
33
47
|
end
|
34
48
|
end
|
35
49
|
|
36
|
-
|
37
|
-
after "
|
50
|
+
# Database.yml file
|
51
|
+
after "files:config_files", "rails:write_database_yml"
|
52
|
+
before "rails:write_database_yml", "mysql:credentials"
|
53
|
+
|
54
|
+
# Restart the server
|
38
55
|
after "deploy:restart", "deploy:fix_permissions"
|
39
56
|
|
40
57
|
# Capistrano is broken
|
@@ -96,14 +96,18 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
96
96
|
#{try_sudo} rm -f #{random_file}
|
97
97
|
CMD
|
98
98
|
|
99
|
-
|
100
|
-
|
99
|
+
logger.info "This site uses http basic auth, the credentials are:"
|
100
|
+
web_server_auth_file_unencrypted_contents.split("\n").each do |m|
|
101
|
+
logger.trace "username: #{m.split(':').first.chomp} password: #{m.split(':').last.chomp}"
|
102
|
+
end
|
101
103
|
end
|
102
104
|
end
|
103
105
|
|
104
106
|
desc "print authentification file"
|
105
107
|
task :print_http_auth do
|
106
|
-
|
108
|
+
read("#{fetch :deploy_to}/.http_basic_auth").split("\n").each do |m|
|
109
|
+
logger.trace "username: #{m.split(':').first.chomp} password: #{m.split(':').last.chomp}"
|
110
|
+
end
|
107
111
|
end
|
108
112
|
|
109
113
|
desc "[internal] Write web configuration file"
|
@@ -24,6 +24,7 @@ set :deploy_to, -> { "/home/vhosts/#{fetch :stage}/#{fetch :application}" }
|
|
24
24
|
set :logs_path, -> { "#{fetch :deploy_to}/logs" }
|
25
25
|
set :public_path, -> { "#{fetch :current_path}/public" }
|
26
26
|
set :backup_path, -> { "#{fetch :deploy_to}/backups" }
|
27
|
+
set :rails_env, "development"
|
27
28
|
|
28
29
|
# How should we deploy?
|
29
30
|
# Valid options:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-exts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-09-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
16
|
-
requirement: &
|
16
|
+
requirement: &2161329300 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,21 @@ dependencies:
|
|
21
21
|
version: 2.8.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2161329300
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: capistrano_colors
|
27
|
+
requirement: &2161320280 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.5.5
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2161320280
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: i18n
|
27
|
-
requirement: &
|
38
|
+
requirement: &2161318720 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
40
|
requirements:
|
30
41
|
- - ~>
|
@@ -32,10 +43,10 @@ dependencies:
|
|
32
43
|
version: 0.6.0
|
33
44
|
type: :runtime
|
34
45
|
prerelease: false
|
35
|
-
version_requirements: *
|
46
|
+
version_requirements: *2161318720
|
36
47
|
- !ruby/object:Gem::Dependency
|
37
48
|
name: activesupport
|
38
|
-
requirement: &
|
49
|
+
requirement: &2161317140 !ruby/object:Gem::Requirement
|
39
50
|
none: false
|
40
51
|
requirements:
|
41
52
|
- - ~>
|
@@ -43,10 +54,10 @@ dependencies:
|
|
43
54
|
version: 3.1.0
|
44
55
|
type: :runtime
|
45
56
|
prerelease: false
|
46
|
-
version_requirements: *
|
57
|
+
version_requirements: *2161317140
|
47
58
|
- !ruby/object:Gem::Dependency
|
48
59
|
name: guard
|
49
|
-
requirement: &
|
60
|
+
requirement: &2161316040 !ruby/object:Gem::Requirement
|
50
61
|
none: false
|
51
62
|
requirements:
|
52
63
|
- - ~>
|
@@ -54,10 +65,10 @@ dependencies:
|
|
54
65
|
version: 0.6.2
|
55
66
|
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *2161316040
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: guard-bundler
|
60
|
-
requirement: &
|
71
|
+
requirement: &2161315140 !ruby/object:Gem::Requirement
|
61
72
|
none: false
|
62
73
|
requirements:
|
63
74
|
- - ~>
|
@@ -65,10 +76,10 @@ dependencies:
|
|
65
76
|
version: 0.1.3
|
66
77
|
type: :development
|
67
78
|
prerelease: false
|
68
|
-
version_requirements: *
|
79
|
+
version_requirements: *2161315140
|
69
80
|
- !ruby/object:Gem::Dependency
|
70
81
|
name: guard-rspec
|
71
|
-
requirement: &
|
82
|
+
requirement: &2161314480 !ruby/object:Gem::Requirement
|
72
83
|
none: false
|
73
84
|
requirements:
|
74
85
|
- - ~>
|
@@ -76,10 +87,10 @@ dependencies:
|
|
76
87
|
version: 0.4.3
|
77
88
|
type: :development
|
78
89
|
prerelease: false
|
79
|
-
version_requirements: *
|
90
|
+
version_requirements: *2161314480
|
80
91
|
- !ruby/object:Gem::Dependency
|
81
92
|
name: rspec
|
82
|
-
requirement: &
|
93
|
+
requirement: &2161312120 !ruby/object:Gem::Requirement
|
83
94
|
none: false
|
84
95
|
requirements:
|
85
96
|
- - ~>
|
@@ -87,7 +98,7 @@ dependencies:
|
|
87
98
|
version: 2.6.0
|
88
99
|
type: :development
|
89
100
|
prerelease: false
|
90
|
-
version_requirements: *
|
101
|
+
version_requirements: *2161312120
|
91
102
|
description: ! 'Capistrano exts is a set of helper tasks to help with the initial
|
92
103
|
server
|
93
104
|
|