forked from pgarbe/ecs-autoscaling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrakefile
38 lines (30 loc) · 781 Bytes
/
rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'rubygems'
require 'bundler/setup'
require 'autostacker24'
require 'base64'
Aws.use_bundled_cert!
STACK = 'ecs-autoscaling'
GLOBAL = ENV['GLOBAL'] || 'global'
TEMPLATE = 'stack.yaml'
desc 'create or update stack'
task :deploy do
parameters = {
KeyName: 'pgarbe',
ClusterDesiredCapacity: 1,
ClusterMaxSize: 100,
ClusterMaxMemoryReservationPercentage: 80,
TaskDesiredCapacity: 1,
TaskMemory: 512,
}
Stacker.create_or_update_stack(STACK, TEMPLATE, parameters, GLOBAL)
end
desc 'delete stack'
task :delete do
Stacker.delete_stack(STACK) unless Stacker.find_stack(STACK).nil?
end
task :default do
puts
puts 'Use one of the available tasks:'
puts "Current stack is #{STACK}\n"
system 'rake -T'
end