morpheus-cli 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec2a0c7f7c355d73f29610ee9ce39ba75a8aa2ef
4
- data.tar.gz: 5459548b4682698ffdd9def0761c1f9c0afb0d3d
3
+ metadata.gz: 2c20e792c2e9a6b6eacd2c3b68c6433f110e8d6e
4
+ data.tar.gz: 7f64833bddcfaab7163a159ba1f2bac6bc6be940
5
5
  SHA512:
6
- metadata.gz: 37f0bf316ee216eb9b0a1709f9eef19ee9f08029cc7675dc088112ee05a369f554ef9ffd80341ad95589eae987de06868f235176a19de95cccc1478adcd5f8a8
7
- data.tar.gz: 6e7c76c946b1cd791b24fe036c63ca0dfb271bda465a166ede5e9c7a4889653eeb59d655ff9c04d4f3638548475b703be71a845815b0b9d617332bb76c93e52f
6
+ metadata.gz: 3221c0b5eeeb5f3b99212e135e1d07e4a5f6ada0c69c0ffcd479aaf24e399efd1c72bb1b2a05ff2b3b1f4b11d8d3ee937ec20b1c7f6b2c2dc5ba687a82fe1c15
7
+ data.tar.gz: 9909b64c97552e1e7d2342d4edbb4e43a8bd657cf945e742207f9a2b0874342aa971112f86ad8b5c2d8bef70c3335cacca905fe61677cf15b62840568fdfa15f
@@ -51,7 +51,7 @@ class Morpheus::DeployInterface < Morpheus::APIClient
51
51
  url += "/#{destination}"
52
52
  end
53
53
 
54
- headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
54
+ headers = { :authorization => "Bearer #{@access_token}"}
55
55
 
56
56
  payload = nil
57
57
  # TODO: Setup payload to be contents of file appropriately
@@ -59,6 +59,7 @@ class Morpheus::DeployInterface < Morpheus::APIClient
59
59
  method: :post,
60
60
  url: url,
61
61
  headers: headers,
62
+ timeout: nil,
62
63
  payload: {
63
64
  multipart: true,
64
65
  file: File.new(path, 'rb')
@@ -83,7 +84,7 @@ class Morpheus::DeployInterface < Morpheus::APIClient
83
84
  end
84
85
  end
85
86
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
86
- response = RestClient::Request.execute(method: :post, url: url, headers: headers, payload: payload.to_json)
87
+ response = RestClient::Request.execute(method: :post, url: url, headers: headers, timeout: nil, payload: payload.to_json)
87
88
  JSON.parse(response.to_s)
88
89
  end
89
90
  end
@@ -42,7 +42,7 @@ class Morpheus::Cli::Deploys
42
42
  return
43
43
  end
44
44
 
45
- instance_results = @instances_interface.get(name: deploy_args[:name])
45
+ instance_results = @instances_interface.get(name: deploy_args['name'])
46
46
  if instance_results['instances'].empty?
47
47
  puts "Instance not found by name #{args[0]}"
48
48
  return
@@ -90,7 +90,13 @@ class Morpheus::Cli::Deploys
90
90
  end
91
91
 
92
92
  deploy_payload = {}
93
-
93
+ if deploy_args['env']
94
+ evars = []
95
+ deploy_args['env'].each_pair do |key, value|
96
+ evars << {name: key, value: value, export: false}
97
+ end
98
+ @instances_interface.create_env(instance_id,evars)
99
+ end
94
100
  if deploy_args['options']
95
101
  deploy_payload = {
96
102
  appDeploy: {
@@ -98,6 +104,7 @@ class Morpheus::Cli::Deploys
98
104
  }
99
105
  }
100
106
  end
107
+
101
108
  print cyan, bold, "Deploying to Servers...", reset, "\n"
102
109
  @deploy_interface.deploy(deployment_id,deploy_payload)
103
110
  print cyan, bold, "Deploy Successful!", reset, "\n"
@@ -229,7 +229,7 @@ class Morpheus::Cli::Instances
229
229
  envs += env_results['readOnlyEnvs'].map { |k,v| {:name => k, :value => k.downcase.include?("password") ? "********" : v, :export => true}}
230
230
  end
231
231
  tp envs, :name, :value, :export
232
- print "\n" ,cyan, bold, "Importad Envs\n","==================", "\n\n", reset, cyan
232
+ print "\n" ,cyan, bold, "Imported Envs\n","==================", "\n\n", reset, cyan
233
233
  imported_envs = env_results['importedEnvs'].map { |k,v| {:name => k, :value => k.downcase.include?("password") ? "********" : v}}
234
234
  tp imported_envs
235
235
  print reset, "\n"
@@ -1,5 +1,5 @@
1
1
  module Morpheus
2
2
  module Cli
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morpheus-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Estes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-02 00:00:00.000000000 Z
11
+ date: 2015-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler