dlss-capistrano 5.3.0 → 6.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c20ce3abcea6996c7366473874dbd9b7106749c5e7b365d21e301195ead06830
4
- data.tar.gz: 75a94eb0b169763cd62e7dd92bcb8b183d7621e5ea271613c06b7b4814835c7d
3
+ metadata.gz: 3e1b8d438e47aeccd15dd40990abe17e81629f4d84ce51b1f51f80e977fe0cb1
4
+ data.tar.gz: 4e8cb2dc57d7504eec22095ac9208068f3679b7b38f827eeb607e32cb22f67db
5
5
  SHA512:
6
- metadata.gz: c18fc1a359d2bffa0f474b4e3eaa4d00010e01bddf6eb37dde993512c1f3076ed861b5ff79d955afa8a406d125c95feb5a9b91561a02d81561484c0e802a03b9
7
- data.tar.gz: c03fd209a7440b754cad93ed9b671cd3554d86804c358bc7aa0b65fb2c46a99d6b518b3baab57719da1784fe42c85d03b55d5602f56a8810fbf13cb2e56a0f9b
6
+ metadata.gz: f5c5375c551681add97ce74d86647b15db8eaa4d5c57ff5795b427a035a48ae1605a004ef43e97011b713c1d1b2a6ae09211c3e9363b568a094474e16e371e75
7
+ data.tar.gz: 3b00d0ef2a7343a58c8d6f24e06dc0d741418c6cb7f382906c4f4a3a13285cc62298c692defe5cb2b6f3ecca44e7b2de1f14bba290c437d8bfb383bb7c5e6597
data/README.md CHANGED
@@ -89,6 +89,12 @@ These tasks are intended to replace those provided by `capistrano-sidekiq` gem,
89
89
 
90
90
  `cap ENV racecar_systemd:{stop,start,restart}`: stops, starts, restarts Racecar via systemd.
91
91
 
92
+ ### Ruby install
93
+ This is useful for upgrading to a new version of Ruby and ensuring the bundle is installed, before switching
94
+ the application server to default to the new Ruby version.
95
+
96
+ `cap ENV "dlss:ruby:install:[ruby-4.0.0]`: installs or updates Ruby via rvm.
97
+
92
98
  #### Capistrano role
93
99
 
94
100
  The sidekiq_systemd tasks assume a Capistrano role of `:app`. If your application uses a different Capistrano role for hosts that run Sidekiq workers, you can configure this in `config/deploy.rb`, _e.g._:
@@ -4,7 +4,7 @@ $:.unshift lib unless $:.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "dlss-capistrano"
7
- s.version = '5.3.0'
7
+ s.version = '6.1.0'
8
8
 
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Chris Beer", 'Mike Giarlo']
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
19
19
  # All dependencies are runtime dependencies, since this gem's "runtime" is
20
20
  # the dependent gem's development-time.
21
21
  s.add_dependency "capistrano", "~> 3.0"
22
- s.add_dependency "capistrano-bundle_audit", ">= 0.3.0"
23
22
  s.add_dependency "capistrano-shared_configs"
24
23
  s.add_dependency "capistrano-one_time_key", ">= 0.2.0"
25
24
  # support for MacOS 14.4+ usage of ed25519 SSH keys
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :dlss do
4
+ namespace :ruby do
5
+ desc 'Install a specific Ruby version using RVM and run bundle install'
6
+ task :install, :version do |_task, args|
7
+ on roles(:app) do
8
+ ruby_version = args[:version]
9
+
10
+ if ruby_version.nil? || ruby_version.empty?
11
+ error <<~ERROR
12
+ Ruby version is required.
13
+
14
+ Usage examples:
15
+ cap stage dlss:ruby:install[ruby-3.1.0] # Basic usage
16
+ cap stage "dlss:ruby:install[ruby-3.1.0]" # Quoted (recommended for zsh)
17
+ RUBY_VERSION=ruby-3.1.0 cap stage dlss:ruby:install_with_env
18
+ ERROR
19
+ exit 1
20
+ end
21
+
22
+ info "Installing Ruby #{ruby_version} using RVM..."
23
+
24
+ # Check if RVM is installed
25
+ rvm_installed = test('which rvm') || test('[ -s "$HOME/.rvm/scripts/rvm" ]') || test('command -v rvm')
26
+
27
+ unless rvm_installed
28
+ error <<~ERROR
29
+ RVM is not installed on the remote server.
30
+
31
+ To install RVM first, run:
32
+ \\curl -sSL https://get.rvm.io | bash -s stable
33
+
34
+ Then logout and login again, or source the RVM script manually.
35
+ ERROR
36
+ exit 1
37
+ end
38
+
39
+ # Try to source RVM if it exists
40
+ if test('[ -s "$HOME/.rvm/scripts/rvm" ]')
41
+ execute 'source ~/.rvm/scripts/rvm'
42
+ elsif test('[ -s "/etc/profile.d/rvm.sh" ]')
43
+ execute 'source /etc/profile.d/rvm.sh'
44
+ end
45
+
46
+ # Install the Ruby version
47
+ info "Installing Ruby #{ruby_version}..."
48
+ execute "rvm install #{ruby_version}"
49
+
50
+ info "Setting Ruby #{ruby_version} as current..."
51
+ execute "rvm use #{ruby_version}"
52
+
53
+ # Use Capistrano's bundler task for bundle install with fallback
54
+ info 'Running bundle install using Capistrano bundler task...'
55
+ begin
56
+ invoke! 'bundler:install'
57
+ info "Ruby #{ruby_version} installed successfully and bundle install completed!"
58
+ rescue NameError => e
59
+ warn "Bundler task not available (#{e.message}), trying manual bundle install..."
60
+ # Fallback to manual bundle install in current directory
61
+ if test("[ -f #{current_path}/Gemfile ]")
62
+ within current_path do
63
+ execute 'bundle install'
64
+ info "Ruby #{ruby_version} installed successfully and bundle install completed!"
65
+ end
66
+ else
67
+ error "Could not find Gemfile in #{current_path}. Please check your deployment configuration."
68
+ exit 1
69
+ end
70
+ end
71
+ end
72
+ end
73
+
74
+ desc 'Install Ruby version from environment variable RUBY_VERSION'
75
+ task :install_with_env do
76
+ ruby_version = ENV.fetch('RUBY_VERSION', nil)
77
+ if ruby_version.nil? || ruby_version.empty?
78
+ error 'RUBY_VERSION environment variable is required. Usage: RUBY_VERSION=ruby-3.1.0 cap stage ruby:install_with_env'
79
+ exit 1
80
+ end
81
+ invoke 'ruby:install', ruby_version
82
+ end
83
+ end
84
+ end
@@ -1,5 +1,4 @@
1
1
  require 'capistrano/one_time_key'
2
- require 'capistrano/bundle_audit'
3
2
  require 'capistrano/shared_configs'
4
3
 
5
4
  Dir.glob("#{__dir__}/capistrano/tasks/*.rake").each { |r| import r }
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dlss-capistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  - Mike Giarlo
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-11-26 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: capistrano
@@ -25,20 +24,6 @@ dependencies:
25
24
  - - "~>"
26
25
  - !ruby/object:Gem::Version
27
26
  version: '3.0'
28
- - !ruby/object:Gem::Dependency
29
- name: capistrano-bundle_audit
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: 0.3.0
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: 0.3.0
42
27
  - !ruby/object:Gem::Dependency
43
28
  name: capistrano-shared_configs
44
29
  requirement: !ruby/object:Gem::Requirement
@@ -117,6 +102,7 @@ files:
117
102
  - lib/dlss/capistrano/tasks/check_status.rake
118
103
  - lib/dlss/capistrano/tasks/control_master.rake
119
104
  - lib/dlss/capistrano/tasks/deployed_branch.rake
105
+ - lib/dlss/capistrano/tasks/install_ruby.rake
120
106
  - lib/dlss/capistrano/tasks/racecar_systemd.rake
121
107
  - lib/dlss/capistrano/tasks/remote_execute.rake
122
108
  - lib/dlss/capistrano/tasks/setup/setup.rake
@@ -127,11 +113,9 @@ files:
127
113
  - lib/dlss/capistrano/tasks/ssh_check.rake
128
114
  - lib/dlss/capistrano/tasks/strscan.rake
129
115
  - lib/lyberteam-capistrano-devel.rb
130
- homepage:
131
116
  licenses:
132
117
  - Apache-2.0
133
118
  metadata: {}
134
- post_install_message:
135
119
  rdoc_options: []
136
120
  require_paths:
137
121
  - lib
@@ -146,8 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
130
  - !ruby/object:Gem::Version
147
131
  version: 1.3.6
148
132
  requirements: []
149
- rubygems_version: 3.5.16
150
- signing_key:
133
+ rubygems_version: 3.6.9
151
134
  specification_version: 4
152
135
  summary: Capistrano recipes for use in SUL/DLSS projects
153
136
  test_files: []