automan 2.2.8 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/automan/cli/stacker.rb +19 -0
- data/lib/automan/version.rb +1 -1
- data/templates/stacker/.env.example +14 -0
- data/templates/stacker/.gitignore +2 -0
- data/templates/stacker/.ruby-gemset.tt +1 -0
- data/templates/stacker/Gemfile +4 -0
- data/templates/stacker/bin/%app_name%.tt +57 -0
- data/templates/stacker/bin/launch_%app_name%.sh +12 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d4dcc2feb4456cd052a27b0e752b0685060007a
|
4
|
+
data.tar.gz: 699a105a10d6acb7d4bf43e5c10fa97488bc7aad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eca81bf1d7cd56c6f83143abc1e436ec19cbe9f06861794c39da1bdbc0784da456ae0f37d68a4574f3158adb0c2a1b9cddddc35eee50173d572493c0b30da1c3
|
7
|
+
data.tar.gz: a2a9c02a97984cd3e62710c4be6a6f5b68105bbf8af9aefa43fdf4ee803f9569d0566732ab289260936509e94db748ea10ccda6a095bb67e5318746e320a759d
|
data/lib/automan/cli/stacker.rb
CHANGED
@@ -102,5 +102,24 @@ module Automan::Cli
|
|
102
102
|
h = Automan::Cloudformation::Launcher.new(options).parse_template_parameters
|
103
103
|
say JSON.pretty_generate h
|
104
104
|
end
|
105
|
+
|
106
|
+
include Thor::Actions
|
107
|
+
def self.source_root
|
108
|
+
File.join(File.dirname(__FILE__),'..','..', '..')
|
109
|
+
end
|
110
|
+
|
111
|
+
desc "project APP_NAME", "create stacker project"
|
112
|
+
|
113
|
+
attr_reader :app_name
|
114
|
+
|
115
|
+
def project(app_name)
|
116
|
+
@app_name = app_name
|
117
|
+
|
118
|
+
say "\nCreating stacker project: #{app_name}\n", :yellow
|
119
|
+
directory 'templates/stacker', app_name
|
120
|
+
[app_name, "launch_#{app_name}.sh"].each do |file|
|
121
|
+
chmod File.join(app_name, 'bin', file), 0755
|
122
|
+
end
|
123
|
+
end
|
105
124
|
end
|
106
125
|
end
|
data/lib/automan/version.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
#
|
2
|
+
# example .env file
|
3
|
+
# cp .env.example .env
|
4
|
+
#
|
5
|
+
# Set environment variables for all template parameters here.
|
6
|
+
# This .env file is in gitignore to help keep application
|
7
|
+
# secrets from leaking out into source code control.
|
8
|
+
#
|
9
|
+
export VPC_ID=vpc-foo
|
10
|
+
export SUBNET_ID=subnet-foo
|
11
|
+
export REMOTE_ACCESS_SG=sg-foo
|
12
|
+
export KEYPAIR_NAME=fookey
|
13
|
+
export INSTANCE_TYPE=m3.medium
|
14
|
+
export IMAGE_ID=ami-foo
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= @app_name %>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'cloudformation-ruby-dsl/cfntemplate'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
t = template do
|
7
|
+
## CloudFormation template stuff goes here
|
8
|
+
## See https://github.com/bazaarvoice/cloudformation-ruby-dsl
|
9
|
+
##
|
10
|
+
## Here's an example.
|
11
|
+
##
|
12
|
+
# parameter 'VpcId',
|
13
|
+
# Description: 'The VPC in which to launch',
|
14
|
+
# Type: 'String'
|
15
|
+
|
16
|
+
# parameter 'SubnetId',
|
17
|
+
# Description: 'The Subnet in which to launch the instances',
|
18
|
+
# Type: 'String'
|
19
|
+
|
20
|
+
# parameter 'RemoteAccessSG',
|
21
|
+
# Description: 'The security group allowing remote access',
|
22
|
+
# Type: 'String'
|
23
|
+
|
24
|
+
# parameter 'KeyPairName',
|
25
|
+
# Description: 'Public/private key pairs allow you to securely connect to your instance after it launches',
|
26
|
+
# Type: 'String'
|
27
|
+
|
28
|
+
# parameter 'InstanceType',
|
29
|
+
# Description: 'EC2 instance type for training machines',
|
30
|
+
# Type: 'String',
|
31
|
+
# Default: 't2.small'
|
32
|
+
|
33
|
+
# parameter 'ImageId',
|
34
|
+
# Description: 'Amazon Machine Image Id of pre-baked training machine',
|
35
|
+
# Type: 'String'
|
36
|
+
|
37
|
+
# resource "MyInstance", Type: 'AWS::EC2::Instance',
|
38
|
+
# Properties: {
|
39
|
+
# ImageId: ref('ImageId'),
|
40
|
+
# InstanceType: ref('InstanceType'),
|
41
|
+
# NetworkInterfaces: [{
|
42
|
+
# AssociatePublicIpAddress: 'true',
|
43
|
+
# DeviceIndex: '0',
|
44
|
+
# DeleteOnTermination: 'true',
|
45
|
+
# SubnetId: ref('SubnetId'),
|
46
|
+
# GroupSet: [
|
47
|
+
# ref('RemoteAccessSG')
|
48
|
+
# ]
|
49
|
+
# }],
|
50
|
+
# Tags: [
|
51
|
+
# { Key: 'Name', Value: "MyInstance" }
|
52
|
+
# ],
|
53
|
+
# KeyName: ref('KeyPairName')
|
54
|
+
# }
|
55
|
+
end
|
56
|
+
|
57
|
+
puts JSON.pretty_generate(t)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# To set template parameters, add the -p options
|
3
|
+
# to the end of the stacker command:
|
4
|
+
#
|
5
|
+
# stacker launch -n <%= app_name %> -t <%= app_name %>.json --disable-rollback \
|
6
|
+
# -p VpcId:$VPC_ID \
|
7
|
+
# SubnetId:$SUBNET_ID \
|
8
|
+
# RemoteAccessSG:$REMOTE_ACCESS_SG \
|
9
|
+
# KeyPairName:$KEYPAIR_NAME \
|
10
|
+
# InstanceType:$INSTANCE_TYPE \
|
11
|
+
# ImageId:$IMAGE_ID
|
12
|
+
stacker launch -n <%= app_name %> -t <%= app_name %>.json --disable-rollback
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: automan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Chalfant
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-05-
|
12
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -233,6 +233,12 @@ files:
|
|
233
233
|
- spec/mixins/aws_caller_spec.rb
|
234
234
|
- spec/mixins/utils_spec.rb
|
235
235
|
- spec/rds/snapshot_spec.rb
|
236
|
+
- templates/stacker/.env.example
|
237
|
+
- templates/stacker/.gitignore
|
238
|
+
- templates/stacker/.ruby-gemset.tt
|
239
|
+
- templates/stacker/Gemfile
|
240
|
+
- templates/stacker/bin/%app_name%.tt
|
241
|
+
- templates/stacker/bin/launch_%app_name%.sh
|
236
242
|
homepage: ''
|
237
243
|
licenses: []
|
238
244
|
metadata: {}
|