thunder_punch 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -17,5 +17,6 @@ tmtags
17
17
  coverage
18
18
  rdoc
19
19
  pkg
20
+ *.gem
20
21
 
21
22
  ## PROJECT::SPECIFIC
data/CHANGELOG.mdown CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.0.4 (March 8, 2010)
2
+
3
+ * Add ability to exclude specific files and directories from ami bundling [Bob Burbach - github.com/peregrinator]
4
+
1
5
  == 0.0.3 (March 7, 2010)
2
6
 
3
7
  * Fix error in uploading keys to EC2 - missing aws_key_location in the command and upload takes one path at a time [Bob Burbach - github.com/peregrinator]
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 GravyCones
1
+ Copyright (c) 2010 Critical Juncture
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.mdown CHANGED
@@ -1,28 +1,32 @@
1
1
  #Thunder Punch
2
2
 
3
- Collection of capistrano recipes for deployment and other server tasks
3
+ Collection of Capistrano recipes for deployment and other server tasks
4
4
 
5
5
  ##Origin
6
6
 
7
7
  "Thunder Punch" was a version of the He-Man action figure from the original 1980s Masters of the Universe toy line. Ring caps were placed in a "backpack" integrated into the figure, which contained the striking mechanism for the caps (as well as tiny vents to allow smoke from a triggered cap to escape). This mechanism was triggered by drawing the figure's spring-loaded right arm back and releasing it to swing forward; the explosion of the cap was intended to simulate a thunderous noise caused by the supposed superhuman power of the character's punch. [via wikipedia]
8
8
 
9
- Because this collection of recipes is for capistrano and run with the cap command - this seemed a good name, sans the thunderous noise of course (this was found to be disrupting in work environments and cafes).
9
+ Because this collection of recipes is for Capistrano and run with the cap command - this seemed a good name, sans the thunderous noise of course (this was found to be disrupting in work environments and cafes).
10
10
 
11
11
  ##Requirements
12
12
 
13
13
  * Capistrano >=2.5.5
14
14
  * In your deploy.rb file:
15
- * Add line 'require govpulse/thunder_punch'
15
+ * Add line 'require critical\_juncture/thunder_punch'
16
16
  * Add line 'set :ec2\_config\_location, File.join(File.dirname(__FILE__), "ec2\_config.yml")'
17
17
 
18
18
  ##Recipes
19
19
 
20
- By creating a central and organized system for our tasks we can reduce our deploy.rb files to be project specific and make the addition of new tasks compatible and easily added.
20
+ By creating a central and organized system for our tasks we can reduce the content in our deploy.rb files to be project specific and make the addition of new tasks easy and compatible.
21
21
 
22
22
  ###EC2
23
23
 
24
24
  * Requires a yaml file named ec2_config.yml with the appropriate passwords, etc. See the example file.
25
- * ami.rb - recipes for uploading neccessary keys to server, bundling new ami, uploading to S3, and registering
25
+
26
+ ####ami.rb
27
+ * recipes for uploading necessary keys to server, bundling new AMI, uploading to S3, and registering a AMI
28
+ * exclude files and directories from bundling by putting them in an array in ec2_config.yml
29
+ * `ami_excluded_items: ['/home/my_user', '/var/some_secret_stuff']`
26
30
 
27
31
  ##Known Issues
28
32
 
@@ -30,4 +34,4 @@ By creating a central and organized system for our tasks we can reduce our deplo
30
34
 
31
35
  * ec2:create\_new\_ami task doesn't work at the moment due to the ec2:bundle_ami task not returning properly. See the TODO for more info.
32
36
 
33
- Copyright (c) 2010 GravyCones, released under the MIT license
37
+ Copyright (c) 2010 Critical Juncture, released under the MIT license
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -1,9 +1,10 @@
1
1
  #examples from Amazon documentation
2
- aws_key_location: ~/.ssh #or where ever you store you aws keys - no trailing slash
2
+ aws_key_location: ~/.ssh #or whereever you store you aws keys - no trailing slash
3
3
  ec2_private_key: pk-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem
4
4
  ec2_x509_cert: cert-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem
5
5
  aws_account_id: 495219933132
6
- ec2_architecture: i386
6
+ ec2_architecture: i386 #or x86_64
7
7
  aws_access_key: <aws-access-key-id>
8
8
  aws_secret_access_key: <aws-secret-access-key>
9
- ec2_s3_bucket_name: some_bucket_for_your_ami_images
9
+ ec2_s3_bucket_name: some_bucket_for_your_ami_images
10
+ ami_excluded_items: [] #you may want to exclude files or directories like /home/my_user, etc.
@@ -18,6 +18,7 @@ Capistrano::Configuration.instance(:must_exist).load do |configuration|
18
18
  set :aws_access_key, ec2_config['aws_access_key']
19
19
  set :aws_secret_access_key, ec2_config['aws_secret_access_key']
20
20
  set :ec2_s3_bucket_name, ec2_config['ec2_s3_bucket_name']
21
+ set :ami_excluded_items, ec2_config['ami_excluded_items']
21
22
 
22
23
  alert_user('You need to set :aws_key_location in config/ec2_config.yml', :abort => true) unless :key_location
23
24
  alert_user('You need to set :ec2_private_key in config/ec2_config.yml', :abort => true) unless :ec2_private_key
@@ -62,7 +63,23 @@ Capistrano::Configuration.instance(:must_exist).load do |configuration|
62
63
  task :bundle_ami, :roles => :app do
63
64
  load_ec2_config unless ec2_config_loaded
64
65
  alert_user("You need to set :bundle_name via the command line\n `cap ec2:bundle_ami -s bundle_name=sample`", :abort => true) unless configuration[:bundle_name]
65
- sudo "ec2-bundle-vol -d /mnt --fstab /etc/fstab -k /mnt/#{ec2_private_key} -c /mnt/#{ec2_x509_cert} -u #{aws_account_id} -r #{ec2_architecture} -p #{bundle_name}"
66
+ default_ami_excluded_items = ['/sys/kernel/debug',
67
+ '/sys/kernel/security',
68
+ '/sys',
69
+ '/proc',
70
+ '/sys/fs/fuse/connections',
71
+ '/dev/pts',
72
+ '/dev',
73
+ '/media',
74
+ '/mnt',
75
+ '/proc',
76
+ '/sys',
77
+ '/etc/udev/rules.d/70-persistent-net.rules',
78
+ '/etc/udev/rules.d/z25_persistent-net.rules',
79
+ "/mnt/#{bundle_name}",
80
+ '/mnt/img-mnt']
81
+
82
+ sudo "ec2-bundle-vol -d /mnt --fstab /etc/fstab -k /mnt/#{ec2_private_key} -c /mnt/#{ec2_x509_cert} -u #{aws_account_id} -r #{ec2_architecture} -p #{bundle_name} --all --exclude #{(ami_excluded_items | default_ami_excluded_items).join(', ')}"
66
83
  end
67
84
 
68
85
  desc 'Upload your bundled AMI to S3'
File without changes
File without changes
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{thunder_punch}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bob Burbach"]
12
- s.date = %q{2010-03-07}
12
+ s.date = %q{2010-03-08}
13
13
  s.description = %q{Collection of capistano recipes for deployment and server tasks}
14
14
  s.email = %q{govpulse@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -26,11 +26,11 @@ Gem::Specification.new do |s|
26
26
  "TODO.mdown",
27
27
  "VERSION",
28
28
  "example/ec2_config.yml",
29
- "lib/govpulse/recipes.rb",
30
- "lib/govpulse/recipes/ec2.rb",
31
- "lib/govpulse/recipes/ec2/ami.rb",
32
- "lib/govpulse/thunder_punch.rb",
33
- "lib/govpulse/utilities/utilities.rb",
29
+ "lib/critical_juncture/recipes.rb",
30
+ "lib/critical_juncture/recipes/ec2.rb",
31
+ "lib/critical_juncture/recipes/ec2/ami.rb",
32
+ "lib/critical_juncture/thunder_punch.rb",
33
+ "lib/critical_juncture/utilities/utilities.rb",
34
34
  "test/helper.rb",
35
35
  "test/test_thunder_punch.rb",
36
36
  "thunder_punch.gemspec"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thunder_punch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Burbach
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-07 00:00:00 -08:00
12
+ date: 2010-03-08 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -51,11 +51,11 @@ files:
51
51
  - TODO.mdown
52
52
  - VERSION
53
53
  - example/ec2_config.yml
54
- - lib/govpulse/recipes.rb
55
- - lib/govpulse/recipes/ec2.rb
56
- - lib/govpulse/recipes/ec2/ami.rb
57
- - lib/govpulse/thunder_punch.rb
58
- - lib/govpulse/utilities/utilities.rb
54
+ - lib/critical_juncture/recipes.rb
55
+ - lib/critical_juncture/recipes/ec2.rb
56
+ - lib/critical_juncture/recipes/ec2/ami.rb
57
+ - lib/critical_juncture/thunder_punch.rb
58
+ - lib/critical_juncture/utilities/utilities.rb
59
59
  - test/helper.rb
60
60
  - test/test_thunder_punch.rb
61
61
  - thunder_punch.gemspec