tass 0.1.0 → 0.1.1

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: a59b4519fd31ade584e3b01e4e2e9e710398b0d7
4
- data.tar.gz: bcaf7a3d8ea6ceb7aaf543cee80cb9c9d8f56e8b
3
+ metadata.gz: 0db95758f86f59920e5e6b0c1100ac45d6a6646b
4
+ data.tar.gz: a39e7fc9170e336ed1ea324482253cb69544306e
5
5
  SHA512:
6
- metadata.gz: bb7a05c28477783135d2685371d8e8013f313b0d74907568ea90be27fc122b53c543a10e3c526f1ea1b7629393dccb9364b210d60fb6e7086d0b123d323f9135
7
- data.tar.gz: f63a73d33066180446250213a0f6ccacf5a9e71ea6ce776edca5218871431361de810c4b150997dc6d01792e3c61334fb3a73bd0f18af3711664bb0087a9c9c5
6
+ metadata.gz: ce9424ac378ebb6f41b2368e050740f9c170cf88b7066df4245d3626a7f24b733ce329209ec37b2bad324fde639ab30ff46d43e919b3cde614b67bf1b2644837
7
+ data.tar.gz: 0d1bb1488c479f6dc55882f97ee6028d7fd4cd3a3022be957dc65eb0c622afbd43998872fa44fc05b4d056c63d2943a381f50716cbe16e3b2e428aa44272dfb7
@@ -15,6 +15,8 @@ module Tapjoy
15
15
 
16
16
  puts "Creating launch config: #{Tapjoy::AutoscalingBootstrap.config_name}"
17
17
  begin
18
+ Tapjoy::AutoscalingBootstrap::Base.new.sec_group_exists(
19
+ aws_env[:security_groups]) unless config[:vpc_subnets]
18
20
  Tapjoy::AutoscalingBootstrap::AWS::Autoscaling::LaunchConfig.create(
19
21
  **config, **aws_env, user_data: user_data)
20
22
  rescue Aws::AutoScaling::Errors::ValidationError => err
@@ -3,7 +3,7 @@ module Tapjoy
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 0
6
+ PATCH = 1
7
7
  end
8
8
 
9
9
  VERSION = [Version::MAJOR, Version::MINOR, Version::PATCH].join('.')
@@ -160,6 +160,20 @@ module Tapjoy
160
160
  puts "Sleeping for #{2 ** tries}..."
161
161
  sleep 2 ** tries
162
162
  end
163
+
164
+ # Check if security group exists and create it if it does not
165
+ def sec_group_exists(groups)
166
+ groups.each do |group|
167
+ begin
168
+ puts "Verifying #{group} exists..."
169
+ group = Tapjoy::AutoscalingBootstrap::AWS::EC2.describe_security_groups(group)
170
+ rescue Aws::EC2::Errors::InvalidGroupNotFound => err
171
+ STDERR.puts "Warning: #{err}"
172
+ puts "Creating #{group} for #{Tapjoy::AutoscalingBootstrap.scaler_name}"
173
+ Tapjoy::AutoscalingBootstrap::AWS::EC2.create_security_group(group)
174
+ end
175
+ end
176
+ end
163
177
  end
164
178
  end
165
179
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ali Tayarani