pulsar 0.3.4 → 0.3.5
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.
- checksums.yaml +4 -4
- data/.hound.yml +3 -0
- data/.rubocop.yml +5 -0
- data/.ruby-version +1 -1
- data/.travis.yml +4 -1
- data/README.md +4 -4
- data/Rakefile +3 -3
- data/lib/pulsar.rb +9 -8
- data/lib/pulsar/commands/all.rb +4 -4
- data/lib/pulsar/commands/init.rb +7 -5
- data/lib/pulsar/commands/main.rb +43 -32
- data/lib/pulsar/commands/utils.rb +7 -3
- data/lib/pulsar/generators/init_repo/apps/your_app/defaults.rb +1 -1
- data/lib/pulsar/generators/init_repo/apps/your_app/production.rb +2 -2
- data/lib/pulsar/generators/init_repo/apps/your_app/staging.rb +2 -2
- data/lib/pulsar/generators/init_repo/recipes/generic/cleanup.rb +9 -9
- data/lib/pulsar/generators/init_repo/recipes/generic/utils.rb +6 -3
- data/lib/pulsar/helpers/all.rb +7 -5
- data/lib/pulsar/helpers/capistrano.rb +4 -4
- data/lib/pulsar/helpers/clamp.rb +32 -33
- data/lib/pulsar/helpers/path.rb +15 -2
- data/lib/pulsar/helpers/shell.rb +3 -3
- data/lib/pulsar/options/all.rb +5 -3
- data/lib/pulsar/options/conf_repo.rb +17 -16
- data/lib/pulsar/options/shared.rb +3 -2
- data/lib/pulsar/version.rb +1 -1
- data/pulsar.gemspec +17 -17
- data/spec/pulsar/commands/init_spec.rb +4 -3
- data/spec/pulsar/commands/list_spec.rb +63 -47
- data/spec/pulsar/commands/main_spec.rb +175 -125
- data/spec/pulsar/commands/utils_spec.rb +13 -13
- data/spec/pulsar/helpers/capistrano_spec.rb +37 -31
- data/spec/pulsar/helpers/clamp_spec.rb +68 -37
- data/spec/pulsar/helpers/shell_spec.rb +3 -3
- data/spec/spec_helper.rb +12 -11
- data/spec/support/dummies/dummy_conf/Gemfile +1 -1
- data/spec/support/dummies/dummy_conf/apps/base.rb +5 -5
- data/spec/support/dummies/dummy_conf/apps/dummy_app/custom_stage.rb +2 -2
- data/spec/support/dummies/dummy_conf/apps/dummy_app/defaults.rb +1 -1
- data/spec/support/dummies/dummy_conf/apps/dummy_app/production.rb +2 -2
- data/spec/support/dummies/dummy_conf/apps/dummy_app/staging.rb +2 -2
- data/spec/support/dummies/dummy_conf/apps/other_dummy_app/custom_stage.rb +2 -2
- data/spec/support/dummies/dummy_conf/apps/other_dummy_app/defaults.rb +1 -1
- data/spec/support/dummies/dummy_conf/apps/other_dummy_app/production.rb +2 -2
- data/spec/support/dummies/dummy_conf/apps/other_dummy_app/staging.rb +2 -2
- data/spec/support/modules/helpers.rb +40 -35
- metadata +20 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85ff94bd2e09cdb4b78e52f893e1325e57040096
|
4
|
+
data.tar.gz: 6a9555c19b9dd1a2fac4da55d898cc508ef802c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b192211345aeee06d45a10c4123e5294af7baf776bdde2c0a1772f7dc6fc41060c8592671cf10b400d9bee79a4876a61f616252a55ee08400b6a318ee9260086
|
7
|
+
data.tar.gz: a3acf3cea61a0431d419cc92781515695ed92d183cb1f3bef408ff46268e982bc6122f11b2e29b0e5429a9e6562c053a8a152788de153f9a0409a9ac1507fac2
|
data/.hound.yml
ADDED
data/.rubocop.yml
ADDED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.0
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Pulsar [](http://badge.fury.io/rb/pulsar) [](https://travis-ci.org/nebulab/pulsar) [](https://codeclimate.com/github/nebulab/pulsar) [](https://codeclimate.com/github/nebulab/pulsar)
|
2
2
|
|
3
3
|
The easy [Capistrano](https://rubygems.org/gems/capistrano) deploy and configuration manager.
|
4
4
|
|
@@ -164,13 +164,13 @@ You have three possibilities:
|
|
164
164
|
|
165
165
|
* `-c` command line option
|
166
166
|
* `PULSAR_CONF_REPO` environment variable
|
167
|
-
* `~/.pulsar` configuration file
|
167
|
+
* `~/.pulsar/config` configuration file
|
168
168
|
|
169
|
-
The fastest way is probably the `.pulsar`
|
169
|
+
The fastest way is probably the `.pulsar/config` file inside your home directory:
|
170
170
|
|
171
171
|
```bash
|
172
172
|
#
|
173
|
-
# Inside ~/.pulsar
|
173
|
+
# Inside ~/.pulsar/config
|
174
174
|
#
|
175
175
|
PULSAR_CONF_REPO="gh-user/pulsar-conf"
|
176
176
|
|
data/Rakefile
CHANGED
data/lib/pulsar.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
require
|
1
|
+
require 'pulsar/version'
|
2
2
|
|
3
3
|
module Pulsar
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
4
|
+
require 'clamp'
|
5
|
+
require 'bundler'
|
6
|
+
require 'colored'
|
7
|
+
require 'shellwords'
|
8
|
+
require 'tmpdir'
|
9
|
+
require 'pulsar/helpers/all'
|
10
|
+
require 'pulsar/options/all'
|
11
|
+
require 'pulsar/commands/all'
|
11
12
|
end
|
data/lib/pulsar/commands/all.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Pulsar
|
2
|
-
autoload :MainCommand,
|
3
|
-
autoload :UtilsCommand,
|
4
|
-
autoload :ListCommand,
|
5
|
-
autoload :InitCommand,
|
2
|
+
autoload :MainCommand, 'pulsar/commands/main'
|
3
|
+
autoload :UtilsCommand, 'pulsar/commands/utils'
|
4
|
+
autoload :ListCommand, 'pulsar/commands/list'
|
5
|
+
autoload :InitCommand, 'pulsar/commands/init'
|
6
6
|
end
|
data/lib/pulsar/commands/init.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Pulsar
|
2
2
|
class InitCommand < UtilsCommand
|
3
|
-
parameter
|
3
|
+
parameter 'CONFIGURATION_PATH',
|
4
|
+
'where to generate your configuration repository'
|
4
5
|
|
5
6
|
def execute
|
6
7
|
with_clean_env_and_supported_vars do
|
@@ -9,12 +10,13 @@ module Pulsar
|
|
9
10
|
pulsar_cmd_path = File.expand_path(File.dirname(__FILE__))
|
10
11
|
init_repo_path = "#{pulsar_cmd_path}/../generators/init_repo"
|
11
12
|
|
12
|
-
init_repo_path +=
|
13
|
+
init_repo_path += '/*' if File.directory?(destination_path)
|
13
14
|
|
14
|
-
run_cmd(
|
15
|
+
run_cmd(
|
16
|
+
"cp -r #{init_repo_path} #{destination_path}", verbose: verbose?)
|
15
17
|
|
16
|
-
puts
|
17
|
-
puts "Remember to run #{
|
18
|
+
puts 'Your starter configuration repo is in #{destination_path.yellow}.'
|
19
|
+
puts "Remember to run #{'bundle install'.red} to add a Gemfile.lock."
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
data/lib/pulsar/commands/main.rb
CHANGED
@@ -4,50 +4,61 @@ module Pulsar
|
|
4
4
|
include Pulsar::Options::Shared
|
5
5
|
include Pulsar::Options::ConfRepo
|
6
6
|
|
7
|
-
option [
|
8
|
-
|
9
|
-
|
7
|
+
option ['-l', '--log-level'], 'LOG LEVEL',
|
8
|
+
'how much output will Capistrano print out. Can be any of: important, info, debug, trace',
|
9
|
+
default: 'important'
|
10
10
|
|
11
|
-
option [
|
12
|
-
|
13
|
-
|
11
|
+
option ['-s', '--skip-cap-run'], :flag,
|
12
|
+
'do everything pulsar does (build a Capfile) but don\'t run the cap command',
|
13
|
+
default: false
|
14
14
|
|
15
|
-
|
16
|
-
parameter
|
15
|
+
unless from_application_path?
|
16
|
+
parameter 'APPLICATIONS', 'the applications which you would like to deploy. You can pass just one or a comma separated list to deploy multiple applications at once. It supports globbing too.'
|
17
17
|
end
|
18
18
|
|
19
|
-
parameter
|
19
|
+
parameter 'STAGE', 'the stage on which you would like to deploy'
|
20
20
|
|
21
|
-
parameter
|
22
|
-
|
23
|
-
:
|
24
|
-
:
|
21
|
+
parameter '[TASKS] ...',
|
22
|
+
'the arguments and/or options that will be passed to capistrano',
|
23
|
+
environment_variable: 'PULSAR_DEFAULT_TASK',
|
24
|
+
default: 'deploy'
|
25
25
|
|
26
26
|
def execute
|
27
27
|
with_clean_env_and_supported_vars do
|
28
28
|
begin
|
29
|
-
|
30
|
-
|
31
|
-
bundle_install
|
32
|
-
|
33
|
-
expand_applications.each do |app|
|
34
|
-
validate(app, stage)
|
35
|
-
create_capfile
|
36
|
-
build_capfile(app, stage)
|
37
|
-
|
38
|
-
unless skip_cap_run?
|
39
|
-
cap_args = [ tasks_list ].flatten.shelljoin
|
40
|
-
run_capistrano(cap_args)
|
41
|
-
end
|
42
|
-
|
43
|
-
remove_capfile unless keep_capfile?
|
44
|
-
reset_capfile_path!
|
45
|
-
end
|
29
|
+
fetch_repo_and_bundle
|
30
|
+
expand_applications.each { |app| validate_and_run_capistrano(app) }
|
46
31
|
ensure
|
47
|
-
|
48
|
-
remove_repo unless keep_repo?
|
32
|
+
cleanup
|
49
33
|
end
|
50
34
|
end
|
51
35
|
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def cleanup(opts = { full: true })
|
40
|
+
remove_capfile unless keep_capfile?
|
41
|
+
reset_capfile_path!
|
42
|
+
remove_repo if opts[:full] && !keep_repo?
|
43
|
+
end
|
44
|
+
|
45
|
+
def fetch_repo_and_bundle
|
46
|
+
create_tmp_dir
|
47
|
+
fetch_repo
|
48
|
+
bundle_install
|
49
|
+
end
|
50
|
+
|
51
|
+
def validate_and_run_capistrano(app)
|
52
|
+
validate(app, stage)
|
53
|
+
create_capfile
|
54
|
+
build_capfile(app, stage)
|
55
|
+
|
56
|
+
unless skip_cap_run?
|
57
|
+
cap_args = [tasks_list].flatten.shelljoin
|
58
|
+
run_capistrano(cap_args)
|
59
|
+
end
|
60
|
+
|
61
|
+
cleanup(full: false)
|
62
|
+
end
|
52
63
|
end
|
53
64
|
end
|
@@ -3,8 +3,12 @@ module Pulsar
|
|
3
3
|
include Pulsar::Helpers::Clamp
|
4
4
|
include Pulsar::Options::Shared
|
5
5
|
|
6
|
-
subcommand
|
7
|
-
|
6
|
+
subcommand 'list',
|
7
|
+
'list all available apps and stages which you can deploy',
|
8
|
+
ListCommand
|
9
|
+
|
10
|
+
subcommand 'init',
|
11
|
+
'generate a new configuration repo with some basic recipes to use with pulsar',
|
12
|
+
InitCommand
|
8
13
|
end
|
9
14
|
end
|
10
|
-
|
@@ -1,50 +1,50 @@
|
|
1
1
|
if logger.level == Capistrano::Logger::IMPORTANT
|
2
|
-
arrow =
|
3
|
-
ok =
|
2
|
+
arrow = '→'.yellow.bold
|
3
|
+
ok = '✓'.green
|
4
4
|
|
5
|
-
before
|
5
|
+
before 'deploy:update_code' do
|
6
6
|
SpinningCursor.start do
|
7
7
|
banner "#{arrow} Updating Code"
|
8
8
|
message "#{arrow} Updating Code #{ok}"
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
before
|
12
|
+
before 'bundle:install' do
|
13
13
|
SpinningCursor.start do
|
14
14
|
banner "#{arrow} Installing Gems"
|
15
15
|
message "#{arrow} Installing Gems #{ok}"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
before
|
19
|
+
before 'deploy:assets:symlink' do
|
20
20
|
SpinningCursor.start do
|
21
21
|
banner "#{arrow} Symlinking Assets"
|
22
22
|
message "#{arrow} Symlinking Assets #{ok}"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
before
|
26
|
+
before 'deploy:assets:precompile' do
|
27
27
|
SpinningCursor.start do
|
28
28
|
banner "#{arrow} Compiling Assets"
|
29
29
|
message "#{arrow} Compiling Assets #{ok}"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
before
|
33
|
+
before 'deploy:create_symlink' do
|
34
34
|
SpinningCursor.start do
|
35
35
|
banner "#{arrow} Symlinking Application"
|
36
36
|
message "#{arrow} Symlinking Application #{ok}"
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
before
|
40
|
+
before 'deploy:restart' do
|
41
41
|
SpinningCursor.start do
|
42
42
|
banner "#{arrow} Restarting Webserver"
|
43
43
|
message "#{arrow} Restarting Webserver #{ok}"
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
after
|
47
|
+
after 'deploy' do
|
48
48
|
SpinningCursor.stop
|
49
49
|
end
|
50
50
|
end
|
@@ -1,6 +1,9 @@
|
|
1
1
|
namespace :utils do
|
2
|
-
desc
|
3
|
-
task :invoke_rake, :
|
4
|
-
|
2
|
+
desc 'Invoke your awesome rake tasks!'
|
3
|
+
task :invoke_rake, roles: :web do
|
4
|
+
cd = "cd #{deploy_to}/current"
|
5
|
+
cmd = "RAILS_ENV=#{rails_env} #{rake} #{ENV['ARGS']}"
|
6
|
+
|
7
|
+
run("#{cd} && #{cmd}")
|
5
8
|
end
|
6
9
|
end
|
data/lib/pulsar/helpers/all.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
module Pulsar
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
module Pulsar
|
2
|
+
module Helpers
|
3
|
+
autoload :Capistrano, 'pulsar/helpers/capistrano'
|
4
|
+
autoload :Clamp, 'pulsar/helpers/clamp'
|
5
|
+
autoload :Path, 'pulsar/helpers/path'
|
6
|
+
autoload :Shell, 'pulsar/helpers/shell'
|
7
|
+
end
|
6
8
|
end
|
@@ -10,16 +10,16 @@ module Pulsar
|
|
10
10
|
instance_eval(&dsl_code)
|
11
11
|
end
|
12
12
|
|
13
|
-
def method_missing(meth, *args
|
13
|
+
def method_missing(meth, *args)
|
14
14
|
return if !@capistrano.from_application_path? && @options[:app_only]
|
15
15
|
|
16
16
|
recipes = "#{ENV['CONFIG_PATH']}/recipes/#{meth}"
|
17
17
|
|
18
|
-
File.directory?(recipes) ||
|
18
|
+
File.directory?(recipes) || fail("There are no recipes of type #{meth}")
|
19
19
|
|
20
20
|
args.each do |arg|
|
21
21
|
recipe = "#{recipes}/#{arg}.rb"
|
22
|
-
File.
|
22
|
+
File.exist?(recipe) || fail("There is no #{arg} recipe")
|
23
23
|
|
24
24
|
@capistrano.send(:load, recipe)
|
25
25
|
end
|
@@ -36,7 +36,7 @@ module Pulsar
|
|
36
36
|
# as a variable and error out
|
37
37
|
#
|
38
38
|
def from_application_path?
|
39
|
-
ENV.
|
39
|
+
ENV.key?('APP_PATH')
|
40
40
|
end
|
41
41
|
|
42
42
|
def load_recipes(opts = {}, &block)
|
data/lib/pulsar/helpers/clamp.rb
CHANGED
@@ -11,7 +11,7 @@ module Pulsar
|
|
11
11
|
|
12
12
|
module InstanceAndClassMethods
|
13
13
|
def from_application_path?
|
14
|
-
File.
|
14
|
+
File.exist?("#{Dir.pwd}/config.ru")
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -33,17 +33,17 @@ module Pulsar
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def bundle_install
|
36
|
-
cd(config_path, :
|
37
|
-
run_cmd("bundle install --quiet", :
|
36
|
+
cd(config_path, verbose: verbose?) do
|
37
|
+
run_cmd("bundle install --quiet --path=#{bundle_path.shellescape}", verbose: verbose?)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
def create_capfile
|
42
|
-
touch(capfile_path, :
|
42
|
+
touch(capfile_path, verbose: verbose?)
|
43
43
|
end
|
44
44
|
|
45
45
|
def create_tmp_dir
|
46
|
-
run_cmd("mkdir -p #{
|
46
|
+
run_cmd("mkdir -p #{tmp_path.shellescape}", verbose: verbose?)
|
47
47
|
end
|
48
48
|
|
49
49
|
def each_app
|
@@ -54,7 +54,7 @@ module Pulsar
|
|
54
54
|
|
55
55
|
def expand_applications
|
56
56
|
if from_application_path?
|
57
|
-
[
|
57
|
+
[ENV['PULSAR_APP_NAME'] || File.basename(application_path)]
|
58
58
|
else
|
59
59
|
#
|
60
60
|
# Given following applications:
|
@@ -86,14 +86,14 @@ module Pulsar
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def fetch_directory_repo(repo)
|
89
|
-
run_cmd("cp -rp #{repo} #{config_path}", :
|
89
|
+
run_cmd("cp -rp #{repo} #{config_path}", verbose: verbose?)
|
90
90
|
end
|
91
91
|
|
92
|
-
def fetch_git_repo(repo, local=false)
|
92
|
+
def fetch_git_repo(repo, local = false)
|
93
93
|
git_options = "--quiet --branch #{conf_branch}"
|
94
94
|
git_options = "#{git_options} --depth=1" unless local
|
95
95
|
|
96
|
-
run_cmd("git clone #{git_options} #{repo} #{config_path}", :
|
96
|
+
run_cmd("git clone #{git_options} #{repo} #{config_path}", verbose: verbose?)
|
97
97
|
end
|
98
98
|
|
99
99
|
def find_apps_from_pattern(glob)
|
@@ -111,12 +111,12 @@ module Pulsar
|
|
111
111
|
app_file = config_app_defaults_path(app)
|
112
112
|
stage_file = config_stage_path(app, stage)
|
113
113
|
|
114
|
-
if File.
|
115
|
-
run_cmd("cat #{app_file} >> #{capfile_path}", :
|
114
|
+
if File.exist?(app_file)
|
115
|
+
run_cmd("cat #{app_file} >> #{capfile_path}", verbose: verbose?)
|
116
116
|
end
|
117
117
|
|
118
|
-
if File.
|
119
|
-
run_cmd("cat #{stage_file} >> #{capfile_path}", :
|
118
|
+
if File.exist?(stage_file)
|
119
|
+
run_cmd("cat #{stage_file} >> #{capfile_path}", verbose: verbose?)
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -125,12 +125,12 @@ module Pulsar
|
|
125
125
|
stage_recipes_dir = config_app_stage_recipes_path(app, stage)
|
126
126
|
|
127
127
|
Dir["#{recipes_dir}/*.rb", "#{stage_recipes_dir}/*.rb"].each do |recipe|
|
128
|
-
run_cmd("cat #{recipe} >> #{capfile_path}", :
|
128
|
+
run_cmd("cat #{recipe} >> #{capfile_path}", verbose: verbose?)
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
132
|
def include_base_conf
|
133
|
-
run_cmd("cat #{config_base_path} >> #{capfile_path}", :
|
133
|
+
run_cmd("cat #{config_base_path} >> #{capfile_path}", verbose: verbose?)
|
134
134
|
end
|
135
135
|
|
136
136
|
def list_apps
|
@@ -140,41 +140,40 @@ module Pulsar
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def load_configuration
|
143
|
-
|
144
|
-
File.readlines(pulsar_configuration).each do |line|
|
145
|
-
conf, value = line.split("=")
|
143
|
+
return if pulsar_configuration.nil?
|
146
144
|
|
147
|
-
|
148
|
-
|
145
|
+
File.readlines(pulsar_configuration).each do |line|
|
146
|
+
conf, value = line.split('=')
|
147
|
+
|
148
|
+
ENV[conf] = value.chomp.gsub('"', '') if !conf.nil? && !value.nil?
|
149
149
|
end
|
150
150
|
end
|
151
151
|
|
152
152
|
def pulsar_configuration
|
153
|
-
|
154
|
-
|
155
|
-
|
153
|
+
path_list = []
|
154
|
+
path_list << File.join(application_path, '.pulsar') unless application_path.nil?
|
155
|
+
path_list << File.join(home_path, 'config')
|
156
156
|
|
157
|
-
|
158
|
-
return inside_home if inside_home && File.file?(inside_home)
|
157
|
+
path_list.find { |path| File.file?(path) }
|
159
158
|
end
|
160
159
|
|
161
160
|
def remove_capfile
|
162
|
-
rm_rf(capfile_path, :
|
161
|
+
rm_rf(capfile_path, verbose: verbose?)
|
163
162
|
end
|
164
163
|
|
165
164
|
def remove_repo
|
166
|
-
rm_rf(config_path, :
|
165
|
+
rm_rf(config_path, verbose: verbose?)
|
167
166
|
end
|
168
167
|
|
169
168
|
def run_capistrano(args)
|
170
|
-
cmd =
|
169
|
+
cmd = 'bundle exec cap'
|
171
170
|
env = "CONFIG_PATH=#{config_path}"
|
172
171
|
opts = "--file #{capfile_path}"
|
173
172
|
|
174
173
|
env += " APP_PATH=#{application_path}" unless application_path.nil?
|
175
174
|
|
176
|
-
cd(config_path, :
|
177
|
-
run_cmd("#{cmd} #{env} #{opts} #{args}", :
|
175
|
+
cd(config_path, verbose: verbose?) do
|
176
|
+
run_cmd("#{cmd} #{env} #{opts} #{args}", verbose: verbose?)
|
178
177
|
end
|
179
178
|
end
|
180
179
|
|
@@ -186,7 +185,7 @@ module Pulsar
|
|
186
185
|
|
187
186
|
cmd = "echo 'logger.level = logger.level = Capistrano::Logger::#{level}' >> #{capfile_path}"
|
188
187
|
|
189
|
-
run_cmd(cmd, :
|
188
|
+
run_cmd(cmd, verbose: verbose?)
|
190
189
|
end
|
191
190
|
|
192
191
|
def supported_env_vars
|
@@ -206,8 +205,8 @@ module Pulsar
|
|
206
205
|
def validate(app, stage)
|
207
206
|
app_path = config_app_path(app)
|
208
207
|
stage_path = config_stage_path(app, stage)
|
209
|
-
valid_paths = File.
|
210
|
-
|
208
|
+
valid_paths = File.exist?(app_path) && File.exist?(stage_path)
|
209
|
+
fail(ArgumentError, "no pulsar config available for app=#{app}, stage=#{stage}") unless valid_paths
|
211
210
|
end
|
212
211
|
|
213
212
|
def with_clean_env_and_supported_vars
|