luban 0.9.7 → 0.9.8

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: 05c563073b69ea371e1a9c159be4566c5d7161b4
4
- data.tar.gz: 6c236d456d1294ea1442dc122fe72e6944acc516
3
+ metadata.gz: f7f56432034ca3f37b4bdb2e9984223083f21843
4
+ data.tar.gz: 91057327dff28e84d3e13353dc917022ce53659f
5
5
  SHA512:
6
- metadata.gz: 1639d72e4af369143739948fa6be33ed4042aa59615c25beea4ce17c5456379e44a8b1f5872e2902df6547e834130c01afe8690fd4c36e8dc9f203950ea465c9
7
- data.tar.gz: 00bfdfa1dfe994b53c9f8845b14535d7c71a0eff24ad2def96fe2a4739e81664501021e435c4d1a6093b920a7bed9599677af9cfd2547e1e3882a626ff331105
6
+ metadata.gz: 5e5b7eaec61be97da7fe826ab300c800f091b7a1168a94b077919325c3132b8d491b2559d8e80dc6cc6db88898f1d9a11ea69b8987d9083c8ce7c12bc423a58e
7
+ data.tar.gz: 3baa07d7e53473c598c7b0072c7eaa78444b1191e52745702bf4356f3d84baa56630c6484bb0f3d554be0439269f798bb31c1d2d01569cfc1696b128042ed0e1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.9.8 (Oct 19, 2016)
4
+
5
+ New features:
6
+ * Added new parameters, #logrotate_max_age, #logrotate_interval and #logrotate_count for log rotation control
7
+ * Refactored these out from logrotate config to make change easier & cleaner
8
+ * Respected the environment variable, #LUBAN_LOGROTATE_INTERVAL, to receive the default value
9
+ * Updated crontab logrotate configuration to utilize the new parameters
10
+ * Bump up gem dependency of luban-cli to 0.4.8
11
+
3
12
  ## Version 0.9.7 (Oct 19, 2016)
4
13
 
5
14
  Bug fixes:
@@ -117,9 +117,14 @@ module Luban
117
117
  module Application
118
118
  extend Base
119
119
 
120
+ DefaultLogrotateMaxAge = 7 # days
121
+ DefaultLogrotateInterval = 10 # mins
122
+
120
123
  parameter :application
121
124
  parameter :scm_role
122
125
  parameter :archive_role
126
+ parameter :logrotate_max_age
127
+ parameter :logrotate_interval
123
128
 
124
129
  def env_name
125
130
  @env_name ||= "#{stage}.#{project}/#{application}"
@@ -133,11 +138,18 @@ module Luban
133
138
  monitor_defined? and !monitor_itself?
134
139
  end
135
140
 
141
+ def logrotate_count
142
+ logrotate_max_age * 24 * (60 / logrotate_interval)
143
+ end
144
+
136
145
  protected
137
146
 
138
147
  def set_default_application_parameters
139
148
  set_default :scm_role, :scm
140
149
  set_default :archive_role, :archive
150
+ set_default :logrotate_max_age, DefaultLogrotateMaxAge
151
+ set_default :logrotate_interval,
152
+ (ENV['LUBAN_LOGROTATE_INTERVAL'] || DefaultLogrotateInterval).to_i
141
153
  setup_default_application_config_finder
142
154
  end
143
155
 
@@ -3,8 +3,8 @@
3
3
  <%%= log_path.join('cron.*.log') %> {
4
4
  hourly
5
5
  maxsize 5M
6
- maxage 14
7
- rotate <%%= 14 * 24 * (60 / 10) %>
6
+ maxage <%= logrotate_max_age %>
7
+ rotate <%= logrotate_count %>
8
8
  missingok
9
9
  compress
10
10
  compresscmd <%%= `which gzip`.chomp %>
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.9.7"
3
+ VERSION = "0.9.8"
4
4
  end
5
5
  end
data/luban.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.required_ruby_version = ">= 2.1.0"
23
- spec.add_runtime_dependency 'luban-cli', ">=0.4.6"
23
+ spec.add_runtime_dependency 'luban-cli', ">=0.4.8"
24
24
  spec.add_runtime_dependency 'sshkit'
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.9"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Lei
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.6
19
+ version: 0.4.8
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.4.6
26
+ version: 0.4.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sshkit
29
29
  requirement: !ruby/object:Gem::Requirement