capistrano-opscomplete 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: c7bda13c0f33ab7e11818d801b18587bb9cd5754f114b757627296d4cb1fc338
4
- data.tar.gz: 7587402cf62a88b9b7980ec1567f60552fa6fa8d8f1eb10d811c123175323bb0
3
+ metadata.gz: d1cf4271a72e12d2b60d9cbd229b58d64701e1b3958c7d795910f05165a2be98
4
+ data.tar.gz: edec14befbf173cc3e5bcfa16c6ee54feabf28eba6b8f44cdd59b0f54bbbbbf5
5
5
  SHA512:
6
- metadata.gz: 76e8a0d39c56bbc84fa91d4fc52fb1c22106c6afe19f47e0dff2a27fbd81ce0c2cf76cc7d0b2d90b6aa270d71fa9d5de02a076291883bc7bbc2c1c59a1e864cb
7
- data.tar.gz: a481d59f2a8e9cf719ec0e6120eebf9672c0a765bfe69ef253c262879c0d0d0f5874ad0a3508b7c7e3b93173ec8ae054090b55384f640e82773d86fb5779e2fa
6
+ metadata.gz: 5237d339e6abe4060590948891b34809abbbe13c6b24fad22f9bd7292a24d6c220c6f81931388d61c2cffdd3731afcd8197b611b87b5bb7227781782d633b9e7
7
+ data.tar.gz: b368b6403f897168a4c1d257e6b0caebfad7fa87eae9cf7369c62584fa8e45e61b91a0bbbf8010e6c8db8214f05f4460084b36afb50ed2a0253d41b9506ada63
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [1.0.1] - 2021-03-16
2
+
3
+ ### Fixed
4
+ - Made it possible to use `--dry-run` ([#27](https://github.com/makandra/capistrano-opscomplete/issues/27)
5
+
1
6
  ## [1.0.0] - 2021-03-16
2
7
 
3
8
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-opscomplete (1.0.0)
4
+ capistrano-opscomplete (1.0.1)
5
5
  capistrano (>= 3.0, < 4.0.0)
6
6
  rake
7
7
 
@@ -10,28 +10,28 @@ GEM
10
10
  specs:
11
11
  airbrussh (1.4.0)
12
12
  sshkit (>= 1.6.1, != 1.7.0)
13
- ast (2.4.0)
14
- capistrano (3.11.2)
13
+ ast (2.4.2)
14
+ capistrano (3.16.0)
15
15
  airbrussh (>= 1.0.0)
16
16
  i18n
17
17
  rake (>= 10.0.0)
18
18
  sshkit (>= 1.9.0)
19
- concurrent-ruby (1.1.6)
20
- i18n (1.8.4)
19
+ concurrent-ruby (1.1.9)
20
+ i18n (1.8.10)
21
21
  concurrent-ruby (~> 1.0)
22
22
  jaro_winkler (1.5.4)
23
- makandra-rubocop (4.2.0)
23
+ makandra-rubocop (4.4.0)
24
24
  rubocop (~> 0.76.0)
25
25
  rubocop-rails (~> 2.3.2)
26
- net-scp (2.0.0)
27
- net-ssh (>= 2.6.5, < 6.0.0)
28
- net-ssh (5.2.0)
29
- parallel (1.19.1)
30
- parser (2.7.0.2)
31
- ast (~> 2.4.0)
26
+ net-scp (3.0.0)
27
+ net-ssh (>= 2.6.5, < 7.0.0)
28
+ net-ssh (6.1.0)
29
+ parallel (1.20.1)
30
+ parser (3.0.1.1)
31
+ ast (~> 2.4.1)
32
32
  rack (2.2.3)
33
33
  rainbow (3.0.0)
34
- rake (13.0.1)
34
+ rake (13.0.3)
35
35
  rubocop (0.76.0)
36
36
  jaro_winkler (~> 1.5.1)
37
37
  parallel (~> 1.10)
@@ -42,11 +42,11 @@ GEM
42
42
  rubocop-rails (2.3.2)
43
43
  rack (>= 1.1)
44
44
  rubocop (>= 0.72.0)
45
- ruby-progressbar (1.10.1)
46
- sshkit (1.20.0)
45
+ ruby-progressbar (1.11.0)
46
+ sshkit (1.21.2)
47
47
  net-scp (>= 1.1.2)
48
48
  net-ssh (>= 2.8.0)
49
- unicode-display_width (1.6.0)
49
+ unicode-display_width (1.6.1)
50
50
 
51
51
  PLATFORMS
52
52
  ruby
@@ -82,11 +82,10 @@ module Capistrano
82
82
  end
83
83
 
84
84
  def managed_nodejs?
85
- test("[ -f ${HOME}/.nodejs_managed_by_makandra ]")
85
+ test('[ -f ${HOME}/.nodejs_managed_by_makandra ]')
86
86
  end
87
87
 
88
88
  def app_nodejs_version
89
-
90
89
  # 1) Get version from capistrano configuration (highest precedence, 'override')
91
90
  if fetch(:opscomplete_nodejs_version)
92
91
  debug("Using version from :opscomplete_nodejs_version setting: #{fetch(:opscomplete_nodejs_version)}.")
@@ -112,6 +111,10 @@ module Capistrano
112
111
  nodejs_installed_versions = capture(:nodejs_installed_versions).split("\n")
113
112
  nodejs_installed_versions.map!(&:strip)
114
113
  end
114
+
115
+ def validation_error!(message)
116
+ raise Capistrano::ValidationError, message unless dry_run?
117
+ end
115
118
  end
116
119
  end
117
120
  end
@@ -6,4 +6,4 @@ require 'rake'
6
6
  load File.expand_path('opscomplete/ruby.rake', __dir__)
7
7
  load File.expand_path('opscomplete/nodejs.rake', __dir__)
8
8
  load File.expand_path('opscomplete/supervisor.rake', __dir__)
9
- load File.expand_path('../opscomplete/hooks.rb', __FILE__)
9
+ load File.expand_path('opscomplete/hooks.rb', __dir__)
@@ -14,8 +14,7 @@ namespace :opscomplete do
14
14
  on roles fetch(:nodejs_roles, :all) do |host|
15
15
  warn("#{host}: Managed Node.js environment! Won't do any changes to nodejs version.") if managed_nodejs?
16
16
  unless capture(:nodejs_get_version, release_path) == app_nodejs_version
17
- raise Capistrano::ValidationError,
18
- "#{host}: Node.js version is not set according to application\'s .node-version or .nvmrc file. Use cap opscomplete:nodejs:ensure."
17
+ validation_error!("#{host}: Node.js version is not set according to application\'s .node-version or .nvmrc file. Use cap opscomplete:nodejs:ensure.")
19
18
  end
20
19
  info("#{host}: Node.js #{app_nodejs_version} is installed.")
21
20
  end
@@ -33,7 +32,7 @@ namespace :opscomplete do
33
32
  invoke('opscomplete:nodejs:update_nodejs_build')
34
33
  on roles fetch(:nodejs_roles, :all) do |host|
35
34
  if managed_nodejs?
36
- raise Capistrano::ValidationError, "#{host}: Managed Node.js environment! Won't do any changes to Node.js version."
35
+ validation_error!("#{host}: Managed Node.js environment! Won't do any changes to Node.js version.")
37
36
  end
38
37
  if nodejs_installed_versions.include?(app_nodejs_version)
39
38
  info("#{host}: Node.js #{app_nodejs_version} is installed.")
@@ -45,8 +44,7 @@ namespace :opscomplete do
45
44
  else
46
45
  info("#{host}: Check if the configured Node.js version is part of the installable versions")
47
46
  execute :nodejs_installable_versions
48
- raise Capistrano::ValidationError,
49
- "#{host}: Configured Node.js version is neither installed nor installable."
47
+ validation_error!("#{host}: Configured Node.js version is neither installed nor installable.")
50
48
  end
51
49
  execute(:nodejs_set_version, "'#{app_nodejs_version}'")
52
50
  end
@@ -14,8 +14,7 @@ namespace :opscomplete do
14
14
  on roles fetch(:rbenv_roles, :all) do |host|
15
15
  warn("#{host}: Managed Ruby environment! Won't do any changes to ruby version.") if managed_ruby?
16
16
  unless capture(:ruby_get_current_version) == app_ruby_version
17
- raise Capistrano::ValidationError,
18
- "#{host}: Ruby version is not set according to application\'s .ruby-version file. Use cap opscomplete:ruby:ensure."
17
+ validation_error!("#{host}: Ruby version is not set according to application\'s .ruby-version file. Use cap opscomplete:ruby:ensure.")
19
18
  end
20
19
  info("#{host}: Ruby #{app_ruby_version} is installed.")
21
20
  end
@@ -82,7 +81,7 @@ namespace :opscomplete do
82
81
  invoke('opscomplete:ruby:update_ruby_build')
83
82
  on roles fetch(:rbenv_roles, :all) do |host|
84
83
  if managed_ruby?
85
- raise Capistrano::ValidationError, "#{host}: Managed Ruby environment! Won't do any changes to Ruby version."
84
+ validation_error!("#{host}: Managed Ruby environment! Won't do any changes to Ruby version.")
86
85
  end
87
86
  if ruby_installed_versions.include?(app_ruby_version)
88
87
  info("#{host}: Ruby #{app_ruby_version} is installed.")
@@ -92,8 +91,7 @@ namespace :opscomplete do
92
91
  execute(:ruby_install_version, "'#{app_ruby_version}'")
93
92
  end
94
93
  else
95
- raise Capistrano::ValidationError,
96
- "#{host}: Configured Ruby version is neither installed nor installable."
94
+ validation_error!("#{host}: Configured Ruby version is neither installed nor installable.")
97
95
  end
98
96
  unless capture(:ruby_get_current_version) == app_ruby_version
99
97
  set :ruby_modified, true
@@ -114,16 +112,14 @@ namespace :opscomplete do
114
112
  if test("[ -f #{current_ruby_version_file_path} ]")
115
113
  execute(:rbenv, :global, capture(:cat, current_ruby_version_file_path))
116
114
  else
117
- raise Capistrano::ValidationError,
118
- "#{host}: Missing .ruby-version in #{current_path}. Won't set a new global version."
115
+ validation_error!("#{host}: Missing .ruby-version in #{current_path}. Won't set a new global version.")
119
116
  end
120
117
  if test("[ -f '#{current_path}/.bundle/config' ]")
121
118
  debug("#{host}: Found #{current_path}/.bundle/config, running bundle pristine.")
122
119
  set :bundle_gemfile, -> { current_path.join('Gemfile') }
123
120
  execute(:bundle, :pristine)
124
121
  else
125
- raise Capistrano::ValidationError,
126
- "Unable to find #{current_path}/.bundle/config, won't run bundle pristine."
122
+ validation_error!("Unable to find #{current_path}/.bundle/config, won't run bundle pristine.")
127
123
  end
128
124
  end
129
125
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Opscomplete
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-opscomplete
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makandra Operations
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2021-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: makandra-rubocop