immosquare-capistrano 0.1.3 → 0.1.5

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: b97273522c9313b14c8ac334a70a02d033ca7d3bba295655b0b5b698c52fb61b
4
- data.tar.gz: 485e5c3a9f057beb3cbb2551b74dec55f9d447473e16cbcd1051cb6d2998c43c
3
+ metadata.gz: eebe27d1ff19f881f868149c9fe82c829815358786271ee294f30a99ed16d9ed
4
+ data.tar.gz: a9c4a37203792db7eddb7e58e82f0cec4925e32c79b501c6513a6953d0c2844e
5
5
  SHA512:
6
- metadata.gz: bafb9c999eb8d605f427901e8500ddade290e79b0690319f2420968b585180ee3966fd2b8a5282175d693db0c66e48e7742ed54389eacc6e006e57c5ea290502
7
- data.tar.gz: f54c8eb6c7a09857a518815b661542b5a3e2829a25eb68dcb09b4f48ab9ac88db904a3e22d26a7e9229fb743880df7db27cb23811cd0b78aab2da3466eaba080
6
+ metadata.gz: 64db57958d1e4efd8871e001e555c8162bbb46906e6ee62f69d9c678d4fd20ec9ad1bff9abe6207c8c2e38054b300c0843f7108088dc8d77c8627bf907234bcf
7
+ data.tar.gz: 17736935e39783fd634cad578b0290c767dbf02b565ca803b1208ec74db75cfe1a4b244ca27c810c988f30d2e3b503a5a3410be4e356ab682ae060fac51e905d
@@ -1,7 +1,24 @@
1
1
  namespace :load do
2
2
  task :defaults do
3
+ ##============================================================##
4
+ ## Puma
5
+ ##============================================================##
3
6
  set_if_empty :puma_service_unit_name, -> { "puma_#{fetch(:application)}_#{fetch(:stage)}" }
7
+
8
+ ##============================================================##
9
+ ## Sidekiq
10
+ ##============================================================##
4
11
  set_if_empty :sidekiq_service_unit_name, -> { "sidekiq_#{fetch(:application)}_#{fetch(:stage)}" }
12
+
13
+ ##============================================================##
14
+ ## SolidQueue
15
+ ##============================================================##
5
16
  set_if_empty :solid_queue_service_unit_name, -> { "solid_queue_#{fetch(:application)}_#{fetch(:stage)}" }
17
+
18
+ ##============================================================##
19
+ ## rvm
20
+ ##============================================================##
21
+ set_if_empty :rvm_ruby_version, -> { "default" }
22
+ set_if_empty :rvm_map_bins, -> { ["gem", "rake", "ruby", "bundle"] }
6
23
  end
7
24
  end
@@ -0,0 +1,10 @@
1
+
2
+ ##============================================================##
3
+ ## We load github tasks
4
+ ##============================================================##
5
+ load File.expand_path("tasks/github.rake", __dir__)
6
+
7
+ ##============================================================##
8
+ ## Setup github hooks.
9
+ ##============================================================##
10
+ before "deploy:starting", "github:setup"
@@ -1,7 +1,12 @@
1
1
  require_relative "defaults"
2
2
  require_relative "helpers"
3
3
 
4
+ ##============================================================##
5
+ ## We load puma tasks
6
+ ##============================================================##
4
7
  load File.expand_path("tasks/puma.rake", __dir__)
5
8
 
6
- # puma hooks
9
+ ##============================================================##
10
+ ## puma hooks
11
+ ##============================================================##
7
12
  after "deploy:finished", "puma:smart_restart"
@@ -0,0 +1,17 @@
1
+ require_relative "defaults"
2
+
3
+
4
+ ##============================================================##
5
+ ## We load rvm tasks
6
+ ##============================================================##
7
+ load File.expand_path("tasks/rvm.rake", __dir__)
8
+
9
+ ##============================================================##
10
+ ## cap stage xxx
11
+ ## Exemple : cap production deploy
12
+ ## we launch task just after the stage is loaded
13
+ ##============================================================##
14
+ Capistrano::DSL.stages.each do |stage|
15
+ after stage, "rvm:hook"
16
+ # after stage, "rvm:check"
17
+ end
@@ -1,9 +1,14 @@
1
1
  require_relative "defaults"
2
2
  require_relative "helpers"
3
3
 
4
+ ##============================================================##
5
+ ## We load sidekiq tasks
6
+ ##============================================================##
4
7
  load File.expand_path("tasks/sidekiq.rake", __dir__)
5
8
 
6
- # Sidekiq hooks
9
+ ##============================================================##
10
+ ## Sidekiq hooks
11
+ ##============================================================##
7
12
  after "deploy:starting", "sidekiq:stop"
8
13
  after "deploy:published", "sidekiq:start"
9
14
  after "deploy:failed", "sidekiq:restart"
@@ -1,9 +1,15 @@
1
1
  require_relative "defaults"
2
2
  require_relative "helpers"
3
3
 
4
+ ##============================================================##
5
+ ## We load solid_queue tasks
6
+ ##============================================================##
4
7
  load File.expand_path("tasks/solid_queue.rake", __dir__)
5
8
 
6
- # SolidQueue hooks
9
+
10
+ ##============================================================##
11
+ ## SolidQueue hooks
12
+ ##============================================================##
7
13
  after "deploy:starting", "solid_queue:stop"
8
14
  after "deploy:published", "solid_queue:start"
9
15
  after "deploy:failed", "solid_queue:restart"
@@ -0,0 +1,43 @@
1
+ namespace :github do
2
+ desc "Configure Bundler with GitHub Packages credentials"
3
+ task :setup do
4
+ on roles(:app) do
5
+ ##============================================================##
6
+ ## Fetch the GitHub Package username and PAT
7
+ ##============================================================##
8
+ github_package_username = fetch(:github_package_username)
9
+ github_package_personal_access_token = fetch(:github_package_personal_access_token)
10
+
11
+ ##============================================================##
12
+ ## Check if the GitHub username is set
13
+ ##============================================================##
14
+ if github_package_username.nil?
15
+ error "GitHub Package username is not set. Please set the :github_package_username"
16
+ exit 1
17
+ end
18
+
19
+ ##============================================================##
20
+ ## Check if the Personal Access Token is set
21
+ ##============================================================##
22
+ if github_package_personal_access_token.nil?
23
+ error "GitHub Personal Access Token (PAT) is not set. Please set the :github_package_personal_access_token"
24
+ exit 1
25
+ end
26
+
27
+ ##============================================================##
28
+ ## Provide some feedback before setting the credentials
29
+ ##============================================================##
30
+ info "Setting Bundler credentials for GitHub Packages..."
31
+
32
+ ##============================================================##
33
+ ## Set the GitHub Package credentials with Bundler
34
+ ##============================================================##
35
+ execute :bundle, "config set --global rubygems.pkg.github.com #{github_package_username}:#{github_package_personal_access_token}"
36
+
37
+ ##============================================================##
38
+ ## Confirm that the credentials were set successfully
39
+ ##============================================================##
40
+ info "GitHub Packages credentials successfully set for Bundler."
41
+ end
42
+ end
43
+ end
@@ -1,4 +1,3 @@
1
-
2
1
  namespace :puma do
3
2
  ##============================================================##
4
3
  ## Install puma service
@@ -0,0 +1,38 @@
1
+ namespace :rvm do
2
+ task :hook do
3
+ on roles(:app) do
4
+ rvm_system_path = "/usr/local/rvm"
5
+ rvm_user_path = "~/.rvm"
6
+
7
+ ##============================================================##
8
+ ## Check if the RVM Ruby version is set
9
+ ##============================================================##
10
+ rvm_path =
11
+ if test("[ -d #{rvm_user_path} ]")
12
+ rvm_user_path
13
+ elsif test("[ -d #{rvm_system_path} ]")
14
+ rvm_system_path
15
+ else
16
+ raise("RVM path not found on server. Please install RVM first")
17
+ end
18
+
19
+ ##============================================================##
20
+ ## Log
21
+ ##============================================================##
22
+ info "RVM path detected: #{rvm_path}"
23
+
24
+
25
+ ##============================================================##
26
+ ## Set the RVM command map
27
+ ##============================================================##
28
+ SSHKit.config.command_map[:rvm] = "#{rvm_path}/bin/rvm"
29
+
30
+ ##============================================================##
31
+ ## Set the RVM prefix for the commands
32
+ ##============================================================##
33
+ fetch(:rvm_map_bins).each do |command|
34
+ SSHKit.config.command_map.prefix[command.to_sym].unshift("#{rvm_path}/bin/rvm #{fetch(:rvm_ruby_version)} do")
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,4 +1,3 @@
1
-
2
1
  namespace :sidekiq do
3
2
  ##============================================================##
4
3
  ## Install Sidekiq service
@@ -1,4 +1,3 @@
1
-
2
1
  namespace :solid_queue do
3
2
  ##============================================================##
4
3
  ## Install SolidQueue service
@@ -1,3 +1,3 @@
1
1
  module ImmosquareCapistrano
2
- VERSION = "0.1.3".freeze
2
+ VERSION = "0.1.5".freeze
3
3
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-capistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
- - IMMO SQUARE
7
+ - immosquare
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-07 00:00:00.000000000 Z
11
+ date: 2024-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '100.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '3.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '100.0'
27
33
  description: Puma, Sidekiq & SolidQueue services integrations for Capistrano
28
34
  email:
29
35
  - jules@immosquare.com
@@ -34,17 +40,21 @@ files:
34
40
  - lib/immosquare-capistrano.rb
35
41
  - lib/immosquare-capistrano/version.rb
36
42
  - lib/immosquare/capistrano/defaults.rb
43
+ - lib/immosquare/capistrano/github.rb
37
44
  - lib/immosquare/capistrano/helpers.rb
38
45
  - lib/immosquare/capistrano/puma.rb
46
+ - lib/immosquare/capistrano/rvm.rb
39
47
  - lib/immosquare/capistrano/sidekiq.rb
40
48
  - lib/immosquare/capistrano/solid_queue.rb
49
+ - lib/immosquare/capistrano/tasks/github.rake
41
50
  - lib/immosquare/capistrano/tasks/puma.rake
51
+ - lib/immosquare/capistrano/tasks/rvm.rake
42
52
  - lib/immosquare/capistrano/tasks/sidekiq.rake
43
53
  - lib/immosquare/capistrano/tasks/solid_queue.rake
44
54
  - lib/immosquare/capistrano/templates/puma.service.erb
45
55
  - lib/immosquare/capistrano/templates/sidekiq.service.erb
46
56
  - lib/immosquare/capistrano/templates/solid_queue.service.erb
47
- homepage: https://github.com/IMMOSQUARE/immosquare-capistrano
57
+ homepage: https://github.com/immosquare/immosquare-capistrano
48
58
  licenses:
49
59
  - MIT
50
60
  metadata: {}
@@ -63,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
73
  - !ruby/object:Gem::Version
64
74
  version: '0'
65
75
  requirements: []
66
- rubygems_version: 3.5.9
76
+ rubygems_version: 3.5.22
67
77
  signing_key:
68
78
  specification_version: 4
69
79
  summary: Puma, Sidekiq & SolidQueue services integrations for Capistrano