capistrano_multiconfig_parallel 2.0.0.beta4 → 2.0.0.beta5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e892a4906dcb28ec4b7d05aabebc11c9ea7b4ae7
4
- data.tar.gz: 7eb5360c81713de4804c4f02bb4bde2c32070dda
3
+ metadata.gz: 8dcf6eedb9a056078cbf9751eec4891962435a25
4
+ data.tar.gz: 23169131c3f9ad637f3fba23aa6cb0e0ff72999f
5
5
  SHA512:
6
- metadata.gz: 4c966a134c96f9b91bacded7eb60dae769c781c932bb96a4b895935713a4971fe1cbecbbfdd28c3d8580dd12320c071cc3b4fbbcb1709bc7d2a9d406057d9c4e
7
- data.tar.gz: a9e5a053363e34ed6111f1823b487114a466ee42e99c6f5ccb0f58bea066fcbe99ceb21798b6b93c52786af63d6d0588e9938248bedad904baec96ba2b00df3d
6
+ metadata.gz: 0ba7953d5f457de62eb60117b04ab7857bab1a127cb0c17865d951343e8d4a3a937eecb25364c8b65e6f74d5b9337a117fa0957888bccb1bd845e4d73a53e31f
7
+ data.tar.gz: f75e4abf68ef7323ac2c6669dac8e2ae5baf49f09b4126f1e2d481bfd634dfbd9169fcf00e853d55b79f6216efbb9680b1e17048286ecf89ea3f1aaf1b8f89c0
data/README.md CHANGED
@@ -18,19 +18,19 @@ IMPORTANT! The whole reason for this gem was for using [Caphub](https://github.c
18
18
  CAUTION!! PLEASE READ CAREFULLY!! Capistrano is not thread-safe. However in order to work around this problem, each of the task is executing inside a thread that spawns a new process in order to run capistrano tasks The thread monitors the process. This works well, however if the tasks you are executing is working with files, you might get into deadlocks because multiple proceses try to access same resource. Instead of using files , please consider using StringIO instead.
19
19
 
20
20
  NEW Improvements started in version 2.0.0.alpha ( currently gem is in beta version)
21
- ---------------------------------------
21
+ -----------------------------------------------------------------------------------
22
22
 
23
23
  - Code for handling websocket events when a task is invoked was moved to a new gem [capistrano_sentinel](https://github.com/bogdanRada/capistrano_sentinel)
24
24
  - You can now deploy applications from anywhere on your computer without having to add this gem to the Gemfile, however you need to add the [capistrano_sentinel](https://github.com/bogdanRada/capistrano_sentinel) gem to your Gemfile, if you want to use this .
25
25
  - And only create anywhere on your computer a YAML file as described in section **[2.2) Deploying multiple applications from a central location](#22-deploying-multiple-applications-from-a-central-location)**
26
- - If you don't add the **capistrano_sentinel** to each of your applications, the executable of this gem will automatically create a new file "Gemfile.multi_cap" in the root of each of the applications that you are deploying, where the [capistrano_sentinel](https://github.com/bogdanRada/capistrano_sentinel) gem will be included and will use that Gemfile when doing deploys.
27
- - The Capfile file of each of the applications that you are deploying will also be automatically changed to require [capistrano_sentinel](https://github.com/bogdanRada/capistrano_sentinel) if you haven't done so yet.
26
+ - If you don't add the **capistrano_sentinel** to each of your applications, the executable of this gem will automatically create a new file "Gemfile.multi_cap" in the root of each of the applications that you are deploying, where the [capistrano_sentinel](https://github.com/bogdanRada/capistrano_sentinel) gem will be included and will use that Gemfile when doing deploys.
27
+ - The Capfile file of each of the applications that you are deploying will also be automatically changed to require [capistrano_sentinel](https://github.com/bogdanRada/capistrano_sentinel) if you haven't done so yet.
28
28
  - The changes to Capfile will be automatically reverted when the command finishes ( with success or error ) if the [capistrano_sentinel](https://github.com/bogdanRada/capistrano_sentinel) gem is not part of your Gemfile
29
29
  - If you are using RVM and there is a .rvmrc file in your project root directory and bash is available , the script will use bash emulator in order to properly load RVM gemsets because .rvmrc files need trusting
30
- - **Dont use BUNDLE EXEC command when running the executable for this gem unless you are using version 1 or this gem is part of the Gemfile of the application you are using. Otherwise just use the ```multi_cap``` executable without any prefix**
30
+ - **Dont use BUNDLE EXEC command when running the executable for this gem unless you are using version 1 or this gem is part of the Gemfile of the application you are using. Otherwise just use the `multi_cap` executable without any prefix ( Unless this gem is part of your gemfile, in which case the BUNDLE EXEC prefix is needed )**
31
31
 
32
- If you are using a older version than 2.0 please refer to this [README for version 1.7.2 or lower](https://github.com/bogdanRada/capistrano_multiconfig_parallel/blob/master/V1_README.md)
33
- ==========================================================================================================================================================
32
+ If you are using a older version than 2.0 please refer to this [README for version 1.7.2 or lower](https://github.com/bogdanRada/capistrano_multiconfig_parallel/blob/master/V1_README.md)
33
+ ==========================================================================================================================================================================================
34
34
 
35
35
  Requirements
36
36
  ------------
@@ -76,7 +76,7 @@ Add the following to your Capfile after requiring **capistrano** and **capistran
76
76
  Install locally on your system the capistrano_multiconfig_parallel gem using this command :
77
77
 
78
78
  ```ruby
79
- gem install capistrano_multiconfig_parallel -v 2.0.0.beta1
79
+ gem install capistrano_multiconfig_parallel -v 2.0.0.beta4
80
80
  ```
81
81
 
82
82
  Please read [Release Details](https://github.com/bogdanRada/capistrano_multiconfig_parallel/releases) if you are upgrading. We break backward compatibility between large ticks but you can expect it to be specified at release notes.
@@ -217,10 +217,12 @@ module CapistranoMulticonfigParallel
217
217
  job = CapistranoMulticonfigParallel::Job.new(self, options.merge(
218
218
  action: custom_command? && env_options[action_key].present? ? env_options[action_key] : options['action'],
219
219
  env_options: job_env_options,
220
- path: options.fetch('path', nil)
220
+ path: job_path(options)
221
221
 
222
222
  ))
223
-
223
+ if job.find_capfile.blank?
224
+ raise "Please make sure you have a Capfile in the project root directory #{job.job_path}"
225
+ end
224
226
  unless job.capistrano_sentinel_needs_updating?
225
227
  raise "Please consider upgrading the gem #{job.capistrano_sentinel_name} to version #{job.loaded_capistrano_sentinel_version} from #{job.job_capistrano_sentinel_version} in #{job.job_path} "
226
228
  end
@@ -16,13 +16,21 @@ module CapistranoMulticonfigParallel
16
16
  end
17
17
 
18
18
  def lockfile_parser
19
- if File.exists?(job_gemfile_lock)
19
+ if File.exists?(job_gemfile) && File.exists?(job_gemfile_lock)
20
20
  @lockfile_parser ||= Bundler::LockfileParser.new(Bundler.read_file("#{job_gemfile_lock}"))
21
21
  else
22
22
  raise RuntimeError, "please install the gems separately for this application #{job_path} and re-try again!"
23
23
  end
24
24
  end
25
25
 
26
+ def find_capfile(custom_path = job_path)
27
+ @capfile_path ||= Pathname.new(custom_path).children.find { |file| check_file(file, 'capfile') }
28
+ end
29
+
30
+ def capfile_name
31
+ find_capfile.present? ? find_capfile.basename : nil
32
+ end
33
+
26
34
  def gem_specs
27
35
  @specs = lockfile_parser.specs
28
36
  end
@@ -125,7 +133,11 @@ module CapistranoMulticonfigParallel
125
133
  end
126
134
 
127
135
  def job_path
128
- path || detect_root
136
+ if path.present? && File.directory?(path) && find_capfile(path).present?
137
+ path
138
+ else
139
+ detect_root
140
+ end
129
141
  end
130
142
 
131
143
  def user_home_directory
@@ -173,13 +185,17 @@ module CapistranoMulticonfigParallel
173
185
  "source #{rvm_scripts_path} && rvm rvmrc trust #{job_path} && cd #{job_path} && source #{job_rvmrc_file}"
174
186
  end
175
187
 
188
+ def rvm_bash_prefix(command)
189
+ rvm_enabled_for_job? ? "bash --login -c '#{command}'" : command
190
+ end
191
+
176
192
  def fetch_deploy_command
177
193
  prepare_application_for_deployment
178
194
  # config_flags = CapistranoMulticonfigParallel.configuration_flags.merge("capistrano_version": job_capistrano_version)
179
195
  environment_options = setup_command_line.join(' ')
180
196
  command = "#{check_rvm_loaded} && if [ `which bundler |wc -l` = 0 ]; then gem install bundler;fi && (#{bundle_gemfile_env(@job_final_gemfile)} bundle check || #{bundle_gemfile_env(@job_final_gemfile)} bundle install ) && WEBSOCKET_LOGGING=#{debug_websocket?} LOG_FILE=#{websocket_config.fetch('log_file_path', nil)} #{bundle_gemfile_env(@job_final_gemfile)} bundle exec cap #{job_stage} #{capistrano_action} #{environment_options}"
181
197
 
182
- command = "bash --login -c '#{command}'" if rvm_enabled_for_job?
198
+ command = rvm_bash_prefix(command)
183
199
  command = command.inspect
184
200
 
185
201
  command_text =<<-CMD
@@ -204,7 +220,7 @@ module CapistranoMulticonfigParallel
204
220
 
205
221
 
206
222
  def job_capfile
207
- File.join(job_path, "Capfile")
223
+ File.join(job_path, capfile_name.to_s)
208
224
  end
209
225
 
210
226
  def job_gemfile_multi
@@ -10,7 +10,7 @@ module CapistranoMulticonfigParallel
10
10
  MAJOR = 2
11
11
  MINOR = 0
12
12
  TINY = 0
13
- PRE = 'beta4'
13
+ PRE = 'beta5'
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_multiconfig_parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta4
4
+ version: 2.0.0.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada