sidekiq-redeploy 0.1.9 → 0.2.0
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 +12 -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: 4846529f831b6909a77f634fc6d2a6d609f27b76dc246d9bd9b86f672c845473
|
4
|
+
data.tar.gz: 1c6be4dd5ab63bad179a79dc78f2f35b30d0217541dbc8b6ba1628b7b2666530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b654d56b304df4e9ac06de82eab2a0e6d520117723eedb3963bc78264a29a70e61a0e905dc0bb9de4802c83590fd93dfb23159c9bb7d139fa10d1ea37c0adda
|
7
|
+
data.tar.gz: bde4d63c634473677361bea5ccc8d61765caedea3366fd35b99fc89d889a816e7d68c4eea38e04e6c31677015a648117f733c557eb80c8285d4fc126575b7719
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# v0.2.0
|
2
|
+
|
3
|
+
**Fixes and enhancements:**
|
4
|
+
|
5
|
+
- Fix the order when running commands to run after unzip archive. Also bump to 0.2.0
|
6
|
+
|
7
|
+
## v0.1.10
|
8
|
+
|
9
|
+
**Fixes and enhancements:**
|
10
|
+
|
11
|
+
- Add support to run commands prior to redeploy using a yaml watch file. This is useful for running a migration or bundle gems.
|
12
|
+
|
1
13
|
## v0.1.9
|
2
14
|
|
3
15
|
**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
|
-
|
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
|
+
deployer.deploy(source: archive_file)
|
71
|
+
|
72
|
+
Puma::Redeploy::CommandRunner.new(commands: watch_file_data[:commands], logger:).run
|
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.
|
35
|
+
spec.add_dependency 'puma-redeploy', '~> 0.4.0'
|
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.
|
4
|
+
version: 0.2.0
|
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-10 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.
|
19
|
+
version: 0.4.0
|
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.
|
26
|
+
version: 0.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sidekiq
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|