simple_deploy 0.2.3 → 0.2.4

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/README.md CHANGED
@@ -14,6 +14,8 @@ Create a file **~/.simple_deploy.yml** and include within it:
14
14
  ```
15
15
  deploy:
16
16
  gateway: ADMIN_IP_TO_YOUR_VPC
17
+ user: SSH_USER_TO_GATEWAY_AND_INSTANCES
18
+ key: PRIVATE_SSH_KEYFILE_FOR_USER
17
19
  artifacts:
18
20
  - name: live_community_chef_repo
19
21
  bucket_prefix: intu-lc
@@ -36,6 +38,13 @@ environments:
36
38
  region: us-west-1
37
39
  ```
38
40
 
41
+ Configuration File
42
+ ------------------
43
+
44
+ The configuration file supports additional optional deployment parameters. Artifacts can have an **endpoint** specified to be passed in (by default they pass in the s3 url).
45
+
46
+ Deploy can have a ssh **user** and **key** set. These will be used to connect to both the gateway and tunnel through to instances.
47
+
39
48
  Commands
40
49
  --------
41
50
 
@@ -55,6 +64,10 @@ simple_deploy events -n STACK_NAME -e ENVIRONMENT
55
64
  simple_deploy resources -n STACK_NAME -e ENVIRONMENT
56
65
  simple_deploy outputs -n STACK_NAME -e ENVIRONMENT
57
66
  simple_deploy template -n STACK_NAME -e ENVIRONMENT
67
+
68
+ Attribute pairs are = seperated key value pairs. Multiple can be specified. For example:
69
+
70
+ simple_deploy create -t ~/my-template.json -e my-env -n test-stack -a arg1=val1 arg2=vol2
58
71
  ```
59
72
 
60
73
  For more information, run simple_deploy -h.
@@ -13,7 +13,7 @@ module SimpleDeploy
13
13
  end
14
14
 
15
15
  def self.read_attributes
16
- @opts[:attributes].nil? ? [] : @opts[:attributes].split(',')
16
+ @opts[:attributes].nil? ? [] : @opts[:attributes]
17
17
  end
18
18
 
19
19
  def self.environment_provided?
@@ -22,10 +22,15 @@ simple_deploy events -n STACK_NAME -e ENVIRONMENT
22
22
  simple_deploy resources -n STACK_NAME -e ENVIRONMENT
23
23
  simple_deploy outputs -n STACK_NAME -e ENVIRONMENT
24
24
  simple_deploy template -n STACK_NAME -e ENVIRONMENT
25
+ simple_deploy parameters -n STACK_NAME -e ENVIRONMENT
26
+
27
+ Attributes are specified as '=' seperated key value pairs. Multiple can be specified. For example:
28
+
29
+ simple_deploy create -t ~/my-template.json -e my-env -n test-stack -a arg1=val1 arg2=vol2
25
30
 
26
31
  EOS
27
32
  opt :help, "Display Help"
28
- opt :attributes, "CSV list of updates attributes", :type => :string
33
+ opt :attributes, "CSV list of updates attributes", :type => :strings
29
34
  opt :environment, "Set the target environment", :type => :string
30
35
  opt :name, "Stack name to manage", :type => :string
31
36
  opt :template, "Path to the template file", :type => :string
@@ -34,7 +39,7 @@ EOS
34
39
  @cmd = ARGV.shift
35
40
 
36
41
  unless @cmd
37
- puts "Please specify a command."
42
+ puts "\nPlease specify a command.\n"
38
43
  exit 1
39
44
  end
40
45
 
@@ -44,7 +49,7 @@ EOS
44
49
  @config = Config.new.environment @opts[:environment]
45
50
 
46
51
  unless environment_provided?
47
- puts "Please specify an environment."
52
+ puts "\nPlease specify an environment.\n\n"
48
53
  Config.new.environments.keys.each { |e| puts e }
49
54
  exit 1
50
55
  end
@@ -53,7 +58,7 @@ EOS
53
58
  case @cmd
54
59
  when 'create', 'delete', 'deploy', 'destroy', 'instances',
55
60
  'status', 'attributes', 'events', 'resources',
56
- 'outputs', 'template', 'update'
61
+ 'outputs', 'template', 'update', 'parameters'
57
62
  @stack = Stack.new :environment => @opts[:environment],
58
63
  :name => @opts[:name],
59
64
  :config => @config
@@ -80,10 +85,10 @@ EOS
80
85
  when 'instances'
81
86
  @stack.instances.each { |s| puts s }
82
87
  when 'list'
83
- puts Stack.list(:config => @config)
88
+ puts Stackster::StackLister.new.all
84
89
  when 'template'
85
90
  jj @stack.template
86
- when 'events', 'outputs', 'resources', 'status'
91
+ when 'events', 'outputs', 'resources', 'status', 'parameters'
87
92
  puts (@stack.send @cmd.to_sym).to_yaml
88
93
  else
89
94
  puts "Unknown command. Use -h for help."
@@ -16,8 +16,8 @@ module SimpleDeploy
16
16
  config['deploy']['artifacts']
17
17
  end
18
18
 
19
- def keys
20
- config['deploy']['keys'] ||= "#{env_home}/.ssh/id_rsa"
19
+ def key
20
+ config['deploy']['key'] ||= "#{env_home}/.ssh/id_rsa"
21
21
  end
22
22
 
23
23
  def gateway
@@ -56,9 +56,9 @@ module SimpleDeploy
56
56
  end
57
57
 
58
58
  def ssh_options
59
- @logger.info "Setting key to #{@config.keys}." if @config.keys
59
+ @logger.info "Setting key to #{@config.key}." if @config.key
60
60
  {
61
- :keys => @config.keys,
61
+ :keys => @config.key,
62
62
  :paranoid => false
63
63
  }
64
64
  end
@@ -57,7 +57,11 @@ module SimpleDeploy
57
57
  end
58
58
 
59
59
  def instances
60
- stack.instances_private_ip_addresses
60
+ stack.instances.map do |i|
61
+ if i['instancesSet'].first['privateIpAddress']
62
+ i['instancesSet'].first['privateIpAddress']
63
+ end
64
+ end
61
65
  end
62
66
 
63
67
  def status
@@ -68,6 +72,10 @@ module SimpleDeploy
68
72
  stack.attributes
69
73
  end
70
74
 
75
+ def parameters
76
+ stack.parameters
77
+ end
78
+
71
79
  def template
72
80
  JSON.parse stack.template
73
81
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleDeploy
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency "rspec"
22
22
 
23
23
  s.add_runtime_dependency "capistrano"
24
- s.add_runtime_dependency "stackster", '= 0.1.3'
24
+ s.add_runtime_dependency "stackster", '= 0.2.0'
25
25
  s.add_runtime_dependency "trollop"
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-22 00:00:00.000000000 Z
12
+ date: 2012-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70196170628520 !ruby/object:Gem::Requirement
16
+ requirement: &70176717046820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70196170628520
24
+ version_requirements: *70176717046820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: capistrano
27
- requirement: &70196170627740 !ruby/object:Gem::Requirement
27
+ requirement: &70176717046380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,21 +32,21 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70196170627740
35
+ version_requirements: *70176717046380
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: stackster
38
- requirement: &70196170625960 !ruby/object:Gem::Requirement
38
+ requirement: &70176717045720 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - =
42
42
  - !ruby/object:Gem::Version
43
- version: 0.1.3
43
+ version: 0.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70196170625960
46
+ version_requirements: *70176717045720
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: trollop
49
- requirement: &70196170625080 !ruby/object:Gem::Requirement
49
+ requirement: &70176717045240 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70196170625080
57
+ version_requirements: *70176717045240
58
58
  description: I am designed to deploy artifacts uploaded by Heirloom
59
59
  email:
60
60
  - brett@weav.net
@@ -100,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  segments:
102
102
  - 0
103
- hash: 2723572142042949466
103
+ hash: -2471766336351240427
104
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  segments:
111
111
  - 0
112
- hash: 2723572142042949466
112
+ hash: -2471766336351240427
113
113
  requirements: []
114
114
  rubyforge_project: simple_deploy
115
115
  rubygems_version: 1.8.16