cyclid 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cyclid/plugins/builder/google.rb +21 -5
- data/app/cyclid/plugins/dispatcher/local.rb +2 -0
- data/lib/cyclid/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: 489faa5033ce922ff61b7ab00b4cd161e7f66ae8
|
4
|
+
data.tar.gz: 2b0c1803c1f1dd3d82c3b906402b8ddbfbdb3c50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0158078cf6a1b6da24afd01b2250c8171b5477f87c0cd52fd4b552c76a894dc50ced3c682988040b207fa3439404550ae130596ad3f84144df85e304c632429
|
7
|
+
data.tar.gz: cc3c14a58a141da1e819636f0d7eb1451be01d50549b902b5470f00b126241d06b5ba553bd2c55ab24eaf2c5909043781b75189291b391e9ce4bc9b7caebb960
|
@@ -59,11 +59,15 @@ module Cyclid
|
|
59
59
|
release = 'trusty'
|
60
60
|
end
|
61
61
|
|
62
|
+
# Get the instance size, or a default if there isn't one
|
63
|
+
size = args[:size] || 'micro'
|
64
|
+
machine_type = map_machine_type(size)
|
65
|
+
|
62
66
|
name = create_name
|
63
67
|
|
64
|
-
source_image,
|
65
|
-
disk = create_disk(name,
|
66
|
-
instance = create_instance(name, disk)
|
68
|
+
source_image, disk_size = find_source_image(distro, release)
|
69
|
+
disk = create_disk(name, disk_size, source_image)
|
70
|
+
instance = create_instance(name, disk, machine_type)
|
67
71
|
|
68
72
|
Cyclid.logger.debug "instance=#{instance.inspect}"
|
69
73
|
|
@@ -132,6 +136,18 @@ module Cyclid
|
|
132
136
|
"#{base}-#{SecureRandom.hex(16)}"
|
133
137
|
end
|
134
138
|
|
139
|
+
# Map the generic size to a machine type
|
140
|
+
def map_machine_type(size)
|
141
|
+
map = { 'default' => @config[:machine_type],
|
142
|
+
'micro' => 'f1-micro',
|
143
|
+
'mini' => 'g1-small',
|
144
|
+
'small' => 'n1-standard-1',
|
145
|
+
'medium' => 'n1-standard-2',
|
146
|
+
'large' => 'n1-standard-4' }
|
147
|
+
|
148
|
+
map[size]
|
149
|
+
end
|
150
|
+
|
135
151
|
# Map the distro & release to a source image
|
136
152
|
def find_source_image(distro, release)
|
137
153
|
Cyclid.logger.debug 'attempting to find source image'
|
@@ -177,11 +193,11 @@ module Cyclid
|
|
177
193
|
end
|
178
194
|
|
179
195
|
# Create a compute instance
|
180
|
-
def create_instance(name, disk)
|
196
|
+
def create_instance(name, disk, machine_type)
|
181
197
|
Cyclid.logger.info "creating instance #{name}"
|
182
198
|
instance = @api.servers.bootstrap(name: name,
|
183
199
|
disks: [disk],
|
184
|
-
machine_type:
|
200
|
+
machine_type: machine_type,
|
185
201
|
zone_name: @config[:zone],
|
186
202
|
network: @config[:network],
|
187
203
|
username: @config[:username],
|
data/lib/cyclid/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyclid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristian Van Der Vliet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|