patches 1.0.1 → 2.0.0

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
  SHA1:
3
- metadata.gz: 8d6c006acf2093859510799d28517de0a2c4241d
4
- data.tar.gz: 9a2b390aae20ec547f7189c1c4be8aae436fde0f
3
+ metadata.gz: 69347a281680b6b89baafd7d31c2ab4f5256f74a
4
+ data.tar.gz: f8896fc3443f64d83ea4c74fbe78aa962a9e58b1
5
5
  SHA512:
6
- metadata.gz: c6f5bf7425e2040b315e35fd4a7a374f987ef6aab58056d61688536b19092d82aa4715f4df2076395355b7d34922c205ccdf58abf998d3e92bc08bbf35715229
7
- data.tar.gz: 9b7b7b37d585bd8e329fc035296483b3aa7e2222f864e858c8b46477e22e742882c0c437338654f65dc2fdb67e3b06c790132eabdfbea2f1cda77e6f350f4dba
6
+ metadata.gz: 7bd2bf0ce3a97d21fcd20acd5c082d4c03234ae75612fdd495b7199f42c081ea977acf0d91ff4b05468b52ed902b4724fa81e417b71ece81cf8f973749cd9335
7
+ data.tar.gz: bd6b3b260c5bb60c9274152d0b7e0a49485f0da5cce5a825846b3bdf54ded029af520bb7457b7f6465e112d207976811ea90b5f28d0876a20575a626b26631ec
data/README.md CHANGED
@@ -3,8 +3,17 @@
3
3
  [![Code Climate](https://codeclimate.com/repos/557f93b76956807f81000001/badges/39d142050017ffeb2564/gpa.svg)](https://codeclimate.com/repos/557f93b76956807f81000001/feed)
4
4
  [![Test Coverage](https://codeclimate.com/repos/557f93b76956807f81000001/badges/39d142050017ffeb2564/coverage.svg)](https://codeclimate.com/repos/557f93b76956807f81000001/coverage)
5
5
 
6
+ ![patches](docs/patches.jpg)
7
+
8
+
6
9
  A simple gem for one off tasks
7
10
 
11
+ ## Version 2.0
12
+
13
+ Please note the breaking change release around deployment. See docs/usage.md for the full change.
14
+
15
+ TL;DR You need to manually declare the patches task to run in your deploy.rb
16
+
8
17
  ## Installation
9
18
 
10
19
  Add this line to your application's Gemfile:
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.1'
8
+ gem 'patches', '~> 2.0.0'
9
9
  ```
10
10
 
11
11
  Install the database migration
@@ -20,6 +20,8 @@ Migrate database
20
20
  bundle exec rake db:migrate
21
21
  ```
22
22
 
23
+ ## Configuration
24
+
23
25
  If you would like to run the patches asynchronously, or would like them to notify your hipchat room when they fail or succeed, you need to set up an initializer to set those options.
24
26
 
25
27
  ```Ruby
@@ -28,9 +30,9 @@ Patches::Config.configure do |config|
28
30
 
29
31
  config.use_hipchat = true
30
32
  config.hipchat_options = {
31
- api_token: HIPCHATAPITOKEN,
32
- room: HIPCHATROOMNAME,
33
- user: HIPCHATUSER #maximum of 15 characters
33
+ api_token: ENV['HIPCHAT_TOKEN'],
34
+ room: ENV['HIPCHAT_ROOM'],
35
+ user: ENV['HIPCHAT_USERNAME'] #maximum of 15 characters
34
36
  }
35
37
  end
36
38
  ```
@@ -62,12 +64,20 @@ bundle exec rake patches:run
62
64
 
63
65
  Patches will only ever run once, patches will run in order of creation date.
64
66
 
65
- To run patches after db:migrate on deployment edit Capfile and add
67
+ To run patches on deployment using Capistrano, edit your Capfile and add
66
68
 
67
69
  ```ruby
68
70
  require 'patches/capistrano'
69
71
  ```
70
72
 
73
+ And then in your deploy.rb
74
+
75
+ ```ruby
76
+ after 'last_task_you_want_to_run' 'patches:run'
77
+ ```
78
+
79
+ If you are using sidekiq and restarting the sidekiq process on the box as a part of the deploy process, please make sure that the patches run task runs after sidekiq restarts, otherwise there is no guarentee the tasks will run.
80
+
71
81
  ## Multitenant
72
82
 
73
83
  Patches will detect if `Apartment` gem is installed and if there are any tenants and run the patches for each tenant
@@ -1,6 +1,6 @@
1
- namespace :deploy do
1
+ namespace :patches do
2
2
  desc 'Runs rake patches:run'
3
- task :patches do
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
@@ -1,3 +1,3 @@
1
1
  module Patches
2
- VERSION = "1.0.1"
2
+ VERSION = "2.0.0"
3
3
  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: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John D'Agostino
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-24 00:00:00.000000000 Z
11
+ date: 2015-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -223,6 +223,7 @@ files:
223
223
  - bin/console
224
224
  - bin/setup
225
225
  - db/migrate/201506011700_create_patch.rb
226
+ - docs/patches.jpg
226
227
  - docs/usage.md
227
228
  - lib/generators/patches.rb
228
229
  - lib/generators/patches/patch_generator.rb