negroku 2.5.2 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57cff38323c936dbe0e309fb0541970c33115beb
4
- data.tar.gz: 88290a98bea6dfc96cfc9a2d8439ec1584fe1f11
3
+ metadata.gz: 21f845531d2623a69fc5ce306b30f6761c42269b
4
+ data.tar.gz: 190c9d3e47079723802d351a2039a643ebe1de6f
5
5
  SHA512:
6
- metadata.gz: 0e6f402fd74fc9e7283b92c3a450a9e3242df5737f30fd3caf4154dcdcd5aa0bec015b56f57fd7adc75163c4f8efe2ad0763f28df9fbb4040a5171c9ab559c23
7
- data.tar.gz: 80076fbe6ca33b224d7692804aa50a1d5ce979cc09d7cccd3f7efea61cccbd25c1c1449161e322bd709aa25881dea7786fd68a8f17bcec4601bb3a9fa4bac10f
6
+ metadata.gz: aac81c82ea07f90413d7c100aefeea3720d0b8adc7011a39728623527010a412528ccb1cc8a9135f29543e7b065d9d3f28d890e8f4950d78267dc01a5527ee6a
7
+ data.tar.gz: f0b24510e6ac492c1ee8411256d7cbaef5ac9fc06a00dc5509b2a8a46f84c8c3c098c7321f66abc412182425f9b0b628a2289d899dfd21d73f1846c195313c89
data/CHANGELOG.md CHANGED
@@ -4,7 +4,18 @@ Reverse Chronological Order:
4
4
 
5
5
  ## Unreleased
6
6
 
7
- https://github.com/platanus/negroku/compare/v2.5.2...HEAD
7
+ https://github.com/platanus/negroku/compare/v2.5.3...HEAD
8
+
9
+ ## `2.5.3`
10
+
11
+ https://github.com/platanus/negroku/compare/v2.5.2...v2.5.3
12
+
13
+ FEATURE:
14
+ - On whenever you now can change the log and template values.
15
+
16
+ FIX:
17
+ - Whenever was always being enabled because it's a negroku dependency, now we check for the `config/schedule.rb` file
18
+ - Whenever now honors the rails environment
8
19
 
9
20
  ## `2.5.2`
10
21
 
data/README.md CHANGED
@@ -156,6 +156,7 @@ $ cap staging deploy # to deploy to the staging stage
156
156
  ## Tasks
157
157
 
158
158
  1. [Rails](docs/TASKS.md#rails)
159
+ 1. [Whenever](docs/TASKS.md#whenever)
159
160
 
160
161
  ## Contributing
161
162
 
data/docs/TASKS.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  * [Rails](#rails)
4
4
  * [Remote Console](#remote-console)
5
+ * [Whenever](#whenever)
6
+ * [Config](#config)
5
7
 
6
8
  ### Rails
7
9
 
@@ -15,3 +17,18 @@ cap <stage> rails:console sandbox=1
15
17
  ```
16
18
 
17
19
  [1]: https://github.com/ydkn/capistrano-rails-console
20
+
21
+ ### Whenever
22
+
23
+ **Note:** By default we are not adding any path to the cron execution PATH. It's up the you to add the needed path to the PATH variable in the cron file.
24
+
25
+ ##### Config
26
+ You can change some defaults adding this variables to your `deploy.rb`
27
+
28
+ 1. Template
29
+ default tempalte is `bash -lc ':job'`
30
+
31
+ ```ruby
32
+ set :whenever_template, "bash -lc ':job'" #default
33
+ set :whenever_template, "PATH=./bin:$PATH && bash -lc ':job'" #add location to the path
34
+ ```
@@ -9,11 +9,16 @@ namespace :load do
9
9
  # server roles matches the following list
10
10
  set :whenever_roles, [:app]
11
11
 
12
+ set :whenever_log, -> { "#{shared_path}/log/whenever-out.log" }
13
+
14
+ set :whenever_template, -> { "bash -lc ':job'" }
15
+
12
16
  # Set default jobs and log
13
17
  set :whenever_variables, -> {
14
18
  {
15
- job_template: "bash -lc ':job'",
16
- output: "#{shared_path}/log/whenever-out.log"
19
+ job_template: fetch(:whenever_template),
20
+ output: fetch(:whenever_log),
21
+ environment: fetch(:whenever_environment)
17
22
  }
18
23
  .map{|k,v| "#{k}=#{v}"}.join("&").prepend("\"") << "\""
19
24
  }
@@ -54,7 +54,7 @@ class Negroku::ConfigFactory
54
54
  }
55
55
 
56
56
  attribute :whenever, Negroku::Feature, default: {
57
- name: "whenever", enabled: loaded_in_bundler('whenever')
57
+ name: "whenever", enabled: File.exists?('config/schedule.rb')
58
58
  }
59
59
 
60
60
  # private
@@ -1,3 +1,3 @@
1
1
  module Negroku
2
- VERSION = '2.5.2'
2
+ VERSION = '2.5.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: negroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Ignacio Donoso