capistrano-exfel 0.0.13 → 0.0.14

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: c382e3e124886cc19f9c480a44afcd1e0275e374
4
- data.tar.gz: 3cc6c89c62797dc4c990c46183995a5523d6a70a
3
+ metadata.gz: '0569ba176090d8b657cc3b7059eb8082da43c73f'
4
+ data.tar.gz: 9a2bb7195b604db0fc96609349e843ad0a1866dd
5
5
  SHA512:
6
- metadata.gz: de51ee4b2892cfed2b6422632b73c2640ec998203374425bb8fb6cdfcf8471dbb9487c119850ee2d026c2434415261e38bc642cc2f729990a5aded6f44c0b926
7
- data.tar.gz: 57819b8d0bc8f9a566e911e1b9da3f3e13fd34058377d6805498dc32f135158e733441dcef0667ad1e10e44aedd885bdf8ffe7db98771c2604e3d37e1d7481aa
6
+ metadata.gz: 76fdc51fbf356b166ba49139246e8ee75b12c87f00d1002dd417e570801553ad34b19f570418c0c0b4d4f7b6cdf2a55ce79a35054a7fe13d5c38c10c6a98d21c
7
+ data.tar.gz: d7c38561029507cc3c4167ff7069a19715ceda2afea9b6de631c6e307333c8721e2f0bdd9348c516fa7fa598d4acd63d24d512c663d24faacf17709d1cd57b74
data/.rubocop.yml CHANGED
@@ -18,3 +18,8 @@ Style/Next:
18
18
  # Use the lambda method for multi-line lambdas.
19
19
  Style/Lambda:
20
20
  Enabled: false
21
+
22
+ #
23
+ # Block has too many lines.
24
+ Metrics/BlockLength:
25
+ Max: 100 # Default 25
data/Gemfile CHANGED
@@ -4,4 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  # Use Rubocop to validate ruby code syntax
7
- gem 'rubocop', '~> 0.30.1', require: false, group: :development
7
+ gem 'rubocop', '~> 0.47.1', require: false, group: :development
data/README.md CHANGED
@@ -12,7 +12,7 @@ Add these lines to your application's Gemfile:
12
12
  gem 'capistrano', '~> 3.4.0'
13
13
  gem 'capistrano-rails', '~> 1.1.2'
14
14
  gem 'capistrano-rvm', '~> 0.1.2'
15
- gem 'capistrano-exfel', '~> 0.0.13'
15
+ gem 'capistrano-exfel', '~> 0.0.14'
16
16
 
17
17
  And then execute:
18
18
 
@@ -84,9 +84,6 @@ The most important configurable options and their defaults:options can be added
84
84
  # Default branch is :master
85
85
  # ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
86
86
 
87
- # Default value for :scm is :git
88
- # set :scm, :git
89
-
90
87
  # Default value for :format is :pretty
91
88
  # set :format, :pretty
92
89
 
@@ -107,6 +104,11 @@ The most important configurable options and their defaults:options can be added
107
104
  set :rvm_ruby_version, '2.1.5' # If not specified will ask for it
108
105
  # set :rvm_roles, [:app, :web]
109
106
 
107
+ As an example, to configure GIT plugin, add the following to the Capfile:
108
+
109
+ require 'capistrano/scm/git'
110
+ install_plugin Capistrano::SCM::Git
111
+
110
112
  ## Contributing
111
113
 
112
114
  1. Fork it ( https://github.com/luismaia/capistrano-exfel/fork )
@@ -20,5 +20,5 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  spec.add_development_dependency 'bundler', '~> 1.7'
23
- spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'rake', '> 10.0'
24
24
  end
@@ -1,6 +1,6 @@
1
1
  module Capistrano
2
2
  # Capistrano::Exfel version information
3
3
  module Exfel
4
- VERSION = '0.0.13'
4
+ VERSION = '0.0.14'.freeze
5
5
  end
6
6
  end
@@ -93,7 +93,7 @@ namespace :apache do
93
93
 
94
94
  set :shared_apache_conf_file, "#{fetch(:shared_apache_path)}/app_#{fetch(:app_name_uri)}.conf"
95
95
  http_file = File.expand_path('../../recipes/apache_http.conf', __FILE__)
96
- upload! StringIO.new(File.read(http_file)), "#{fetch(:shared_apache_conf_file)}"
96
+ upload! StringIO.new(File.read(http_file)), fetch(:shared_apache_conf_file).to_s
97
97
 
98
98
  debug "chmod g+w #{fetch(:shared_apache_conf_file)}"
99
99
  execute "chmod g+w #{fetch(:shared_apache_conf_file)}"
@@ -126,7 +126,7 @@ namespace :apache do
126
126
 
127
127
  set :shared_apache_conf_ssl_file, "#{fetch(:shared_apache_path)}/app_#{fetch(:app_name_uri)}_ssl.conf"
128
128
  http_ssl_file = File.expand_path('../../recipes/apache_ssl.conf', __FILE__)
129
- upload! StringIO.new(File.read(http_ssl_file)), "#{fetch(:shared_apache_conf_ssl_file)}"
129
+ upload! StringIO.new(File.read(http_ssl_file)), fetch(:shared_apache_conf_ssl_file).to_s
130
130
 
131
131
  debug "chmod g+w #{fetch(:shared_apache_conf_ssl_file)}"
132
132
  execute "chmod g+w #{fetch(:shared_apache_conf_ssl_file)}"
@@ -233,7 +233,7 @@ namespace :apache do
233
233
  end
234
234
  end
235
235
 
236
- error 'ServerSignature was not found' if fetch(:num_replacements) == 0
236
+ error 'ServerSignature was not found' if fetch(:num_replacements).zero?
237
237
  end
238
238
 
239
239
  # Don't give away too much information about all the subcomponents we are running.
@@ -256,7 +256,7 @@ namespace :apache do
256
256
  set :num_replacements, fetch(:num_replacements) + 1
257
257
  end
258
258
 
259
- error 'ServerTokens was not found' if fetch(:num_replacements) == 0
259
+ error 'ServerTokens was not found' if fetch(:num_replacements).zero?
260
260
  end
261
261
 
262
262
  # Do not allow browsing outside the document root
@@ -268,9 +268,9 @@ namespace :apache do
268
268
  # AllowOverride None
269
269
  # </Directory>
270
270
  #
271
- message_line_1 = '# Default Directory configuration changed via Capistrano.'
271
+ message_line1 = '# Default Directory configuration changed via Capistrano.'
272
272
 
273
- set :server_dir_secure_configuration, get_num_occurrences_in_file(fetch(:httpd_conf_file), message_line_1)
273
+ set :server_dir_secure_configuration, get_num_occurrences_in_file(fetch(:httpd_conf_file), message_line1)
274
274
 
275
275
  if fetch(:server_token_prod) == 1
276
276
  info 'The correct directory configuration is already correctly set'
@@ -314,7 +314,7 @@ namespace :apache do
314
314
  </Directory>
315
315
 
316
316
  EOF
317
- upload! StringIO.new(new_directory_configs), "#{fetch(:tmp_dir_new_config)}"
317
+ upload! StringIO.new(new_directory_configs), fetch(:tmp_dir_new_config).to_s
318
318
 
319
319
  # Update the new configuration file to have the original configuration commented
320
320
  debug "cat #{fetch(:tmp_dir_new_config)} >> #{fetch(:tmp_dir_original_commented_config)}"
@@ -326,7 +326,7 @@ namespace :apache do
326
326
  debug "Special sed parameter is: ''#{special_sed_param}''"
327
327
 
328
328
  # Replace the old original directory configuration for a specific message (in the temporary file)
329
- message_complete = "#{message_line_1}\\n#\\n"
329
+ message_complete = "#{message_line1}\\n#\\n"
330
330
  command_to_replace = "out=$(sed -e :a -e '$!N;s/\\n/.*/;ta' #{fetch(:tmp_dir_original_config)} | "\
331
331
  "sed -e :a -e '$!N;s/\//./;ta'); sed -i '/<Directory .>.*/ {#{special_sed_param} "\
332
332
  "s/'$out'/#{message_complete}/g}' #{fetch(:tmp_httpd_file)}"
@@ -334,7 +334,7 @@ namespace :apache do
334
334
  execute command_to_replace
335
335
 
336
336
  # Search for the line where the message was inserted
337
- command = "grep -n '#{message_line_1}' #{fetch(:tmp_httpd_file)} | cut -d':' -f 1"
337
+ command = "grep -n '#{message_line1}' #{fetch(:tmp_httpd_file)} | cut -d':' -f 1"
338
338
  debug command
339
339
  line_with_match = get_command_output(command).to_i
340
340
  next_line = line_with_match + 1
@@ -69,7 +69,6 @@ namespace :application do
69
69
  info "shared_path => #{fetch(:shared_path)}"
70
70
  info "repo_url => #{fetch(:repo_url)}"
71
71
  info "branch => #{fetch(:branch)}"
72
- info "scm => #{fetch(:scm)}"
73
72
  info "format => #{fetch(:format)}"
74
73
  info "log_level => #{fetch(:log_level)}"
75
74
  info "pty => #{fetch(:pty)}"
@@ -122,9 +121,6 @@ namespace :load do
122
121
  # Default branch is :master
123
122
  ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
124
123
 
125
- # Default value for :scm is :git
126
- set :scm, -> { :git }
127
-
128
124
  # Default value for :format is :pretty
129
125
  set :format, -> { :pretty }
130
126
 
@@ -58,7 +58,7 @@ namespace :database do
58
58
  set :database_username, ask('Database Username:', default_username)
59
59
  set :database_password, ask('Database Password:', default_password)
60
60
 
61
- upload! StringIO.new(File.read("#{fetch(:db_orig_file_path)}")), "#{fetch(:database_file_path)}"
61
+ upload! StringIO.new(File.read(fetch(:db_orig_file_path).to_s)), fetch(:database_file_path).to_s
62
62
 
63
63
  execute "sed -i 's/<<database_name>>/#{fetch(:database_name)}/g' #{fetch(:database_file_path)}"
64
64
  execute "sed -i 's/<<database_username>>/#{fetch(:database_username)}/g' #{fetch(:database_file_path)}"
@@ -27,12 +27,12 @@ namespace :secrets do
27
27
  on roles(:app) do
28
28
  debug '#' * 50
29
29
  debug 'Create and configure secrets.yml file'
30
- secrets_file_path = "#{fetch(:secrets_file_path)}"
30
+ secrets_file_path = fetch(:secrets_file_path).to_s
31
31
 
32
32
  set :secrets_original_file_path, File.expand_path('../../recipes/config/secrets_example.yml', __FILE__)
33
33
 
34
34
  unless remote_file_exists?(secrets_file_path)
35
- upload! StringIO.new(File.read("#{fetch(:secrets_original_file_path)}")), "#{fetch(:secrets_file_path)}"
35
+ upload! StringIO.new(File.read(fetch(:secrets_original_file_path).to_s)), fetch(:secrets_file_path).to_s
36
36
  end
37
37
 
38
38
  execute "sed -i 's|<<APP_NAME>>|#{fetch(:app_name)}|g' #{fetch(:secrets_file_path)}"
@@ -51,12 +51,12 @@ namespace :secrets do
51
51
 
52
52
  pattern = 'secret_key_base:.*'
53
53
  new_secret = "secret_key_base: '#{SecureRandom.hex(64)}'"
54
- secrets_file_path = "#{fetch(:secrets_file_path)}"
54
+ secrets_file_path = fetch(:secrets_file_path).to_s
55
55
 
56
56
  if remote_file_exists?(secrets_file_path)
57
57
  num_occurrences = get_num_occurrences_in_file(secrets_file_path, pattern)
58
58
 
59
- if num_occurrences == 0
59
+ if num_occurrences.zero?
60
60
  error "no secret token found in #{secrets_file_path}"
61
61
  exit 1
62
62
  end
@@ -7,16 +7,16 @@ def get_num_occurrences_in_file(file_path, string)
7
7
  end
8
8
 
9
9
  def get_command_output(command)
10
- capture("#{command}").strip
10
+ capture(command.to_s).strip
11
11
  end
12
12
 
13
13
  def rails_default_app_name
14
- return "#{fetch(:app_name)}" if get_rails_env_abbr == 'prod'
14
+ return fetch(:app_name).to_s if get_rails_env_abbr == 'prod'
15
15
  "#{get_rails_env_abbr}_#{fetch(:app_name)}"
16
16
  end
17
17
 
18
18
  def rails_default_db_name
19
- return "#{fetch(:app_name)}" if get_rails_env_abbr == 'prod'
19
+ return fetch(:app_name).to_s if get_rails_env_abbr == 'prod'
20
20
  "#{fetch(:app_name)}_#{get_rails_env_abbr}"
21
21
  end
22
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-exfel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Maia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-04 00:00:00.000000000 Z
11
+ date: 2017-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  description: Deployment of Ruby on Rails 4 Applications in EXFEL Virtual Machines
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.4.6
91
+ rubygems_version: 2.6.10
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Deploy Ruby on Rails 4 Applications in EXFEL Virtual Machines