ec2launcher 1.0.30 → 1.0.31

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.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.0.31
2
+
3
+ * Added support for pre/post commands to applications. Useful for installing webapps.
4
+
1
5
  ## 1.0.30
2
6
 
3
7
  * Fixed bug with EBS volume mount locations.
@@ -47,6 +47,8 @@ module EC2Launcher
47
47
 
48
48
  dsl_array_accessor :gems
49
49
  dsl_array_accessor :packages
50
+ dsl_array_accessor :precommand
51
+ dsl_array_accessor :postcommand
50
52
  dsl_array_accessor :roles
51
53
 
52
54
  # Name of the AMI to use for new instances. Optional.
@@ -2,5 +2,5 @@
2
2
  # Copyright (c) 2012 Sean Laurent
3
3
  #
4
4
  module EC2Launcher
5
- VERSION = "1.0.30"
5
+ VERSION = "1.0.31"
6
6
  end
data/lib/ec2launcher.rb CHANGED
@@ -830,6 +830,7 @@ module EC2Launcher
830
830
 
831
831
  # pre-commands, if necessary
832
832
  user_data += build_commands(@environment.precommand)
833
+ user_data += build_commands(@application.precommand)
833
834
 
834
835
  user_data += "\n"
835
836
 
@@ -872,6 +873,7 @@ module EC2Launcher
872
873
 
873
874
  # Post commands
874
875
  user_data += build_commands(@environment.postcommand)
876
+ user_data += build_commands(@application.postcommand)
875
877
 
876
878
  user_data
877
879
  end
@@ -94,6 +94,7 @@ def run_command(cmd)
94
94
  puts f.gets
95
95
  end
96
96
  end
97
+ $?
97
98
  end
98
99
 
99
100
  option_parser = InitOptions.new
@@ -293,7 +294,13 @@ unless instance_data["block_devices"].nil?
293
294
  break
294
295
  end
295
296
  end
296
- puts `yum install mdadm -y` if raid_required
297
+ if raid_required
298
+ result = run_command("yum install mdadm -y")
299
+ unless result == 0
300
+ run_command("yum clean all")
301
+ run_command("yum install mdadm -y")
302
+ end
303
+ end
297
304
 
298
305
  raid_array_count = 0
299
306
  next_device_name = "xvdj"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.30
4
+ version: 1.0.31
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-15 00:00:00.000000000 Z
12
+ date: 2012-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk