patches 2.0.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.buildkite/pipeline.yml +24 -0
- data/.gitignore +1 -0
- data/.rspec +1 -1
- data/CHANGELOG.md +38 -0
- data/Dockerfile +9 -0
- data/LICENSE.md +3 -1
- data/README.md +8 -4
- data/bin/console +0 -0
- data/docker-compose.yml +11 -0
- data/docs/usage.md +63 -10
- data/lib/generators/patches/patch_generator.rb +3 -0
- data/lib/generators/patches/templates/patch_spec.rb.erb +8 -0
- data/lib/patches.rb +3 -1
- data/lib/patches/config.rb +42 -8
- data/lib/patches/notifier.rb +26 -8
- data/lib/patches/tenant_run_concern.rb +9 -0
- data/lib/patches/tenant_runner.rb +12 -8
- data/lib/patches/tenant_worker.rb +12 -0
- data/lib/patches/version.rb +4 -1
- data/lib/patches/worker.rb +15 -3
- data/lib/tasks/patches.rake +5 -2
- data/patches.gemspec +6 -4
- metadata +51 -19
- data/.travis.yml +0 -3
- data/script/buildkite.sh +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 31f20fe803ffb8762b4ebdbdacb5b33564d67eaa24505ffb8fdd25fc88a6198c
|
4
|
+
data.tar.gz: c7fbbb497911d30dd73555a77f8ea946788de6b43110df7afcf6e680f9a349a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b2674ce8e4f2deb2f856e67c32d381bf4007729fad286179b89c0c982c8991b58072c59de133485ea7d9a40071df36778198037569a496a60fa25f4371ce6e1
|
7
|
+
data.tar.gz: 5fee7f04b02862424097a26e51fe6ad376e885637e67aa90f3986942457494900646426a393f3b1a8946fc3fbb748a8bed89619a9cd7e28a2278151a0eefbc34
|
@@ -0,0 +1,24 @@
|
|
1
|
+
steps:
|
2
|
+
- label: ':hammer: Tests'
|
3
|
+
plugins:
|
4
|
+
docker-compose:
|
5
|
+
run: app
|
6
|
+
command: 'bundle exec rspec'
|
7
|
+
agents:
|
8
|
+
queue: docker-heavy
|
9
|
+
artifact_paths: 'coverage/.resultset.json'
|
10
|
+
|
11
|
+
- wait
|
12
|
+
|
13
|
+
- command: "Report CodeClimate Coverage"
|
14
|
+
label: ":codeclimate: Report coverage"
|
15
|
+
plugins:
|
16
|
+
jobready/codeclimate-test-reporter#v2.0:
|
17
|
+
prefix: /app
|
18
|
+
artifact: "coverage/.resultset*.json"
|
19
|
+
input_type: simplecov
|
20
|
+
parts: 1
|
21
|
+
env:
|
22
|
+
CC_TEST_REPORTER_ID:
|
23
|
+
agents:
|
24
|
+
queue: docker-heavy
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
## [3.3.0] - 2020-07-20
|
10
|
+
### Added
|
11
|
+
- Application version constraints
|
12
|
+
|
13
|
+
## [3.2.0] - 2020-07-16
|
14
|
+
### Added
|
15
|
+
- Added `Patches::Worker` extra parameters to support forward compatibility with the upcoming releases
|
16
|
+
|
17
|
+
## [3.1.0] - 2019-11-25
|
18
|
+
### Fixed
|
19
|
+
- Gem compatibility with Apartment 2
|
20
|
+
|
21
|
+
## [3.0.1] - 2018-11-19
|
22
|
+
### Added
|
23
|
+
- Set icon_emoji of posted slack message to :dog:
|
24
|
+
|
25
|
+
## [3.0.0] - 2018-11-19
|
26
|
+
### Removed
|
27
|
+
- Hipchat is no longer supported
|
28
|
+
|
29
|
+
## [2.4.1] - 2018-09-19
|
30
|
+
### Changed
|
31
|
+
- Corrected gem ownership and authors.
|
32
|
+
### Added
|
33
|
+
- Changelog
|
34
|
+
- Dockerfile and BuildKite pipeline config
|
35
|
+
|
36
|
+
## [2.4.0] - 2018-09-17
|
37
|
+
### Added
|
38
|
+
- Added slack notification configurability
|
data/Dockerfile
ADDED
data/LICENSE.md
CHANGED
@@ -16,4 +16,6 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
16
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
17
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
18
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
THE SOFTWARE.
|
19
|
+
THE SOFTWARE.
|
20
|
+
|
21
|
+
https://opensource.org/licenses/MIT
|
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# Patches
|
2
2
|
[![Build status](https://badge.buildkite.com/4f3df3f3458bcc933dc44cab6c136af5c3bbdd9f761f1a99ff.svg)](https://buildkite.com/jobready/patches)
|
3
|
-
[![
|
4
|
-
[![Test Coverage](https://codeclimate.com/
|
3
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/39d142050017ffeb2564/maintainability)](https://codeclimate.com/repos/557f93b76956807f81000001/maintainability)
|
4
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/39d142050017ffeb2564/test_coverage)](https://codeclimate.com/repos/557f93b76956807f81000001/test_coverage)
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/patches.svg)](https://badge.fury.io/rb/patches)
|
5
6
|
|
6
7
|
![patches](docs/patches.jpg)
|
7
8
|
|
@@ -35,9 +36,12 @@ see `docs/usage.md`
|
|
35
36
|
|
36
37
|
## Development
|
37
38
|
|
38
|
-
|
39
|
+
```
|
40
|
+
docker-compose build
|
41
|
+
docker-compose run app bundle exec rspec
|
42
|
+
```
|
39
43
|
|
40
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
44
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org/gems/patches).
|
41
45
|
|
42
46
|
## Contributing
|
43
47
|
|
data/bin/console
CHANGED
File without changes
|
data/docker-compose.yml
ADDED
data/docs/usage.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
Add patches to the project Gemfile
|
6
6
|
|
7
7
|
```ruby
|
8
|
-
gem 'patches', '~> 2.
|
8
|
+
gem 'patches', '~> 2.4.0'
|
9
9
|
```
|
10
10
|
|
11
11
|
Install the database migration
|
@@ -22,21 +22,55 @@ bundle exec rake db:migrate
|
|
22
22
|
|
23
23
|
## Configuration
|
24
24
|
|
25
|
-
If you would like to run the patches asynchronously, or would like them to notify
|
25
|
+
If you would like to run the patches asynchronously, or would like them to notify
|
26
|
+
your Slack channel when they fail or succeed, you need to set up
|
27
|
+
an initializer to set those options.
|
26
28
|
|
27
|
-
```
|
29
|
+
```ruby
|
28
30
|
Patches::Config.configure do |config|
|
29
31
|
config.use_sidekiq = true
|
30
32
|
|
31
|
-
config.
|
32
|
-
config.
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
config.use_slack = true
|
34
|
+
config.slack_options = {
|
35
|
+
webhook_url: ENV['SLACK_WEBHOOK_URL'],
|
36
|
+
channel: ENV['SLACK_CHANNEL'],
|
37
|
+
username: ENV['SLACK_USER']
|
36
38
|
}
|
37
39
|
end
|
38
40
|
```
|
39
41
|
|
42
|
+
### Running patches in parallel for tenants
|
43
|
+
|
44
|
+
If you are using the Apartment gem, you can run the patches for each tenant in parallel.
|
45
|
+
Just set the config ```sidekiq_parallel``` to ```true``` and you're good to go.
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
Patches::Config.configure do |config|
|
49
|
+
config.use_sidekiq = true
|
50
|
+
config.sidekiq_parallel = true
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
*Note:* Make sure your sidekiq queue is able to process concurrent jobs.
|
55
|
+
You can use ```config.sidekiq_options``` to customise it.
|
56
|
+
|
57
|
+
### Application version verification
|
58
|
+
|
59
|
+
In environments where a rolling update of sidekiq workers is performed during the deployment, multiple versions of the application run at the same time. If a Patches job is scheduled by the new application version during the rolling update, there is a possibility that it can be executed by the old application version, which will not have all the required patch files.
|
60
|
+
|
61
|
+
To prevent this case, set the application version in the config:
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
Patches::Config.configure do |config|
|
65
|
+
revision_file_path = Rails.root.join('REVISION')
|
66
|
+
|
67
|
+
if File.exist?(revision_file_path)
|
68
|
+
config.application_version = File.read(revision_file_path)
|
69
|
+
config.retry_after_version_mismatch_in = 1.minute
|
70
|
+
end
|
71
|
+
end
|
72
|
+
```
|
73
|
+
|
40
74
|
## Creating Patches
|
41
75
|
|
42
76
|
Generate a patch
|
@@ -57,6 +91,12 @@ end
|
|
57
91
|
|
58
92
|
update the run method and then execute
|
59
93
|
|
94
|
+
Generate patch with specs
|
95
|
+
|
96
|
+
```bash
|
97
|
+
bundle exec rails g patches:patch PreferenceUpdate --specs=true
|
98
|
+
```
|
99
|
+
|
60
100
|
|
61
101
|
```bash
|
62
102
|
bundle exec rake patches:run
|
@@ -76,8 +116,21 @@ And then in your deploy.rb
|
|
76
116
|
after 'last_task_you_want_to_run' 'patches:run'
|
77
117
|
```
|
78
118
|
|
79
|
-
If you are using sidekiq and restarting the sidekiq process on the box
|
119
|
+
If you are using sidekiq and restarting the sidekiq process on the box
|
120
|
+
as a part of the deploy process, please make sure that the patches run task runs
|
121
|
+
after sidekiq restarts, otherwise there is no guarentee the tasks will run.
|
122
|
+
|
123
|
+
## File Download
|
124
|
+
|
125
|
+
If a patch requires data assets, you could use S3 to store the file.
|
126
|
+
If credentials are defined in env vars, as per https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#id1
|
127
|
+
|
128
|
+
```ruby
|
129
|
+
require 'aws-sdk-s3'
|
130
|
+
Aws::S3::Client.new.get_object(bucket: @bucket_name, key: filename, response_target: destination)
|
131
|
+
```
|
80
132
|
|
81
133
|
## Multitenant
|
82
134
|
|
83
|
-
Patches will detect if `Apartment` gem is installed and if there are any tenants
|
135
|
+
Patches will detect if `Apartment` gem is installed and if there are any tenants
|
136
|
+
and run the patches for each tenant
|
@@ -4,8 +4,11 @@ module Patches
|
|
4
4
|
desc 'Adds an empty patch'
|
5
5
|
source_root File.expand_path('../templates', __FILE__)
|
6
6
|
|
7
|
+
class_option :specs, type: :boolean, default: false, description: 'Generates a rspec file for the patch'
|
8
|
+
|
7
9
|
def generate_patch
|
8
10
|
template "patch.rb.erb", "db/patches/#{file_name}.rb"
|
11
|
+
template "patch_spec.rb.erb", "spec/patches/#{file_name}_spec.rb" if options['specs']
|
9
12
|
end
|
10
13
|
|
11
14
|
private
|
data/lib/patches.rb
CHANGED
@@ -20,11 +20,13 @@ module Patches
|
|
20
20
|
end
|
21
21
|
|
22
22
|
require "patches/base"
|
23
|
+
require "patches/config"
|
24
|
+
require "patches/tenant_run_concern"
|
25
|
+
require "patches/tenant_worker" if defined?(Sidekiq)
|
23
26
|
require "patches/engine" if defined?(Rails)
|
24
27
|
require "patches/patch"
|
25
28
|
require "patches/pending"
|
26
29
|
require "patches/runner"
|
27
30
|
require "patches/tenant_runner"
|
28
|
-
require "patches/config"
|
29
31
|
require "patches/notifier"
|
30
32
|
require "patches/worker" if defined?(Sidekiq)
|
data/lib/patches/config.rb
CHANGED
@@ -1,19 +1,53 @@
|
|
1
1
|
module Patches
|
2
2
|
class Config
|
3
3
|
class << self
|
4
|
-
|
5
|
-
|
6
|
-
def sidekiq_queue
|
7
|
-
@sidekiq_queue ||= 'default'
|
4
|
+
def configuration
|
5
|
+
@configuration ||= Configuration.new
|
8
6
|
end
|
9
7
|
|
10
|
-
def
|
11
|
-
@
|
8
|
+
def configuration=(config)
|
9
|
+
@configuration = config
|
12
10
|
end
|
13
11
|
|
14
12
|
def configure
|
15
|
-
yield
|
13
|
+
yield configuration
|
14
|
+
end
|
15
|
+
|
16
|
+
class Configuration
|
17
|
+
attr_accessor \
|
18
|
+
:application_version,
|
19
|
+
:retry_after_version_mismatch_in,
|
20
|
+
:sidekiq_options,
|
21
|
+
:sidekiq_parallel,
|
22
|
+
:sidekiq_queue,
|
23
|
+
:slack_options,
|
24
|
+
:use_sidekiq,
|
25
|
+
:use_slack
|
26
|
+
|
27
|
+
def initialize
|
28
|
+
@sidekiq_queue = 'default'
|
29
|
+
end
|
30
|
+
|
31
|
+
def sidekiq_options
|
32
|
+
@sidekiq_options ||= { retry: false, queue: sidekiq_queue }
|
33
|
+
end
|
34
|
+
|
35
|
+
def retry_after_version_mismatch_in
|
36
|
+
@retry_after_version_mismatch_in ||= 1.minute
|
37
|
+
end
|
38
|
+
|
39
|
+
def slack_channel
|
40
|
+
slack_options[:channel]
|
41
|
+
end
|
42
|
+
|
43
|
+
def slack_username
|
44
|
+
slack_options[:username]
|
45
|
+
end
|
46
|
+
|
47
|
+
def slack_webhook_url
|
48
|
+
slack_options[:webhook_url]
|
49
|
+
end
|
16
50
|
end
|
17
51
|
end
|
18
52
|
end
|
19
|
-
end
|
53
|
+
end
|
data/lib/patches/notifier.rb
CHANGED
@@ -1,34 +1,52 @@
|
|
1
|
+
require 'slack-notifier'
|
2
|
+
|
1
3
|
class Patches::Notifier
|
2
4
|
class << self
|
3
5
|
def notify_success(patches)
|
4
|
-
|
6
|
+
send_slack_message(success_message(patches), 'good')
|
5
7
|
end
|
6
8
|
|
7
9
|
def notify_failure(patch_path, error)
|
8
|
-
|
10
|
+
send_slack_message(failure_message(patch_path, error), 'danger')
|
9
11
|
end
|
10
12
|
|
11
13
|
def success_message(patches)
|
12
|
-
message = "#{patches.count} patches succeeded"
|
14
|
+
message = "#{environment_prefix}#{patches.count} patches succeeded"
|
13
15
|
append_tenant_message(message)
|
14
16
|
end
|
15
17
|
|
16
18
|
def failure_message(patch_path, error)
|
17
|
-
|
19
|
+
details = "#{Pathname.new(patch_path).basename} failed with error: #{error}"
|
20
|
+
message = "#{environment_prefix}Error applying patch: #{details}"
|
18
21
|
append_tenant_message(message)
|
19
22
|
end
|
20
23
|
|
24
|
+
def environment_prefix
|
25
|
+
"[#{Rails.env.upcase}] " if defined?(Rails)
|
26
|
+
end
|
27
|
+
|
21
28
|
def append_tenant_message(message)
|
22
29
|
message = message + " for tenant: #{Apartment::Tenant.current}" if defined?(Apartment)
|
23
30
|
message
|
24
31
|
end
|
25
32
|
|
33
|
+
def send_slack_message(message, color)
|
34
|
+
return unless defined?(Slack) && config.use_slack
|
35
|
+
|
36
|
+
notifier = Slack::Notifier.new(
|
37
|
+
config.slack_webhook_url,
|
38
|
+
channel: config.slack_channel,
|
39
|
+
username: config.slack_username)
|
40
|
+
|
41
|
+
payload = { icon_emoji: ":dog:", attachments: [{ color: color, text: message }] }
|
42
|
+
|
43
|
+
notifier.post payload
|
44
|
+
end
|
45
|
+
|
26
46
|
private
|
27
47
|
|
28
|
-
def
|
29
|
-
|
30
|
-
HipChat::Client.new(Patches::Config.hipchat_options[:api_token])[Patches::Config.hipchat_options[:room]].send(Patches::Config.hipchat_options[:user], message, options)
|
31
|
-
end
|
48
|
+
def config
|
49
|
+
Patches::Config.configuration
|
32
50
|
end
|
33
51
|
end
|
34
52
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
class Patches::TenantRunner
|
2
|
+
include Patches::TenantRunConcern
|
2
3
|
attr_accessor :path
|
3
4
|
|
4
5
|
def initialize(path: nil, tenants: nil)
|
@@ -8,19 +9,22 @@ class Patches::TenantRunner
|
|
8
9
|
|
9
10
|
def perform
|
10
11
|
Patches.logger.info("Patches tenant runner for: #{tenants.join(',')}")
|
11
|
-
|
12
12
|
tenants.each do |tenant|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
if parallel?
|
14
|
+
Patches::TenantWorker.perform_async(tenant, path)
|
15
|
+
else
|
16
|
+
run(tenant, path)
|
17
|
+
end
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
19
|
-
def build
|
20
|
-
Patches::Runner.new(path)
|
21
|
-
end
|
22
|
-
|
23
21
|
def tenants
|
24
22
|
@tenants ||= (Apartment.tenant_names || [])
|
25
23
|
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def parallel?
|
28
|
+
Patches::Config.configuration.sidekiq_parallel
|
29
|
+
end
|
26
30
|
end
|
data/lib/patches/version.rb
CHANGED
data/lib/patches/worker.rb
CHANGED
@@ -3,9 +3,21 @@ require 'sidekiq'
|
|
3
3
|
class Patches::Worker
|
4
4
|
include Sidekiq::Worker
|
5
5
|
|
6
|
-
sidekiq_options Patches::Config.sidekiq_options
|
6
|
+
sidekiq_options Patches::Config.configuration.sidekiq_options
|
7
7
|
|
8
|
-
def perform(runner)
|
9
|
-
|
8
|
+
def perform(runner, params = {})
|
9
|
+
if valid_application_version?(params)
|
10
|
+
runner.constantize.new.perform
|
11
|
+
else
|
12
|
+
self.class.perform_in(Patches::Config.configuration.retry_after_version_mismatch_in, runner, params)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def valid_application_version?(params)
|
19
|
+
return true unless params['application_version']
|
20
|
+
return true unless Patches::Config.configuration.application_version
|
21
|
+
Patches::Config.configuration.application_version == params['application_version']
|
10
22
|
end
|
11
23
|
end
|
data/lib/tasks/patches.rake
CHANGED
@@ -7,8 +7,11 @@ namespace :patches do
|
|
7
7
|
runner = Patches::Runner
|
8
8
|
end
|
9
9
|
|
10
|
-
if defined?(Sidekiq) && Patches::Config.use_sidekiq
|
11
|
-
Patches::Worker.perform_async(
|
10
|
+
if defined?(Sidekiq) && Patches::Config.configuration.use_sidekiq
|
11
|
+
Patches::Worker.perform_async(
|
12
|
+
runner,
|
13
|
+
application_version: Patches::Config.configuration.application_version
|
14
|
+
)
|
12
15
|
else
|
13
16
|
runner.new.perform
|
14
17
|
end
|
data/patches.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'patches/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "patches"
|
8
8
|
spec.version = Patches::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["JobReady"]
|
10
|
+
spec.email = ["ruby_gems@jobready.com.au"]
|
11
11
|
|
12
12
|
spec.licenses = ['MIT']
|
13
13
|
spec.summary = %q{A simple gem for one off tasks}
|
@@ -20,18 +20,20 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_dependency "railties", ">= 3.2"
|
23
|
+
spec.add_dependency "slack-notifier"
|
23
24
|
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.8"
|
25
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
27
|
spec.add_development_dependency "sqlite3", "~> 1.3.5"
|
27
|
-
spec.add_development_dependency "rspec-rails", "~>
|
28
|
+
spec.add_development_dependency "rspec-rails", "~> 4.0.0"
|
28
29
|
spec.add_development_dependency "capybara", "~> 2.3.0"
|
29
30
|
spec.add_development_dependency "generator_spec", "~> 0.9.0"
|
30
31
|
spec.add_development_dependency "simplecov", "~> 0.10"
|
31
32
|
spec.add_development_dependency "factory_girl", "~> 4.5.0"
|
32
33
|
spec.add_development_dependency "timecop", "~> 0.7.0"
|
33
34
|
spec.add_development_dependency "database_cleaner", "~> 1.3.0"
|
34
|
-
spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
|
35
35
|
spec.add_development_dependency "pry"
|
36
36
|
spec.add_development_dependency "sidekiq", "~> 3.4.1"
|
37
|
+
spec.add_development_dependency "webmock"
|
38
|
+
spec.add_development_dependency "byebug"
|
37
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patches
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- JobReady
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: slack-notifier
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +86,14 @@ dependencies:
|
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
89
|
+
version: 4.0.0
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
96
|
+
version: 4.0.0
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: capybara
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,21 +179,35 @@ dependencies:
|
|
165
179
|
- !ruby/object:Gem::Version
|
166
180
|
version: 1.3.0
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
182
|
+
name: pry
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: sidekiq
|
169
197
|
requirement: !ruby/object:Gem::Requirement
|
170
198
|
requirements:
|
171
199
|
- - "~>"
|
172
200
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
201
|
+
version: 3.4.1
|
174
202
|
type: :development
|
175
203
|
prerelease: false
|
176
204
|
version_requirements: !ruby/object:Gem::Requirement
|
177
205
|
requirements:
|
178
206
|
- - "~>"
|
179
207
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
208
|
+
version: 3.4.1
|
181
209
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
210
|
+
name: webmock
|
183
211
|
requirement: !ruby/object:Gem::Requirement
|
184
212
|
requirements:
|
185
213
|
- - ">="
|
@@ -193,29 +221,31 @@ dependencies:
|
|
193
221
|
- !ruby/object:Gem::Version
|
194
222
|
version: '0'
|
195
223
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
224
|
+
name: byebug
|
197
225
|
requirement: !ruby/object:Gem::Requirement
|
198
226
|
requirements:
|
199
|
-
- - "
|
227
|
+
- - ">="
|
200
228
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
229
|
+
version: '0'
|
202
230
|
type: :development
|
203
231
|
prerelease: false
|
204
232
|
version_requirements: !ruby/object:Gem::Requirement
|
205
233
|
requirements:
|
206
|
-
- - "
|
234
|
+
- - ">="
|
207
235
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
236
|
+
version: '0'
|
209
237
|
description: A simple gem for one off tasks for example database patches
|
210
238
|
email:
|
211
|
-
-
|
239
|
+
- ruby_gems@jobready.com.au
|
212
240
|
executables: []
|
213
241
|
extensions: []
|
214
242
|
extra_rdoc_files: []
|
215
243
|
files:
|
244
|
+
- ".buildkite/pipeline.yml"
|
216
245
|
- ".gitignore"
|
217
246
|
- ".rspec"
|
218
|
-
-
|
247
|
+
- CHANGELOG.md
|
248
|
+
- Dockerfile
|
219
249
|
- Gemfile
|
220
250
|
- LICENSE.md
|
221
251
|
- README.md
|
@@ -223,11 +253,13 @@ files:
|
|
223
253
|
- bin/console
|
224
254
|
- bin/setup
|
225
255
|
- db/migrate/201506011700_create_patch.rb
|
256
|
+
- docker-compose.yml
|
226
257
|
- docs/patches.jpg
|
227
258
|
- docs/usage.md
|
228
259
|
- lib/generators/patches.rb
|
229
260
|
- lib/generators/patches/patch_generator.rb
|
230
261
|
- lib/generators/patches/templates/patch.rb.erb
|
262
|
+
- lib/generators/patches/templates/patch_spec.rb.erb
|
231
263
|
- lib/patches.rb
|
232
264
|
- lib/patches/base.rb
|
233
265
|
- lib/patches/capistrano.rb
|
@@ -238,12 +270,13 @@ files:
|
|
238
270
|
- lib/patches/patch.rb
|
239
271
|
- lib/patches/pending.rb
|
240
272
|
- lib/patches/runner.rb
|
273
|
+
- lib/patches/tenant_run_concern.rb
|
241
274
|
- lib/patches/tenant_runner.rb
|
275
|
+
- lib/patches/tenant_worker.rb
|
242
276
|
- lib/patches/version.rb
|
243
277
|
- lib/patches/worker.rb
|
244
278
|
- lib/tasks/patches.rake
|
245
279
|
- patches.gemspec
|
246
|
-
- script/buildkite.sh
|
247
280
|
homepage: http://github.com/jobready/patches
|
248
281
|
licenses:
|
249
282
|
- MIT
|
@@ -263,8 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
296
|
- !ruby/object:Gem::Version
|
264
297
|
version: '0'
|
265
298
|
requirements: []
|
266
|
-
|
267
|
-
rubygems_version: 2.4.8
|
299
|
+
rubygems_version: 3.0.3
|
268
300
|
signing_key:
|
269
301
|
specification_version: 4
|
270
302
|
summary: A simple gem for one off tasks
|
data/.travis.yml
DELETED
data/script/buildkite.sh
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
set -e
|
3
|
-
|
4
|
-
echo '--- setting ruby version'
|
5
|
-
rbenv local 2.1.5
|
6
|
-
|
7
|
-
echo '--- setting up env'
|
8
|
-
REVISION=https://github.com/$BUILDBOX_PROJECT_SLUG/commit/$BUILDBOX_COMMIT
|
9
|
-
|
10
|
-
echo '--- bundling'
|
11
|
-
bundle install -j $(nproc) --without production --quiet
|
12
|
-
|
13
|
-
echo '--- running specs'
|
14
|
-
if bundle exec rspec; then
|
15
|
-
echo "[Successful] $BUILDBOX_PROJECT_SLUG - Build - $BUILDBOX_BUILD_URL - Commit - $REVISION" | hipchat_room_message -t $HIPCHAT_TOKEN -r $HIPCHAT_ROOM -f "Buildbox" -c "green"
|
16
|
-
else
|
17
|
-
echo "[Failed] Build $BUILDBOX_PROJECT_SLUG - Build - $BUILDBOX_BUILD_URL - Commit - $REVISION" | hipchat_room_message -t $HIPCHAT_TOKEN -r $HIPCHAT_ROOM -f "Buildbox" -c "red"
|
18
|
-
exit 1;
|
19
|
-
fi
|