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 +4 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/README.md +24 -2
- data/bin/sidekiq-loader +5 -1
- data/lib/sidekiq/redeploy/loader.rb +11 -1
- data/lib/sidekiq/redeploy/version.rb +1 -1
- data/sidekiq-redeploy.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de3104469105eed517e7e6994858454b80e102d10a7dc793b1517552ff7d6a53
|
4
|
+
data.tar.gz: c5264950908153ce688ba6700270163a1ac21a7e91fc88d1e8443a5098704b88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f6ade2223e07932aef74b35ea262cd19635dabb34cf8ab4ad27dc3cf8e49b59184d7196bd087636d4ecb758496a2aaccbcdf85f11700185c1be09e5f6a8fe1
|
7
|
+
data.tar.gz: 05b1f9e28ae95f7e532367a7bf79a314487bc40fd1b70576ae552ce7e5240235cb7fa541a7bc940d8b412e849eeeab7085d261b365b74144dc10617f08a995a6
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
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
|
-
|
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 /
|
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:
|
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
|
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
|
data/sidekiq-redeploy.gemspec
CHANGED
@@ -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.
|
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.
|
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-
|
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.
|
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.
|
26
|
+
version: 0.3.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sidekiq
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|