skyed 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4681aeb911a86e19ff48c5728d0a96d85896d76
4
- data.tar.gz: b0753c54b56e424066bf53cdce98f34c2c8eea9c
3
+ metadata.gz: 131382b709e80832ad9b2c1ab13ed243f4b05fa3
4
+ data.tar.gz: b5c59a7ebae270bdc93967f2aa018d55f43a4788
5
5
  SHA512:
6
- metadata.gz: f6ac335374e0d6550126002c93a388f6b0e758ad58a03929b92770d55a6e2474a058eb56685cc5a3a49d0ad835b52683663900d6314c1a2e1d6c643b60ab58eb
7
- data.tar.gz: 494946d8482f9d70a99297ee46815ece8e882aa045a8adb61cf281182123baefc555633978d92cfee916819b04db6be3cc69100ae61dee367fdeeac6f21f436e
6
+ metadata.gz: 30d08fa187786a4aa52d625fcc38e5f8b93e3ed93d510d93019ed29e0c122d7e742a8a1af6e1ffeea455c4ebf1b30d14354c23f4d5a8c5c04fb6699f3e9ed16a
7
+ data.tar.gz: 1e09f08c65263731d121d1838f5ae76b1e63e979897b0dacc2016f235a45983371b6efd0f9334e8954a7160c1c2ac689d0768f76055e892dec5ce4a7b3f74c83
@@ -6,5 +6,5 @@ require 'skyed/settings'
6
6
 
7
7
  # Skyed is a set of tools for cloud computing
8
8
  module Skyed
9
- VERSION = '0.1.1'
9
+ VERSION = '0.1.2'
10
10
  end
@@ -34,6 +34,9 @@ command :run do |cmd|
34
34
  cmd.flag [:w, :wait_interval], default_value: 30,
35
35
  type: Integer,
36
36
  desc: 'Time to wait for AWS responses'
37
+ cmd.flag [:j, :custom_json], default_value: '',
38
+ type: String,
39
+ desc: 'Custom JSON to pass to OW'
37
40
  cmd.action do |global_options, options, args|
38
41
  Skyed::Run.execute(global_options, options, args)
39
42
  end
@@ -20,7 +20,7 @@ module Skyed
20
20
  instances = running_instances(ow, Skyed::Settings.layer_id)
21
21
  update_custom_cookbooks(ow, Skyed::Settings.stack_id, instances,
22
22
  options[:wait_interval])
23
- execute_recipes(ow, args, instances, options[:wait_interval])
23
+ execute_recipes(ow, args, instances, options)
24
24
  end
25
25
 
26
26
  def deploy_status(ow, id)
@@ -103,12 +103,24 @@ module Skyed
103
103
  recipes
104
104
  end
105
105
 
106
- def execute_recipes(ow, recipes, instances = nil, wait = 0)
106
+ def execute_recipes(
107
+ ow,
108
+ recipes,
109
+ instances = nil,
110
+ options = {})
111
+ options[:wait_interval] ||= 0
112
+ options[:custom_json] ||= ''
113
+ deploy_id = ow.create_deployment(
114
+ execute_params(recipes, instances, options[:custom_json]))
115
+ wait_for_deploy(ow, deploy_id, options[:wait_interval])
116
+ end
117
+
118
+ def execute_params(recipes, instances, custom_json)
107
119
  command = { name: 'execute_recipes', args: { recipes: recipes } }
108
120
  deploy_params = { stack_id: Skyed::Settings.stack_id, command: command }
121
+ deploy_params[:custom_json] = custom_json unless custom_json.empty?
109
122
  deploy_params[:instance_ids] = instances unless instances.nil?
110
- deploy_id = ow.create_deployment(deploy_params)
111
- wait_for_deploy(ow, deploy_id, wait)
123
+ deploy_params
112
124
  end
113
125
 
114
126
  def recipe_in_cookbook(recipe)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skyed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignasi Fosch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-14 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git