promotion 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -0,0 +1,3 @@
1
+ Version 1.0.8
2
+ Added extension to install executables: promote, evolve, devolve.
3
+ Added mkdeploy executable to create a template deployment descriptor.
data/README CHANGED
@@ -68,17 +68,8 @@ to suit your system's paths.
68
68
 
69
69
  DO NOT USE ON A PRODUCTION SYSTEM without rigorous testing in a virtual machine first.
70
70
 
71
- Create the staging area (and set permissions appropriately):
72
-
73
- $ sudo mkdir /var/staging
74
-
75
- Check out the promotion app into staging, and bootstrap promotion
76
- $ sudo wget http://rubyforge.org/frs/download.php/76463/promotion-x.y.z.zip
77
- $ sudo unzip promotion-x.y.z.zip -d promotion # creates the promotion sub-directory
78
- $ cd promotion
79
- $ sudo ruby bin/bootstrap
80
- Promoting promotion...OK.
81
- $ cd /var/staging
71
+ Installing promotion automatically creates the /var/staging directory
72
+ $ sudo gem install promotion
82
73
  Now you are ready to use Promotion to deploy other applications.
83
74
 
84
75
  == Usage
@@ -106,6 +97,17 @@ If you want to revert to an earlier version of the database schema:
106
97
  which will execute the schema migration scripts in the +devolve+ folder,
107
98
  in reverse order from 1023 down to 1017.
108
99
 
100
+ To make it easier to create a deployment descriptor, use the +mkdeploy+ command:
101
+ $ cd /var/staging
102
+ $ mkdir myapp
103
+ $ cd myapp
104
+ $ mkdeploy
105
+ Deployment descriptor template written to deploy.xml.
106
+
107
+ If you already have a deploy.xml file, +mkdeploy+ will *not* overwrite it:
108
+ $ mkdeploy
109
+ deploy.xml already exists in the current directory. Exiting.
110
+
109
111
  == Deployment descriptor syntax
110
112
  The deployment descriptor is typically named <code>deploy.xml</code> and placed at the top
111
113
  of the application's staging folder (eg. <code>/var/staging/myapp</code>).
data/bin/mkdeploy ADDED
@@ -0,0 +1,54 @@
1
+ #!/usr/local/bin/ruby
2
+
3
+ if File.exists?("deploy.xml")
4
+ puts("deploy.xml already exists in the current directory. Exiting.")
5
+ exit 1
6
+ end
7
+
8
+ template =<<-EOT
9
+ <?xml version="1.0" encoding="UTF-8" ?>
10
+ <Specification Name="myapp" Title="My Test App"
11
+ xmlns="http://finalstep.com.au/promotion/v100"
12
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13
+ xsi:schemaLocation="http://finalstep.com.au/schema/promotion.v100.xsd ../promotion/promotion.xsd">
14
+ <Description></Description>
15
+ <Groups>
16
+ <Group Gid="502" Name="_mysql" />
17
+ </Groups>
18
+ <Users>
19
+ <User Name="richard" Class="staff" Gecos="Richard Kernahan" Uid="1002" Gid="1002"
20
+ Home="/home/richard" Shell="/bin/ksh" Groups="wheel webadmin"/>
21
+ <User Name="_mysql" Class="daemon" Gecos="MySQL Account" Uid="502"Gid="502"
22
+ Home="/nonexistent" Shell="/sbin/nologin" />
23
+ </Users>
24
+ <Folders Mode="0750" Owner="root" Group="wheel">
25
+ <Folder Owner="_mysql" Group="_mysql">/var/mysql</Folder>
26
+ <Folder>/home/myapp</Folder>
27
+ <Folder>/var/myapp</Folder>
28
+ </Folders>
29
+ <Files Owner="root" Group="wheel" Mode="0644" Source="conf">
30
+ <File>/etc/my.cnf</File>
31
+ <File>/etc/myapp.conf</File>
32
+ </Files>
33
+ <Files Owner="root" Group="wheel" Mode="0750" Source="sbin">
34
+ <File>/usr/local/sbin/up!</File>
35
+ <File>/usr/local/sbin/down!</File>
36
+ <File>/usr/local/sbin/push!</File>
37
+ </Files>
38
+ <Allfiles Group="bin" Mode="0644" Owner="root" Source="conf">/var/axonsec/conf</Allfiles>
39
+ <Daemon Flags="" Priority="10" User="_myapp" />
40
+ <Crontab>
41
+ <Schedule User="root" Hour="2" Minute="7"
42
+ Comment="Backup the entire database at 2:07am each morning">
43
+ <Command><![CDATA[/usr/local/sbin/myappbak]]></Command>
44
+ </Schedule>
45
+ </Crontab>
46
+ <Database>/usr/local/bin/mysql</Database>
47
+ </Specification>
48
+ EOT
49
+
50
+ deploy = File.new("deploy.xml", "w")
51
+ deploy.puts(template)
52
+ deploy.close()
53
+
54
+ puts("Deployment descriptor template written to deploy.xml.")
data/bin/promote CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/local/bin/ruby -I/usr/local/
1
+ #!/usr/local/bin/ruby
2
2
  # This script starts the promotion application
3
3
 
4
4
  #______________________
@@ -13,6 +13,8 @@ install :
13
13
  install -m 0750 -o root -g wheel #{source}/promote #{target}/sbin
14
14
  install -m 0750 -o root -g wheel #{source}/evolve #{target}/sbin
15
15
  install -m 0750 -o root -g wheel #{source}/devolve #{target}/sbin
16
+ install -m 0750 -o root -g wheel #{source}/mkdeploy #{target}/sbin
17
+ install -m 0750 -o root -g wheel -d /var/staging
16
18
  EOT
17
19
  makefile = File.new("Makefile", "w")
18
20
  makefile.puts(makeContents)
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: 25
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 7
10
- version: 1.0.7
9
+ - 8
10
+ version: 1.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Richard Kernahan
@@ -31,7 +31,7 @@ description: "\t\tThe Promotion tool is designed to make it easy and quick to de
31
31
  \t\tPromotion handles all of this based on an XML deployment descriptor for each application,\n\
32
32
  \t\tallowing rapid, reliable redeployment with a single line command. It also manages database\n\
33
33
  \t\tschema migration.\n"
34
- email: rec.dev@finalstep.com.au
34
+ email: dev.promotion@finalstep.com.au
35
35
  executables: []
36
36
 
37
37
  extensions:
@@ -42,6 +42,7 @@ files:
42
42
  - bin/promote
43
43
  - bin/evolve
44
44
  - bin/devolve
45
+ - bin/mkdeploy
45
46
  - ext/promotion/extconf.rb
46
47
  - lib/promotion.rb
47
48
  - lib/promotion/application.rb
@@ -58,11 +59,10 @@ files:
58
59
  - promotion.xsd
59
60
  - CHANGELOG
60
61
  - README
61
- - VERSION
62
62
  homepage: http://rubygems.org/gems/promotion
63
63
  licenses: []
64
64
 
65
- post_install_message: "\n Executables have been installed in /usr/local/sbin:\n * promote\n * evolve\n * devolve\n "
65
+ post_install_message: "\n Executables have been installed in /usr/local/sbin:\n promote\n evolve\n devolve\n mkdeploy\n "
66
66
  rdoc_options: []
67
67
 
68
68
  require_paths:
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.7