patches 1.0.1 → 3.2.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 +33 -0
- data/Dockerfile +9 -0
- data/LICENSE.md +3 -1
- data/README.md +17 -4
- data/bin/console +0 -0
- data/docker-compose.yml +11 -0
- data/docs/patches.jpg +0 -0
- data/docs/usage.md +55 -9
- 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/capistrano/tasks.rake +2 -3
- data/lib/patches/config.rb +31 -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 +2 -2
- data/lib/tasks/patches.rake +1 -1
- data/patches.gemspec +5 -3
- metadata +50 -17
- 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: ee9d2a7ad9476606358ef1f9d07d4357c51257a2553677310191b0969980ef1b
|
4
|
+
data.tar.gz: bd02a484a3814d0a6ef0eb10b9f391e17c6ea0dfbd84ad83ff3bb18aab514e26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 240517aa974013c588bbda1f94dcd387ba4bc4175c8c875cec6a640bc22169ed7e6ef73177d1fc449923f5216c90705fcf1abcad06c7f035ad52aa0e79dcceb9
|
7
|
+
data.tar.gz: bf675bf446a70b10796e4484cdbd69d0e79ef4e1d9c203851fced9b7089a633fedfabbd3ca26c67361fa3acde9da40560c0f8849e80447552f0586f2a4d7c07a
|
@@ -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,33 @@
|
|
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
|
+
## [3.2.0] - 2020-07-16
|
9
|
+
### Added
|
10
|
+
- Added `Patches::Worker` extra parameters to support forward compatibility with the upcoming releases
|
11
|
+
|
12
|
+
## [3.1.0] - 2019-11-25
|
13
|
+
### Fixed
|
14
|
+
- Gem compatibility with Apartment 2
|
15
|
+
|
16
|
+
## [3.0.1] - 2018-11-19
|
17
|
+
### Added
|
18
|
+
- Set icon_emoji of posted slack message to :dog:
|
19
|
+
|
20
|
+
## [3.0.0] - 2018-11-19
|
21
|
+
### Removed
|
22
|
+
- Hipchat is no longer supported
|
23
|
+
|
24
|
+
## [2.4.1] - 2018-09-19
|
25
|
+
### Changed
|
26
|
+
- Corrected gem ownership and authors.
|
27
|
+
### Added
|
28
|
+
- Changelog
|
29
|
+
- Dockerfile and BuildKite pipeline config
|
30
|
+
|
31
|
+
## [2.4.0] - 2018-09-17
|
32
|
+
### Added
|
33
|
+
- 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,10 +1,20 @@
|
|
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)
|
6
|
+
|
7
|
+
![patches](docs/patches.jpg)
|
8
|
+
|
5
9
|
|
6
10
|
A simple gem for one off tasks
|
7
11
|
|
12
|
+
## Version 2.0
|
13
|
+
|
14
|
+
Please note the breaking change release around deployment. See docs/usage.md for the full change.
|
15
|
+
|
16
|
+
TL;DR You need to manually declare the patches task to run in your deploy.rb
|
17
|
+
|
8
18
|
## Installation
|
9
19
|
|
10
20
|
Add this line to your application's Gemfile:
|
@@ -26,9 +36,12 @@ see `docs/usage.md`
|
|
26
36
|
|
27
37
|
## Development
|
28
38
|
|
29
|
-
|
39
|
+
```
|
40
|
+
docker-compose build
|
41
|
+
docker-compose run app bundle exec rspec
|
42
|
+
```
|
30
43
|
|
31
|
-
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).
|
32
45
|
|
33
46
|
## Contributing
|
34
47
|
|
data/bin/console
CHANGED
File without changes
|
data/docker-compose.yml
ADDED
data/docs/patches.jpg
ADDED
Binary file
|
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', '~> 0
|
8
|
+
gem 'patches', '~> 2.4.0'
|
9
9
|
```
|
10
10
|
|
11
11
|
Install the database migration
|
@@ -20,21 +20,40 @@ Migrate database
|
|
20
20
|
bundle exec rake db:migrate
|
21
21
|
```
|
22
22
|
|
23
|
-
|
23
|
+
## Configuration
|
24
|
+
|
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.
|
24
28
|
|
25
29
|
```Ruby
|
26
30
|
Patches::Config.configure do |config|
|
27
31
|
config.use_sidekiq = true
|
28
32
|
|
29
|
-
config.
|
30
|
-
config.
|
31
|
-
|
32
|
-
|
33
|
-
|
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']
|
34
38
|
}
|
35
39
|
end
|
36
40
|
```
|
37
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
|
+
```
|
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
|
+
|
38
57
|
## Creating Patches
|
39
58
|
|
40
59
|
Generate a patch
|
@@ -55,6 +74,12 @@ end
|
|
55
74
|
|
56
75
|
update the run method and then execute
|
57
76
|
|
77
|
+
Generate patch with specs
|
78
|
+
|
79
|
+
```
|
80
|
+
bundle exec rails g patches:patch PreferenceUpdate --specs=true
|
81
|
+
```
|
82
|
+
|
58
83
|
|
59
84
|
```bash
|
60
85
|
bundle exec rake patches:run
|
@@ -62,12 +87,33 @@ bundle exec rake patches:run
|
|
62
87
|
|
63
88
|
Patches will only ever run once, patches will run in order of creation date.
|
64
89
|
|
65
|
-
To run patches
|
90
|
+
To run patches on deployment using Capistrano, edit your Capfile and add
|
66
91
|
|
67
92
|
```ruby
|
68
93
|
require 'patches/capistrano'
|
69
94
|
```
|
70
95
|
|
96
|
+
And then in your deploy.rb
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
after 'last_task_you_want_to_run' 'patches:run'
|
100
|
+
```
|
101
|
+
|
102
|
+
If you are using sidekiq and restarting the sidekiq process on the box
|
103
|
+
as a part of the deploy process, please make sure that the patches run task runs
|
104
|
+
after sidekiq restarts, otherwise there is no guarentee the tasks will run.
|
105
|
+
|
106
|
+
## File Download
|
107
|
+
|
108
|
+
If a patch requires data assets, you could use S3 to store the file.
|
109
|
+
If credentials are defined in env vars, as per https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#id1
|
110
|
+
|
111
|
+
```
|
112
|
+
require 'aws-sdk-s3'
|
113
|
+
Aws::S3::Client.new.get_object(bucket: @bucket_name, key: filename, response_target: destination)
|
114
|
+
```
|
115
|
+
|
71
116
|
## Multitenant
|
72
117
|
|
73
|
-
Patches will detect if `Apartment` gem is installed and if there are any tenants
|
118
|
+
Patches will detect if `Apartment` gem is installed and if there are any tenants
|
119
|
+
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)
|
@@ -1,6 +1,6 @@
|
|
1
|
-
namespace :
|
1
|
+
namespace :patches do
|
2
2
|
desc 'Runs rake patches:run'
|
3
|
-
task :
|
3
|
+
task :run do
|
4
4
|
on primary fetch(:migration_role) do
|
5
5
|
within release_path do
|
6
6
|
with rails_env: fetch(:rails_env) do
|
@@ -9,5 +9,4 @@ namespace :deploy do
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
12
|
-
after 'deploy:migrate', 'deploy:patches'
|
13
12
|
end
|
data/lib/patches/config.rb
CHANGED
@@ -1,19 +1,42 @@
|
|
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 :use_sidekiq, :sidekiq_queue, :sidekiq_options,
|
18
|
+
:sidekiq_parallel, :use_slack, :slack_options
|
19
|
+
|
20
|
+
def initialize
|
21
|
+
@sidekiq_queue = 'default'
|
22
|
+
end
|
23
|
+
|
24
|
+
def sidekiq_options
|
25
|
+
@sidekiq_options ||= { retry: false, queue: sidekiq_queue }
|
26
|
+
end
|
27
|
+
|
28
|
+
def slack_channel
|
29
|
+
slack_options[:channel]
|
30
|
+
end
|
31
|
+
|
32
|
+
def slack_username
|
33
|
+
slack_options[:username]
|
34
|
+
end
|
35
|
+
|
36
|
+
def slack_webhook_url
|
37
|
+
slack_options[:webhook_url]
|
38
|
+
end
|
16
39
|
end
|
17
40
|
end
|
18
41
|
end
|
19
|
-
end
|
42
|
+
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,9 @@ 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)
|
8
|
+
def perform(runner, params = {})
|
9
9
|
runner.constantize.new.perform
|
10
10
|
end
|
11
11
|
end
|
data/lib/tasks/patches.rake
CHANGED
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,6 +20,7 @@ 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"
|
@@ -31,7 +32,8 @@ Gem::Specification.new do |spec|
|
|
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.2.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
|
@@ -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,10 +253,13 @@ files:
|
|
223
253
|
- bin/console
|
224
254
|
- bin/setup
|
225
255
|
- db/migrate/201506011700_create_patch.rb
|
256
|
+
- docker-compose.yml
|
257
|
+
- docs/patches.jpg
|
226
258
|
- docs/usage.md
|
227
259
|
- lib/generators/patches.rb
|
228
260
|
- lib/generators/patches/patch_generator.rb
|
229
261
|
- lib/generators/patches/templates/patch.rb.erb
|
262
|
+
- lib/generators/patches/templates/patch_spec.rb.erb
|
230
263
|
- lib/patches.rb
|
231
264
|
- lib/patches/base.rb
|
232
265
|
- lib/patches/capistrano.rb
|
@@ -237,12 +270,13 @@ files:
|
|
237
270
|
- lib/patches/patch.rb
|
238
271
|
- lib/patches/pending.rb
|
239
272
|
- lib/patches/runner.rb
|
273
|
+
- lib/patches/tenant_run_concern.rb
|
240
274
|
- lib/patches/tenant_runner.rb
|
275
|
+
- lib/patches/tenant_worker.rb
|
241
276
|
- lib/patches/version.rb
|
242
277
|
- lib/patches/worker.rb
|
243
278
|
- lib/tasks/patches.rake
|
244
279
|
- patches.gemspec
|
245
|
-
- script/buildkite.sh
|
246
280
|
homepage: http://github.com/jobready/patches
|
247
281
|
licenses:
|
248
282
|
- MIT
|
@@ -262,8 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
296
|
- !ruby/object:Gem::Version
|
263
297
|
version: '0'
|
264
298
|
requirements: []
|
265
|
-
|
266
|
-
rubygems_version: 2.4.8
|
299
|
+
rubygems_version: 3.0.3
|
267
300
|
signing_key:
|
268
301
|
specification_version: 4
|
269
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
|