sidekiq-redeploy 0.1.9 → 0.1.10

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: 8b4a9ea82326d3303e7b62977a3a124415b5b763ad3ab12e952fff7464794910
4
- data.tar.gz: 9b876740e30131c3c6c4c3da743d04cb5922e616af690b1ad6561bb716e2e973
3
+ metadata.gz: de3104469105eed517e7e6994858454b80e102d10a7dc793b1517552ff7d6a53
4
+ data.tar.gz: c5264950908153ce688ba6700270163a1ac21a7e91fc88d1e8443a5098704b88
5
5
  SHA512:
6
- metadata.gz: 28ac5b4d9853c1538e1db4a98144280d2814d3a3799a3e3e0297db54b470e2cc13b9c721e7d0cf0c8a37cc23b764581fa6206e524eb973b5b3633934b7aff4c1
7
- data.tar.gz: a7699606e5abba66b5d2ef82b11317de3ece6042234ab45d1491b61ab8e2ceec1fcfa7c9d71a79c6242405fe773b21e0b16b73e46c221a465b65ace4c296589d
6
+ metadata.gz: a6f6ade2223e07932aef74b35ea262cd19635dabb34cf8ab4ad27dc3cf8e49b59184d7196bd087636d4ecb758496a2aaccbcdf85f11700185c1be09e5f6a8fe1
7
+ data.tar.gz: 05b1f9e28ae95f7e532367a7bf79a314487bc40fd1b70576ae552ce7e5240235cb7fa541a7bc940d8b412e849eeeab7085d261b365b74144dc10617f08a995a6
data/.rubocop.yml CHANGED
@@ -22,7 +22,7 @@ Metrics/ClassLength:
22
22
  Max: 140
23
23
 
24
24
  Metrics/AbcSize:
25
- Max: 20
25
+ Max: 30
26
26
 
27
27
  RSpec/NestedGroups:
28
28
  Max: 4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v0.1.10
2
+
3
+ **Fixes and enhancements:**
4
+
5
+ - Add support to run commands prior to redeploy using a yaml watch file. This is useful for running a migration or bundle gems.
6
+
1
7
  ## v0.1.9
2
8
 
3
9
  **Fixes and enhancements:**
data/README.md CHANGED
@@ -43,9 +43,31 @@ Usage: sidekiq-loader [options]
43
43
  -n, --num-procs INTEGER [Optional] Specify the number of sidekiq processes to create. Defaults to 1.
44
44
  ```
45
45
 
46
- For example this will start the launcher using a S3 watch file.
46
+ The watch file can contain an optional list of commands to run and the required archive_location. The archive_location can be a file path or S3 URL
47
+ For example when using a file:
48
+ ```yaml
49
+ ---
50
+ commands:
51
+ - bundle
52
+ archive_location: /app/pkg/test_app_0.0.3.zip
53
+ ```
54
+
55
+ For example when using S3:
56
+ ```yaml
57
+ ---
58
+ commands:
59
+ - bundle
60
+ archive_location: s3://puma-test-app-archives/test_app_0.0.3.zip
61
+ ```
62
+
63
+ For example this will start the launcher using a S3 yaml watch file.
64
+ ```shell
65
+ bundle exec sidekiq-loader -a /app -w s3://puma-test-app-archives/watch.yml
66
+ ```
67
+
68
+ For example this will start the launcher using a local yaml watch file.
47
69
  ```shell
48
- bundle exec sidekiq-loader -a /app -w s3://puma-test-app-archives/watch.me
70
+ bundle exec sidekiq-loader -a ./ -s ./lib/sidekiq_server.rb -w build/pkg/watch.yml
49
71
  ```
50
72
 
51
73
  In the example above the `watch.me` contents would look like the following. In this case the `test_app_0.0.3.zip` must exist in the `puma-test-app-archives` S3 bucket.
data/bin/sidekiq-loader CHANGED
@@ -9,8 +9,12 @@ require 'optparse'
9
9
  def run_sidekiq(ops, logger)
10
10
  deployer = Puma::Redeploy::DeployerFactory.create(target: ops[:app_dir], watch_file: ops[:watch], logger:)
11
11
 
12
+ watch_file_data = deployer.watch_file_data
13
+
14
+ archive_file = deployer.archive_file(watch_file_data[:archive_location])
15
+
12
16
  # Load app archive on launch
13
- deployer.deploy(source: deployer.archive_file) if ops[:deploy]
17
+ deployer.deploy(source: archive_file) if ops[:deploy]
14
18
  config = { watch_delay: ops[:watch_delay] }
15
19
 
16
20
  Sidekiq::Redeploy::Loader.new(deployer:, logger:, sidekiq_app: ops[:sidekiq_app], config:,
@@ -60,7 +60,17 @@ module Sidekiq
60
60
  loop do
61
61
  sleep(loop_delay)
62
62
  if needs_redeploy?
63
- reload_app { deployer.deploy(source: deployer.archive_file) }
63
+ reload_app do
64
+ watch_file_data = deployer.watch_file_data
65
+
66
+ archive_file = deployer.archive_file(watch_file_data[:archive_location])
67
+
68
+ logger.info "Sidekiq restart begin file=#{deployer.watch_file} archive=#{archive_file}"
69
+
70
+ Puma::Redeploy::CommandRunner.new(commands: watch_file_data[:commands], logger:).run
71
+
72
+ deployer.deploy(source: archive_file)
73
+ end
64
74
  elsif reload_sidekiq
65
75
  reload_app
66
76
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Redeploy
5
- VERSION = '0.1.9'
5
+ VERSION = '0.1.10'
6
6
  end
7
7
  end
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.bindir = 'bin'
33
33
  spec.require_paths = ['lib']
34
34
 
35
- spec.add_dependency 'puma-redeploy', '~> 0.3.3'
35
+ spec.add_dependency 'puma-redeploy', '~> 0.3.4'
36
36
  spec.add_dependency 'sidekiq', '>= 6', '< 8'
37
37
 
38
38
  spec.metadata['rubygems_mfa_required'] = 'true'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-redeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - tbeauvais
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-13 00:00:00.000000000 Z
11
+ date: 2024-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma-redeploy
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.3
19
+ version: 0.3.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.3
26
+ version: 0.3.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sidekiq
29
29
  requirement: !ruby/object:Gem::Requirement