capistrano3_featureset 1.0.0 → 1.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 +4 -4
- data/.gitignore +1 -0
- data/README.md +33 -2
- data/capistrano3_featureset.gemspec +1 -2
- data/lib/capistrano3_featureset/default.rb +26 -1
- data/lib/capistrano3_featureset/tasks/featureset.rake +0 -22
- data/lib/capistrano3_featureset/tasks/version_manager.rake +106 -0
- metadata +4 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c9172c1524531a7246d2517f48daf9f6b409681914ddf539a44a6db35c81b0d
|
|
4
|
+
data.tar.gz: 5876c45aaf6bcbb5837866a60c52d982c61dc1fc0cbf97064fad34e16dd57b05
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d12b43d848be73bcf6fef029fd6e928387ea50eeaf6339f43b278efa6c5aa3d05e7e7cb292736f24306389de271c4b32f579fd70433e24310d12c74ff319343
|
|
7
|
+
data.tar.gz: 0d5b5bdf4ae553d4d6f986dc92d0e0218172982ad827000e3986b8328c45f17a10d44c42e71ab4b477f69732cba5a94d3abd419997da2f4603d68509c2013e76
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Capistrano3 - Feature set
|
|
2
2
|
|
|
3
|
+
A feature set for capistrano3 with rsync plugin.
|
|
4
|
+
|
|
3
5
|
## Installation
|
|
4
6
|
|
|
5
7
|
Add this line to your application's Gemfile:
|
|
@@ -33,8 +35,9 @@ set :application, 'application-name'
|
|
|
33
35
|
set :repo_url, 'git@github.com:your-repo.git'
|
|
34
36
|
set :deploy_to, '/srv/application-name'
|
|
35
37
|
|
|
36
|
-
set :
|
|
38
|
+
set :ruby_version, '4.0.1'
|
|
37
39
|
|
|
40
|
+
# set :version_manager, 'rvm' # default is mise
|
|
38
41
|
# set :enable_delayed_job, false # default is false
|
|
39
42
|
# set :enable_solid_queue, false # default is false
|
|
40
43
|
# set :enable_whenever, false # default is false
|
|
@@ -43,10 +46,38 @@ set :rvm_ruby_version, '3.1.1'
|
|
|
43
46
|
# set :systemd_usage, true # default is true
|
|
44
47
|
```
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
|
|
50
|
+
# Changelog
|
|
51
|
+
|
|
52
|
+
## [1.1.0] - 2026-09-16
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
|
|
56
|
+
* Support for selecting the Ruby version manager.
|
|
57
|
+
* Added support for both **mise** and **RVM**.
|
|
58
|
+
* The version manager can be configured per deployment.
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
* Existing RVM-based deployments remain supported.
|
|
63
|
+
* Ruby command execution is now handled through the configured version manager.
|
|
64
|
+
|
|
65
|
+
## [1.0.0]
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
|
|
69
|
+
* Initial stable release.
|
|
70
|
+
* Working RVM-based Ruby deployment support.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# License
|
|
47
74
|
|
|
48
75
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
49
76
|
|
|
50
77
|
## Integration of Capistrano 3.7.1+ rsync plugin
|
|
51
78
|
|
|
52
79
|
see https://github.com/infovore/capistrano-rsync-plugin
|
|
80
|
+
|
|
81
|
+
## Integration of Capistrano::RVM plugin
|
|
82
|
+
|
|
83
|
+
see https://github.com/capistrano/rvm
|
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |spec|
|
|
5
5
|
spec.name = 'capistrano3_featureset'
|
|
6
|
-
spec.version = '1.
|
|
6
|
+
spec.version = '1.1.0'
|
|
7
7
|
spec.authors = ['Georg Limbach', 'Tom Armitage', 'Stefan Daschek']
|
|
8
8
|
spec.email = ['georg.limbach@lichtbit.com']
|
|
9
9
|
|
|
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
|
|
19
19
|
spec.add_dependency 'capistrano', '~> 3.0'
|
|
20
20
|
spec.add_dependency 'capistrano-rails'
|
|
21
|
-
spec.add_dependency 'capistrano-rvm'
|
|
22
21
|
spec.add_dependency 'ed25519' # to use modern ssh key ciphers
|
|
23
22
|
spec.add_dependency 'bcrypt_pbkdf' # to use modern ssh key ciphers
|
|
24
23
|
end
|
|
@@ -8,7 +8,6 @@ require 'capistrano/deploy'
|
|
|
8
8
|
require 'capistrano/rsync'
|
|
9
9
|
install_plugin Capistrano::SCM::Rsync
|
|
10
10
|
|
|
11
|
-
require 'capistrano/rvm'
|
|
12
11
|
require 'capistrano/rails'
|
|
13
12
|
begin
|
|
14
13
|
require 'whenever/capistrano'
|
|
@@ -16,4 +15,30 @@ rescue StandardError, LoadError
|
|
|
16
15
|
nil
|
|
17
16
|
end
|
|
18
17
|
|
|
18
|
+
|
|
19
|
+
namespace :load do
|
|
20
|
+
task :defaults do
|
|
21
|
+
set :ruby_map_bins, %w{gem rake ruby bundle}
|
|
22
|
+
set :rvm_type, :user
|
|
23
|
+
|
|
24
|
+
rsync_excludes = %w[.git* spec rspec test Capfile config/deploy config/deploy.rb]
|
|
25
|
+
set :rsync_options, "-azc --delete --delete-excluded --exclude #{rsync_excludes.join(' --exclude ')}"
|
|
26
|
+
|
|
27
|
+
set :version_manager, 'mise'
|
|
28
|
+
set :enable_delayed_job, false
|
|
29
|
+
set :enable_solid_queue, false
|
|
30
|
+
set :enable_whenever, false
|
|
31
|
+
set :enable_unicorn, false
|
|
32
|
+
set :enable_puma, false
|
|
33
|
+
|
|
34
|
+
set :systemd_usage, true
|
|
35
|
+
|
|
36
|
+
append :linked_dirs, 'public/uploads'
|
|
37
|
+
append :linked_dirs, 'private'
|
|
38
|
+
append :linked_dirs, 'log'
|
|
39
|
+
set :more_linked_dirs, 'tmp/pids' => 'pids'
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
load File.expand_path('tasks/version_manager.rake', __dir__)
|
|
19
44
|
load File.expand_path('tasks/featureset.rake', __dir__)
|
|
@@ -121,28 +121,6 @@ namespace :featureset do
|
|
|
121
121
|
end
|
|
122
122
|
end
|
|
123
123
|
|
|
124
|
-
namespace :load do
|
|
125
|
-
task :defaults do
|
|
126
|
-
rsync_excludes = %w[.git* spec rspec test Capfile config/deploy config/deploy.rb]
|
|
127
|
-
set :rsync_options, "-azc --delete --delete-excluded --exclude #{rsync_excludes.join(' --exclude ')}"
|
|
128
|
-
|
|
129
|
-
set :rvm_type, :user
|
|
130
|
-
|
|
131
|
-
set :enable_delayed_job, false
|
|
132
|
-
set :enable_solid_queue, false
|
|
133
|
-
set :enable_whenever, false
|
|
134
|
-
set :enable_unicorn, false
|
|
135
|
-
set :enable_puma, false
|
|
136
|
-
|
|
137
|
-
set :systemd_usage, true
|
|
138
|
-
|
|
139
|
-
append :linked_dirs, 'public/uploads'
|
|
140
|
-
append :linked_dirs, 'private'
|
|
141
|
-
append :linked_dirs, 'log'
|
|
142
|
-
set :more_linked_dirs, 'tmp/pids' => 'pids'
|
|
143
|
-
end
|
|
144
|
-
end
|
|
145
|
-
|
|
146
124
|
before 'deploy:migrate', 'featureset:db_load_schema' unless ENV['FIRST_DEPLOYMENT'].nil?
|
|
147
125
|
after 'deploy:publishing', 'featureset:puma_reload'
|
|
148
126
|
after 'deploy:publishing', 'featureset:unicorn_upgrade'
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
RVM_SYSTEM_PATH = "/usr/local/rvm"
|
|
2
|
+
RVM_USER_PATH = "~/.rvm"
|
|
3
|
+
|
|
4
|
+
namespace :version_manager do
|
|
5
|
+
desc "Prints the mise/RVM and Ruby version on the target host"
|
|
6
|
+
task :check do
|
|
7
|
+
on roles(fetch(:ruby_roles, :all)) do
|
|
8
|
+
if fetch(:version_manager) == 'mise'
|
|
9
|
+
|
|
10
|
+
# chcek ruby version
|
|
11
|
+
ruby_version = fetch(:ruby_version)
|
|
12
|
+
installed_rubies = capture(:mise, 'list', 'ruby', '--installed')
|
|
13
|
+
unless installed_rubies.include?(ruby_version)
|
|
14
|
+
error "Ruby #{ruby_version} is not installed via mise."
|
|
15
|
+
error "Installed Rubies:"
|
|
16
|
+
error installed_rubies
|
|
17
|
+
error "Install with: mise install ruby@#{ruby_version}"
|
|
18
|
+
raise Capistrano::Error, "Required Ruby #{ruby_version} is not installed"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# check env file
|
|
22
|
+
env_file = "/home/#{fetch(:application)}/#{fetch(:application)}_env_vars"
|
|
23
|
+
if test("[ -f #{env_file} ]")
|
|
24
|
+
exported_vars = capture(
|
|
25
|
+
:grep,
|
|
26
|
+
'-nE',
|
|
27
|
+
'^export[[:space:]]+',
|
|
28
|
+
env_file,
|
|
29
|
+
raise_on_non_zero_exit: false
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
unless exported_vars.empty?
|
|
33
|
+
error "Environment file contains variables using 'export':"
|
|
34
|
+
error exported_vars
|
|
35
|
+
error "Please use plain assignments like: FOO=bar"
|
|
36
|
+
raise Capistrano::Error, "Environment variables must not use 'export'"
|
|
37
|
+
end
|
|
38
|
+
else
|
|
39
|
+
error "Environment file not found: #{env_file}"
|
|
40
|
+
raise Capistrano::Error, "Required environment file is missing"
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
if fetch(:log_level) == :debug
|
|
45
|
+
if fetch(:version_manager) == 'mise'
|
|
46
|
+
puts capture(:mise, "version")
|
|
47
|
+
else
|
|
48
|
+
puts capture(:rvm, "version")
|
|
49
|
+
puts capture(:rvm, "current")
|
|
50
|
+
end
|
|
51
|
+
puts capture(:ruby, "--version")
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
task :hook do
|
|
57
|
+
if fetch(:version_manager) == 'mise'
|
|
58
|
+
env = fetch(:default_env, {})
|
|
59
|
+
path = env.fetch(:PATH, '$PATH')
|
|
60
|
+
|
|
61
|
+
SSHKit.config.default_env.merge!(path: "/home/#{fetch(:application)}/.local/bin:$PATH")
|
|
62
|
+
SSHKit.config.default_env.merge!(mise_config_file: "/home/#{fetch(:application)}/#{fetch(:application)}.mise.toml")
|
|
63
|
+
|
|
64
|
+
set :mise_path, "~/.local/bin/mise"
|
|
65
|
+
|
|
66
|
+
SSHKit.config.command_map[:mise] = fetch(:mise_path)
|
|
67
|
+
|
|
68
|
+
mise_prefix = "#{fetch(:mise_path)} exec ruby@#{fetch(:ruby_version)} --"
|
|
69
|
+
fetch(:ruby_map_bins).each do |command|
|
|
70
|
+
SSHKit.config.command_map.prefix[command.to_sym].unshift(mise_prefix)
|
|
71
|
+
end
|
|
72
|
+
else
|
|
73
|
+
on roles(fetch(:ruby_roles, :all)) do
|
|
74
|
+
rvm_path = fetch(:rvm_custom_path)
|
|
75
|
+
rvm_path ||= case fetch(:rvm_type)
|
|
76
|
+
when :auto
|
|
77
|
+
if test("[ -d #{RVM_USER_PATH} ]")
|
|
78
|
+
RVM_USER_PATH
|
|
79
|
+
elsif test("[ -d #{RVM_SYSTEM_PATH} ]")
|
|
80
|
+
RVM_SYSTEM_PATH
|
|
81
|
+
else
|
|
82
|
+
RVM_USER_PATH
|
|
83
|
+
end
|
|
84
|
+
when :system, :mixed
|
|
85
|
+
RVM_SYSTEM_PATH
|
|
86
|
+
else # :user
|
|
87
|
+
RVM_USER_PATH
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
set :rvm_path, rvm_path
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
SSHKit.config.command_map[:rvm] = "#{fetch(:rvm_path)}/bin/rvm"
|
|
94
|
+
|
|
95
|
+
rvm_prefix = "#{fetch(:rvm_path)}/bin/rvm #{fetch(:ruby_version)} do"
|
|
96
|
+
fetch(:ruby_map_bins).each do |command|
|
|
97
|
+
SSHKit.config.command_map.prefix[command.to_sym].unshift(rvm_prefix)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
Capistrano::DSL.stages.each do |stage|
|
|
104
|
+
after stage, 'version_manager:hook'
|
|
105
|
+
after stage, 'version_manager:check'
|
|
106
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: capistrano3_featureset
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Georg Limbach
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2026-
|
|
13
|
+
date: 2026-09-16 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: capistrano
|
|
@@ -40,20 +40,6 @@ dependencies:
|
|
|
40
40
|
- - ">="
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
42
|
version: '0'
|
|
43
|
-
- !ruby/object:Gem::Dependency
|
|
44
|
-
name: capistrano-rvm
|
|
45
|
-
requirement: !ruby/object:Gem::Requirement
|
|
46
|
-
requirements:
|
|
47
|
-
- - ">="
|
|
48
|
-
- !ruby/object:Gem::Version
|
|
49
|
-
version: '0'
|
|
50
|
-
type: :runtime
|
|
51
|
-
prerelease: false
|
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
53
|
-
requirements:
|
|
54
|
-
- - ">="
|
|
55
|
-
- !ruby/object:Gem::Version
|
|
56
|
-
version: '0'
|
|
57
43
|
- !ruby/object:Gem::Dependency
|
|
58
44
|
name: ed25519
|
|
59
45
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -99,6 +85,7 @@ files:
|
|
|
99
85
|
- lib/capistrano3_featureset.rb
|
|
100
86
|
- lib/capistrano3_featureset/default.rb
|
|
101
87
|
- lib/capistrano3_featureset/tasks/featureset.rake
|
|
88
|
+
- lib/capistrano3_featureset/tasks/version_manager.rake
|
|
102
89
|
homepage:
|
|
103
90
|
licenses:
|
|
104
91
|
- MIT
|
|
@@ -118,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
118
105
|
- !ruby/object:Gem::Version
|
|
119
106
|
version: '0'
|
|
120
107
|
requirements: []
|
|
121
|
-
rubygems_version: 3.
|
|
108
|
+
rubygems_version: 3.4.20
|
|
122
109
|
signing_key:
|
|
123
110
|
specification_version: 4
|
|
124
111
|
summary: Capistrano3 feature set
|