gce-host 0.1.0 → 0.1.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: 62b31646dd076986d8c0cc9bbd2c25a47c39c68d
4
- data.tar.gz: 160b97e5f289c5e44f3391e59a4702d55a1750e8
3
+ metadata.gz: a53b02a45029bc391a5e91a76fe7a7a876c4c25a
4
+ data.tar.gz: 9aaf79efe08d1dd1aca249238a0b033eeafec1ee
5
5
  SHA512:
6
- metadata.gz: 23878d91ddc9527713a68d263d19c77ee0b57cc875e06dbc95e162f479523fad4ac1bda7873860e0f41df275ee0f69c3cac344995c0f9756d96e2de10e80a1a4
7
- data.tar.gz: 99db823d6e304bc8ef7071cbd14186470b55d86fdfc81f814c38d7ec3ca8d0d38a4aa31355a45457902d951f428ca67c7a56ba43484af667416212bd1b089bce
6
+ metadata.gz: e842f07851050bdb5ef066d14163f24300a059ef1302851010d9dc201994ebd4310621e5fca21ad13aa69a1726e9813074060d9f5e0c5ae633718ce6578f0dae
7
+ data.tar.gz: 649c7dd20e39d3d13a297d99f6883848eb1fe66a9f9ff9706cb0a2086425f1211e6af092ec6561c9b4e6fd286d1b1ddbe4703808999ac3caa0c357e265c4e4d3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # 0.1.3 (2016/11/24)
2
+
3
+ Enhancements:
4
+
5
+ * Support ~ (home directory) in GCE_HOST_CONFIG_FILE and GOOGLE_CREDENTIAL_FILE
6
+
7
+ # 0.1.2 (2016/11/24)
8
+
9
+ yanked
10
+
11
+ # 0.1.1 (2016/11/24)
12
+
13
+ Enhancements:
14
+
15
+ * Add machine_type to show
16
+
1
17
  # 0.1.0 (2016/11/18)
2
18
 
3
19
  first version
20
+
data/example/example.conf CHANGED
@@ -1,5 +1,5 @@
1
1
  AUTH_METHOD=json_key
2
- GOOGLE_CREDENTIAL_FILE=example/your-project-000.json
2
+ GOOGLE_CREDENTIAL_FILE=~/.config/gcloud/your-project-000.json
3
3
  ROLES_KEY=roles
4
4
  ROLE_VALUE_DELIMITER=:
5
5
  OPTIONAL_STRING_KEYS=service,status
data/gce-host.gemspec CHANGED
@@ -1,6 +1,8 @@
1
+ require_relative 'lib/gce/host/version'
2
+
1
3
  Gem::Specification.new do |gem|
2
4
  gem.name = "gce-host"
3
- gem.version = '0.1.0'
5
+ gem.version = GCE::Host::VERSION
4
6
  gem.author = ['Naotoshi Seo']
5
7
  gem.email = ['sonots@gmail.com']
6
8
  gem.homepage = 'https://github.com/sonots/gce-host'
@@ -11,7 +11,7 @@ class GCE
11
11
  end
12
12
 
13
13
  def self.config_file
14
- @config_file ||= ENV.fetch('GCE_HOST_CONFIG_FILE', '/etc/sysconfig/gce-host')
14
+ @config_file ||= File.expand_path(ENV.fetch('GCE_HOST_CONFIG_FILE', '/etc/sysconfig/gce-host'))
15
15
  end
16
16
 
17
17
  def self.auth_method
@@ -19,7 +19,7 @@ class GCE
19
19
  end
20
20
 
21
21
  def self.credential_file
22
- @credential_file ||= ENV['GOOGLE_CREDENTIAL_FILE'] || config.fetch('GOOGLE_CREDENTIAL_FILE', nil)
22
+ @credential_file ||= File.expand_path(ENV['GOOGLE_CREDENTIAL_FILE'] || config.fetch('GOOGLE_CREDENTIAL_FILE'))
23
23
  end
24
24
 
25
25
  def self.project
@@ -51,6 +51,10 @@ class GCE
51
51
  instance.zone.split('/').last
52
52
  end
53
53
 
54
+ def machine_type
55
+ instance.machine_type.split('/').last
56
+ end
57
+
54
58
  def private_ip_address
55
59
  instance.network_interfaces.first.network_ip
56
60
  end
@@ -121,7 +125,6 @@ class GCE
121
125
  params = {
122
126
  "hostname" => hostname,
123
127
  "roles" => roles,
124
- "zone" => zone,
125
128
  }
126
129
  Config.optional_string_keys.each do |key|
127
130
  field = StringUtil.underscore(key)
@@ -132,7 +135,8 @@ class GCE
132
135
  params[field] = send(field)
133
136
  end
134
137
  params.merge!(
135
- "instance_id" => instance_id,
138
+ "zone" => zone,
139
+ "machine_type" => machine_type,
136
140
  "private_ip_address" => private_ip_address,
137
141
  "public_ip_address" => public_ip_address,
138
142
  "creation_timestamp" => creation_timestamp,
@@ -1,5 +1,5 @@
1
1
  class GCE
2
2
  class Host
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gce-host
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-23 00:00:00.000000000 Z
11
+ date: 2016-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client