immosquare-capistrano 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare/capistrano/helpers.rb +0 -7
- data/lib/immosquare/capistrano/rvm.rb +5 -0
- data/lib/immosquare/capistrano/tasks/rvm.rake +36 -1
- data/lib/immosquare/capistrano/templates/puma.service.erb +1 -1
- data/lib/immosquare/capistrano/templates/sidekiq.service.erb +1 -1
- data/lib/immosquare/capistrano/templates/solid_queue.service.erb +1 -1
- data/lib/immosquare-capistrano/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1301c09a4f7adc7c81ffa460898f976eec5ad6c19d4c577ccd6dc039c0341d53
|
4
|
+
data.tar.gz: 64ebe76148b314d08b4f388fe0759fcb55dd0e9a9c96a502653fdf16d1802277
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12429a4298672f04bd80c17994a3b684306d894e3bc26731c11779e0e97c954d8d89f717c3a7372bdd1f5666b350a8975e554d859021f65b14c6e2c41ea37e57
|
7
|
+
data.tar.gz: cb5ed273393ac7ce4336f9ef28b3b9d690de60ec522f189d2312a66a2b3d6abfcc66ff67a8181021f83efcddce5e0a73b0cca4cba17718e54651dc22b76fc9a8
|
@@ -1,13 +1,6 @@
|
|
1
1
|
module Capistrano
|
2
2
|
module Immosquare
|
3
3
|
module Helpers
|
4
|
-
##============================================================##
|
5
|
-
## Get the path to bundle command
|
6
|
-
##============================================================##
|
7
|
-
def self.expanded_bundle_command
|
8
|
-
SSHKit.config.command_map[:bundle].to_s
|
9
|
-
end
|
10
|
-
|
11
4
|
def self.template_path(service)
|
12
5
|
"#{File.dirname(__FILE__)}/templates/#{service}.service.erb"
|
13
6
|
end
|
@@ -13,3 +13,8 @@ load File.expand_path("tasks/rvm.rake", __dir__)
|
|
13
13
|
Capistrano::DSL.stages.each do |stage|
|
14
14
|
after stage, "rvm:hook"
|
15
15
|
end
|
16
|
+
|
17
|
+
##============================================================##
|
18
|
+
## Update .ruby-gemset && ruby-version files
|
19
|
+
##============================================================##
|
20
|
+
before "deploy:updated", "rvm:update_rvm_dot_files"
|
@@ -41,7 +41,8 @@ namespace :rvm do
|
|
41
41
|
## Set the RVM prefix for the commands
|
42
42
|
##============================================================##
|
43
43
|
["gem", "rake", "ruby", "bundle"].each do |command|
|
44
|
-
|
44
|
+
cmd = "#{rvm_bin_path} #{rvm_ruby_version} do"
|
45
|
+
SSHKit.config.command_map.prefix[command.to_sym] << cmd if !SSHKit.config.command_map.prefix[command.to_sym].include?(cmd)
|
45
46
|
end
|
46
47
|
|
47
48
|
|
@@ -65,4 +66,38 @@ namespace :rvm do
|
|
65
66
|
end
|
66
67
|
end
|
67
68
|
end
|
69
|
+
|
70
|
+
##============================================================##
|
71
|
+
## Update .ruby-gemset and .ruby-version files with
|
72
|
+
## values from the rvm_ruby_version variable
|
73
|
+
##============================================================##
|
74
|
+
task :update_rvm_dot_files do
|
75
|
+
on roles(:app) do
|
76
|
+
rvm_ruby_version = fetch(:rvm_ruby_version)
|
77
|
+
ruby_version = rvm_ruby_version.split("@").first
|
78
|
+
gemset_name = rvm_ruby_version.split("@").last
|
79
|
+
|
80
|
+
info "Updating .ruby-version file with #{ruby_version}"
|
81
|
+
info "Updating .ruby-gemset file with #{gemset_name}"
|
82
|
+
|
83
|
+
##============================================================##
|
84
|
+
## Mettre à jour les fichiers dans `release_path`
|
85
|
+
## The gem capistrano-bundler launch
|
86
|
+
## bundle config --local deployment true with the release_path
|
87
|
+
##============================================================##
|
88
|
+
within release_path do
|
89
|
+
execute :echo, ruby_version.to_s, ">", ".ruby-version"
|
90
|
+
execute :echo, gemset_name.to_s, ">", ".ruby-gemset"
|
91
|
+
end
|
92
|
+
|
93
|
+
##============================================================##
|
94
|
+
## To have the same version in the current path to lauch
|
95
|
+
## bundle exec commands from the current path
|
96
|
+
##============================================================##
|
97
|
+
within current_path do
|
98
|
+
execute :echo, ruby_version.to_s, ">", ".ruby-version"
|
99
|
+
execute :echo, gemset_name.to_s, ">", ".ruby-gemset"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
68
103
|
end
|
@@ -8,7 +8,7 @@ Type=notify
|
|
8
8
|
WatchdogSec=10
|
9
9
|
User=<%= fetch(:puma_user) %>
|
10
10
|
WorkingDirectory=<%= current_path %>
|
11
|
-
ExecStart=<%= "#{
|
11
|
+
ExecStart=<%= "#{SSHKit.config.command_map[:bundle]} exec puma -e #{fetch(:stage)}" %>
|
12
12
|
ExecReload=/bin/kill -USR1 $MAINPID
|
13
13
|
|
14
14
|
|
@@ -8,7 +8,7 @@ Type=notify
|
|
8
8
|
WatchdogSec=10
|
9
9
|
User=<%= fetch(:sidekiq_user) %>
|
10
10
|
WorkingDirectory=<%= current_path %>
|
11
|
-
ExecStart=<%= "#{
|
11
|
+
ExecStart=<%= "#{SSHKit.config.command_map[:bundle]} exec sidekiq -e #{fetch(:stage)}" %>
|
12
12
|
|
13
13
|
UMask=0002
|
14
14
|
|
@@ -8,7 +8,7 @@ Environment=RAILS_ENV=<%= fetch(:stage) %>
|
|
8
8
|
User=<%= fetch(:solid_queue_user) %>
|
9
9
|
WorkingDirectory=<%= current_path %>
|
10
10
|
|
11
|
-
ExecStart=<%= "#{
|
11
|
+
ExecStart=<%= "#{SSHKit.config.command_map[:bundle]} exec rake solid_queue:start" %>
|
12
12
|
ExecReload=/bin/kill -HUP $MAINPID
|
13
13
|
ExecStop=/bin/kill -TERM $MAINPID
|
14
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: immosquare-capistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- immosquare
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|