build-cloud 1.1.1 → 1.1.2

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
  SHA256:
3
- metadata.gz: c0c0da77facee8f1326602a5e1308d9b44a137dca74a394ffb617fef7715a85d
4
- data.tar.gz: 487cf65ace7619dc8b874f0e3d815955dc5bb1f5326f7d8f84119dc948962f77
3
+ metadata.gz: fb00e8848e9205bae96b54c380b62c62159f2f38116ac6f4786ff52efab7173c
4
+ data.tar.gz: 23375d3dd6df3a8a4a48a36370891e0a2b460b547577c09a83d80d26a0d077eb
5
5
  SHA512:
6
- metadata.gz: 5907f90f70b637540ad2c14f680c12908565eb1bc8a12f57ab119f86a4a24bcf4e7c6113d0872358fa8777b74aadcd83851bb78fee03dcdc5e7be8f7042e1c56
7
- data.tar.gz: 691cb9b0bea5e38cbb945157e616326f2583c6229b9be4ba8abb5ac9c404198d3910e7a8a2388fd253a07ace53787e0fa1713d194d8366a80a263af9df20e0cb
6
+ metadata.gz: a019d4ab77af8be41c80502f60980ae3df2655260aa1a0a4552788e87c9b8cf4144736ffdcd3454de635fbc5a7b6b58756b616fdbda9a260f9b6efc0cbd7f603
7
+ data.tar.gz: 3b31d034ab11827faaba18630962faa13a649dddbed4dd921e71459e120557db1e2700f48d91d4b2215c25f3d3bb3dbfcfde2a561201e43b04645d6400465c45
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ 2018-04-12 - version 1.1.2 - version bump.
4
+
5
+ 2018-04-12 - version 1.0.1 - VPC's now lifecycle tags.
6
+
3
7
  2017-11-13 - version 0.0.24 - Fix a bug which prevented working with IAM roles in AWS accounts with more than 100 roles. Thank you @markchalloner!
4
8
 
5
9
  2017-03-01 - version 0.0.23 - Fix a bug where non-string values for interpolated variables caused a crash.
data/build-cloud.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "build-cloud"
7
- spec.version = "1.1.1"
7
+ spec.version = "1.1.2"
8
8
  spec.authors = ["The Scale Factory"]
9
9
  spec.email = ["info@scalefactory.com"]
10
10
  spec.summary = %q{Tools for building resources in AWS}
@@ -35,19 +35,27 @@ class BuildCloud::VPC
35
35
  end
36
36
 
37
37
  def create
38
-
39
- return if exists?
40
-
41
- @log.info( "Creating new VPC for #{@options[:cidr_block]}" )
42
38
 
43
39
  options = @options.dup
40
+ tag_name = options.delete(:name)
41
+
42
+ if !options[:tags]
43
+ options[:tags] = { 'Name' => tag_name }
44
+ end
45
+
46
+ if exists?
47
+ # If exists update tags
48
+ create_tags(options[:tags])
49
+ return
50
+ end
44
51
 
45
- options[:tags] = { 'Name' => options.delete(:name) }
52
+
53
+ @log.info( "Creating new VPC for #{@options[:cidr_block]}" )
46
54
 
47
55
  vpc = @compute.vpcs.new( options )
48
56
  vpc.save
49
57
 
50
- @compute.create_tags( vpc.id, options[:tags] )
58
+ create_tags(tags)
51
59
 
52
60
  wait_until_ready
53
61
 
@@ -84,5 +92,11 @@ class BuildCloud::VPC
84
92
  @options[key]
85
93
  end
86
94
 
87
- end
95
+ def create_tags(tags)
96
+ if tags != fog_object.tags
97
+ @log.info("Updating tags")
98
+ @compute.create_tags( fog_object.id, tags )
99
+ end
100
+ end
88
101
 
102
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Scale Factory
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler