immosquare-capistrano 0.1.2 → 0.1.4

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: d63f243f98fe9e7c78dbaa6907959df6ca0c8021cf35cda1f35de86743cbeb7b
4
- data.tar.gz: 47f3e09254bb0aa1327bc23d9a24a01dbbc51276b1dd5ad15a7ee4478239a333
3
+ metadata.gz: b1a1672e30f736df5c030d606c1c843c367e9ffcb62b581f030094d2c4e056cd
4
+ data.tar.gz: dc00134b0a50e52d4e1006eec5f37053da00e862210ff825d8625e12c742f6c8
5
5
  SHA512:
6
- metadata.gz: 376f46c4d8596c3d8844ad55f81bf987786610a7bb71ea1cfbebae15071ff8d644a1a4767616ba6c79f61af02a666c9ac471d9519a6c845bbba604c490c5c460
7
- data.tar.gz: e0f29fa182a215f634a10a9148148e3434d7978850e4e61adf862686acbca79aee852d080108bfcd95ae4fd76385386b1ba5ce46a481b87758d1a63e747ce275
6
+ metadata.gz: 88d068a453e2ce53fac31833e3b7573740e7db3b37c343685f4444be99b3d76a2dc102f35e0c056a7f013b2ff12b6fb9c501128ba58fc147c1bd01035786330a
7
+ data.tar.gz: 96d53f6b2a619a697bcca06d76ab4d5eaee6ca8aa6c3aae42c6f94bba4ebbcd13439c6a4a8f8b0d01e4a5a1cc0d61d0943bbcb1f32ba999cd176551a2ad3cdb3
@@ -0,0 +1,7 @@
1
+ require_relative "defaults"
2
+ require_relative "helpers"
3
+
4
+ load File.expand_path("tasks/github.rake", __dir__)
5
+
6
+ # github hooks
7
+ before "deploy:starting", "github:setup"
@@ -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
@@ -1,4 +1,3 @@
1
-
2
1
  namespace :sidekiq do
3
2
  ##============================================================##
4
3
  ## Install Sidekiq service
@@ -22,7 +21,7 @@ namespace :sidekiq do
22
21
  sudo "mv #{result_path} /etc/systemd/system/#{service_name}"
23
22
 
24
23
  ##============================================================##
25
- ## Reload the systemd daemon and quiet the service
24
+ ## Reload the systemd daemon and enable the service
26
25
  ##============================================================##
27
26
  sudo "systemctl daemon-reload"
28
27
  sudo "systemctl enable #{service_name}"
@@ -1,4 +1,3 @@
1
-
2
1
  namespace :solid_queue do
3
2
  ##============================================================##
4
3
  ## Install SolidQueue service
@@ -8,7 +8,7 @@ Type=notify
8
8
  WatchdogSec=10
9
9
  User=<%= fetch(:puma_user) %>
10
10
  WorkingDirectory=<%= current_path %>
11
- ExecStart=<%= "#{Capistrano::Immosquare::Helpers.expanded_bundle_command} exec puma -e #{fetch(:stage)}" %>
11
+ ExecStart=<%= "#{Capistrano::Immosquare::Helpers.expanded_bundle_command.gsub("~", "/home/#{fetch(:puma_user)}")} 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=<%= "#{Capistrano::Immosquare::Helpers.expanded_bundle_command} exec sidekiq -e #{fetch(:stage)}" %>
11
+ ExecStart=<%= "#{Capistrano::Immosquare::Helpers.expanded_bundle_command.gsub("~", "/home/#{fetch(:sidekiq_user)}")} 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=<%= Capistrano::Immosquare::Helpers.expanded_bundle_command %> exec rake solid_queue:start
11
+ ExecStart=<%= "#{Capistrano::Immosquare::Helpers.expanded_bundle_command.gsub("~", "/home/#{fetch(:solid_queue_user)}")} exec rake solid_queue:start" %>
12
12
  ExecReload=/bin/kill -HUP $MAINPID
13
13
  ExecStop=/bin/kill -TERM $MAINPID
14
14
 
@@ -1,3 +1,3 @@
1
1
  module ImmosquareCapistrano
2
- VERSION = "0.1.2".freeze
2
+ VERSION = "0.1.4".freeze
3
3
  end
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.2
4
+ version: 0.1.4
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-04-18 00:00:00.000000000 Z
11
+ date: 2024-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -34,17 +34,19 @@ files:
34
34
  - lib/immosquare-capistrano.rb
35
35
  - lib/immosquare-capistrano/version.rb
36
36
  - lib/immosquare/capistrano/defaults.rb
37
+ - lib/immosquare/capistrano/github.rb
37
38
  - lib/immosquare/capistrano/helpers.rb
38
39
  - lib/immosquare/capistrano/puma.rb
39
40
  - lib/immosquare/capistrano/sidekiq.rb
40
41
  - lib/immosquare/capistrano/solid_queue.rb
42
+ - lib/immosquare/capistrano/tasks/github.rake
41
43
  - lib/immosquare/capistrano/tasks/puma.rake
42
44
  - lib/immosquare/capistrano/tasks/sidekiq.rake
43
45
  - lib/immosquare/capistrano/tasks/solid_queue.rake
44
46
  - lib/immosquare/capistrano/templates/puma.service.erb
45
47
  - lib/immosquare/capistrano/templates/sidekiq.service.erb
46
48
  - lib/immosquare/capistrano/templates/solid_queue.service.erb
47
- homepage: https://github.com/IMMOSQUARE/immosquare-capistrano
49
+ homepage: https://github.com/immosquare/immosquare-capistrano
48
50
  licenses:
49
51
  - MIT
50
52
  metadata: {}
@@ -63,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
65
  - !ruby/object:Gem::Version
64
66
  version: '0'
65
67
  requirements: []
66
- rubygems_version: 3.5.7
68
+ rubygems_version: 3.5.21
67
69
  signing_key:
68
70
  specification_version: 4
69
71
  summary: Puma, Sidekiq & SolidQueue services integrations for Capistrano