promotion 1.3.8 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ == Version 1.4.0
2
+ - Added documentation for Newsyslog, and added a Restart attribute.
3
+
1
4
  == Version 1.3.8
2
5
  - Ensured /var/staging is created with mode 0755
3
6
 
data/README CHANGED
@@ -264,6 +264,20 @@ line tool.
264
264
  If using SQLite3, a +Database+ attribute is also needed to specify the file to operate on:
265
265
  <Database database="/var/myapp/data/orders.db">/usr/bin/sqlite3</Database>
266
266
 
267
+ === +Newsyslog+
268
+ Log files can be automatically rotated with +newsyslog+. This element specifies how to
269
+ perform the log rotation:
270
+ <Newsyslog Owner="root" Group="wheel" Mode="0640" Count="5"
271
+ When="M1D1" Zip="false" Binary="true" Restart="myappd">/var/log/myapp.log</Newsyslog>
272
+ In this example, the log file at +/var/log/myapp.log+ will be rotated at 1am on the first
273
+ of each month (newsyslog.conf schedule format $M1D1).
274
+ 5 backup copies will be kept in addition to the original.
275
+ It will not be compressed with bzip and no log rotation message will be inserted (Binary="false").
276
+ The +Restart+ attribute causes a command to be executed after the log file has been rotated:
277
+ /etc/rc.d/myappd restart
278
+ so the application can reopen its log files.
279
+
280
+
267
281
  == Database schema migration
268
282
  Four components are required to automate database schema migration:
269
283
  1. Database migration scripts, stored in the +evolve+ and +devolve+ sub-folders
@@ -22,7 +22,7 @@ module Newsyslog
22
22
  contents << "# It was generated by the promotion application and will be overwritten\n"
23
23
  contents << "# when the next promotion occurs.\n"
24
24
  contents << "# The previous section will be preserved\n\n"
25
- contents << "# Filename Owner:Group Mode Count Size When Flags\n"
25
+ contents << "# Filename Owner:Group Mode Count Size When Flags Command\n"
26
26
  specs.each { |spec|
27
27
  spec.elements.each("/Specification/Newsyslog") { |nsl|
28
28
  contents << "%-40s" % nsl.text()
@@ -49,6 +49,10 @@ module Newsyslog
49
49
  end
50
50
  contents << "Z" if (nsl.attributes["Zip"] || "true") == "true"
51
51
  contents << "B" if (nsl.attributes["Binary"] || "false") == "true"
52
+ restart = nsl.attributes["Restart"] # service to restart
53
+ if restart
54
+ contents << " /etc/rc.d/#{restart} restart "
55
+ end
52
56
  contents << "\n"
53
57
  }
54
58
  }
data/promotion.xsd CHANGED
@@ -268,6 +268,7 @@
268
268
  else treat as @-format if digits with a 'T' -->
269
269
  <xsd:attribute name="Zip" type="xsd:boolean" use="optional" default="true"/>
270
270
  <xsd:attribute name="Binary" type="xsd:boolean" use="optional" default="false"/>
271
+ <xsd:attribute name="Restart" type="xsd:string" use="optional" />
271
272
  </xsd:extension>
272
273
  </xsd:simpleContent>
273
274
  </xsd:complexType>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promotion
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 3
9
- - 8
10
- version: 1.3.8
8
+ - 4
9
+ - 0
10
+ version: 1.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Richard Kernahan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-09-30 00:00:00 Z
18
+ date: 2012-10-01 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: log4r