nex_client 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nex_client/base_resource.rb +3 -2
- data/lib/nex_client/cli.rb +1 -0
- data/lib/nex_client/commands/addons.rb +1 -1
- data/lib/nex_client/commands/apps.rb +14 -2
- data/lib/nex_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b85a0da3bcdc2e97be481dea0a1d82c6734cfe55
|
4
|
+
data.tar.gz: 226353cfb77a81de88917aa5004bc599499afd2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c97820ae8892d92b7dc605bf828998de377cb1b1dcf6c8f7e1c2ab0ddd6bc159d4d76821d58b74087e4b3e752909c18531b840303d8ec47896be036124853a7
|
7
|
+
data.tar.gz: 0b0164bbbb7683305afeb91f4db7f3a2c19bf33cace71c159d7a1f7c9d1fc9ead289d4be8826fa94793b48fa54c2373f372bab0485768782ef03b93aa743328d
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module NexClient
|
3
3
|
class BaseResource < JsonApiClient::Resource
|
4
|
-
|
4
|
+
HOST_MAPPING = {
|
5
5
|
'development' => 'http://localhost:5000',
|
6
6
|
'test' => 'http://nex-test.com',
|
7
7
|
'uat' => 'https://api-nex-uat.maestrano.io',
|
@@ -9,8 +9,9 @@ module NexClient
|
|
9
9
|
}
|
10
10
|
API_ROOT_PATH = '/api/v1'
|
11
11
|
ENVIRONMENT = ENV['NEX_ENV'] || 'uat' # should be eventually be changed to production
|
12
|
+
API_HOST = ENV['NEX_ENDPOINT'] || HOST_MAPPING[ENVIRONMENT]
|
12
13
|
|
13
|
-
self.site = "#{API_HOST
|
14
|
+
self.site = "#{API_HOST}#{API_ROOT_PATH}"
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
data/lib/nex_client/cli.rb
CHANGED
@@ -288,6 +288,7 @@ module NexClient
|
|
288
288
|
c.option '--delete MYVAR,MYVAR2,...', Array, 'comma separated list of env variables'
|
289
289
|
c.option '--env-file FILE', String, 'newline separated list of env variables (MYVAR=1) or YAML file. Note that YAML parsing is recursive.'
|
290
290
|
c.option '--env-prefix PREFIX', String, 'prefix all variables contained in the env file with the specified prefix (PREFIX_MYVAR)'
|
291
|
+
c.option '--raw', 'vars are returned in a environment file format (key=value)'
|
291
292
|
c.action do |args, options|
|
292
293
|
NexClient::Commands::Apps.manage_vars(args,options)
|
293
294
|
end
|
@@ -63,7 +63,7 @@ module NexClient
|
|
63
63
|
self.display_vars(e.all_vars)
|
64
64
|
|
65
65
|
# Display options
|
66
|
-
self.display_options(e.opts)
|
66
|
+
self.display_options(e.opts) if e.respond_to?(:opts)
|
67
67
|
|
68
68
|
# Display Source Control Management
|
69
69
|
self.display_scm(e.scm)
|
@@ -340,7 +340,11 @@ module NexClient
|
|
340
340
|
end
|
341
341
|
|
342
342
|
# Display all vars
|
343
|
-
|
343
|
+
if opts.raw
|
344
|
+
self.display_raw_vars(e.all_vars)
|
345
|
+
else
|
346
|
+
self.display_vars(e.all_vars)
|
347
|
+
end
|
344
348
|
end
|
345
349
|
|
346
350
|
def self.manage_scm(args,opts)
|
@@ -392,6 +396,14 @@ module NexClient
|
|
392
396
|
puts "\n"
|
393
397
|
end
|
394
398
|
|
399
|
+
def self.display_raw_vars(list)
|
400
|
+
table = [list].flatten.compact.map do |e|
|
401
|
+
e.sort_by { |k, v| k }.map { |k,v| "#{k}=#{v}" }
|
402
|
+
end.flatten
|
403
|
+
puts table
|
404
|
+
puts "\n"
|
405
|
+
end
|
406
|
+
|
395
407
|
def self.display_vars(list)
|
396
408
|
table = Terminal::Table.new title: VARS_TITLE, headings: VARS_HEADERS do |t|
|
397
409
|
[list].flatten.compact.each do |e|
|
data/lib/nex_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nex_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnaud Lachaume
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_api_client
|