promotion 1.4.2 → 1.4.3

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.3
2
+ - Added Subversion element to allow for auto-deployment of working copies.
3
+
1
4
  == Version 1.4.2
2
5
  - Fixed d/evolve scripts to use configured Staging folder
3
6
 
@@ -34,6 +34,8 @@ module Files
34
34
  Crontab = "/usr/bin/crontab"
35
35
  # path to zip executable
36
36
  Zip = "/usr/local/bin/zip -q "
37
+ # path to subversion (svn) executable
38
+ Svn = "/usr/local/bin/svn "
37
39
  end
38
40
 
39
41
  # A section of the configuration file that contains ERB template filenames
@@ -114,6 +114,11 @@ class Enforcer
114
114
  source = file.attributes["Source"] || file.parent.attributes["Source"] || DEFAULT_FILE_SOURCE
115
115
  ensure_allfiles(path, owner, group, mode, source)
116
116
  }
117
+ @spec.elements.each("/Specification/Subversion") { |svn|
118
+ folder = svn.elements["Folder"].text
119
+ url = svn.elements["Url"].text
120
+ svn_check_out(url, folder)
121
+ }
117
122
  @spec.elements.each("/Specification/Zipfile") { |zipfile|
118
123
  build_zip_file(zipfile)
119
124
  }
@@ -285,6 +290,21 @@ class Enforcer
285
290
  exit 1
286
291
  end
287
292
  end
293
+
294
+ # Check out a repository path to the specified folder
295
+ # or update it if it is already installed
296
+ def svn_check_out(url, folder)
297
+ begin
298
+ if system("#{::Files::Svn} info #{folder}") # already exists
299
+ system("#{::Files::Svn} up --force #{folder}")
300
+ else
301
+ system("#{::Files::Svn} co --force #{url} #{folder}")
302
+ end
303
+ rescue => e
304
+ $log.error("Unable to deploy #{url} into #{folder}\n#{e.message}\n#{e.backtrace}")
305
+ exit 1
306
+ end
307
+ end
288
308
 
289
309
  # Creates a zip archive from the specified files
290
310
  def build_zip_file(zipfile)
data/promotion.xsd CHANGED
@@ -14,6 +14,7 @@
14
14
  <xsd:element ref="Folders" minOccurs="0" maxOccurs="unbounded" />
15
15
  <xsd:element ref="Files" minOccurs="0" maxOccurs="unbounded" />
16
16
  <xsd:element ref="Allfiles" minOccurs="0" maxOccurs="unbounded" />
17
+ <xsd:element ref="Subversion" minOccurs="0" maxOccurs="unbounded" />
17
18
  <xsd:element ref="Zipfile" minOccurs="0" maxOccurs="unbounded" />
18
19
  <xsd:element ref="Sudoers" minOccurs="0" maxOccurs="1" />
19
20
  <xsd:element ref="Daemon" minOccurs="0" maxOccurs="unbounded" />
@@ -107,6 +108,15 @@
107
108
  </xsd:complexType>
108
109
  </xsd:element>
109
110
 
111
+ <xsd:element name="Subversion">
112
+ <xsd:complexType>
113
+ <xsd:sequence>
114
+ <xsd:element ref="Folder" minOccurs="1" maxOccurs="1" />
115
+ <xsd:element name="Url" type="xsd:anyURI" minOccurs="1" maxOccurs="1" />
116
+ </xsd:sequence>
117
+ </xsd:complexType>
118
+ </xsd:element>
119
+
110
120
  <xsd:element name="File">
111
121
  <xsd:complexType>
112
122
  <xsd:simpleContent>
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: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 2
10
- version: 1.4.2
9
+ - 3
10
+ version: 1.4.3
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-11-04 00:00:00 Z
18
+ date: 2013-01-08 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: log4r