steam_donkey 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 703344e3378977818a315f29c5d1c5fc723ee02d
4
+ data.tar.gz: 3335a0856f76e2014d3484e76d558e0a6611676d
5
+ SHA512:
6
+ metadata.gz: 25ff86451c838ddc72c2dc55b09cf1049c43d6892173b13690cc790ba0954097726c7872533719b97e79fae3f676803eb23fb1da8c5bc654752e7a8c6c0cc071
7
+ data.tar.gz: 0da4f8dc6d8fdf0d508e62f96803d809cb23926a2d643cfb526b2e1acdfdc1ae2d3cff13a1135d146aa111c8033ffc261164bc2c200c6b721ae9b3e7aac2726c
data/.gitignore ADDED
@@ -0,0 +1,34 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Documentation cache and generated files:
17
+ /.yardoc/
18
+ /_yardoc/
19
+ /doc/
20
+ /rdoc/
21
+
22
+ ## Environment normalization:
23
+ /.bundle/
24
+ /vendor/bundle
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,76 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ steam_donkey (0.2.0)
5
+ aws-sdk (~> 2.6)
6
+ chronic (~> 0.10)
7
+ command_line_reporter (~> 3.0)
8
+ gli (= 2.14.0)
9
+ inifile (~> 3.0)
10
+ to_regexp (~> 0.2.1)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ aruba (0.14.2)
16
+ childprocess (~> 0.5.6)
17
+ contracts (~> 0.9)
18
+ cucumber (>= 1.3.19)
19
+ ffi (~> 1.9.10)
20
+ rspec-expectations (>= 2.99)
21
+ thor (~> 0.19)
22
+ aws-sdk (2.7.0)
23
+ aws-sdk-resources (= 2.7.0)
24
+ aws-sdk-core (2.7.0)
25
+ aws-sigv4 (~> 1.0)
26
+ jmespath (~> 1.0)
27
+ aws-sdk-resources (2.7.0)
28
+ aws-sdk-core (= 2.7.0)
29
+ aws-sigv4 (1.0.0)
30
+ builder (3.2.2)
31
+ childprocess (0.5.9)
32
+ ffi (~> 1.0, >= 1.0.11)
33
+ chronic (0.10.2)
34
+ colored (1.2)
35
+ command_line_reporter (3.3.6)
36
+ colored (>= 1.2)
37
+ contracts (0.14.0)
38
+ cucumber (2.4.0)
39
+ builder (>= 2.1.2)
40
+ cucumber-core (~> 1.5.0)
41
+ cucumber-wire (~> 0.0.1)
42
+ diff-lcs (>= 1.1.3)
43
+ gherkin (~> 4.0)
44
+ multi_json (>= 1.7.5, < 2.0)
45
+ multi_test (>= 0.1.2)
46
+ cucumber-core (1.5.0)
47
+ gherkin (~> 4.0)
48
+ cucumber-wire (0.0.1)
49
+ diff-lcs (1.2.5)
50
+ ffi (1.9.14)
51
+ gherkin (4.0.0)
52
+ gli (2.14.0)
53
+ inifile (3.0.0)
54
+ jmespath (1.3.1)
55
+ multi_json (1.12.1)
56
+ multi_test (0.1.2)
57
+ rake (12.0.0)
58
+ rdoc (5.0.0)
59
+ rspec-expectations (3.5.0)
60
+ diff-lcs (>= 1.2.0, < 2.0)
61
+ rspec-support (~> 3.5.0)
62
+ rspec-support (3.5.0)
63
+ thor (0.19.4)
64
+ to_regexp (0.2.1)
65
+
66
+ PLATFORMS
67
+ ruby
68
+
69
+ DEPENDENCIES
70
+ aruba
71
+ rake
72
+ rdoc
73
+ steam_donkey!
74
+
75
+ BUNDLED WITH
76
+ 1.13.7
data/README.md ADDED
@@ -0,0 +1,161 @@
1
+ # SteamDonkey
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/steam_donkey`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'steam_donkey'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install steam_donkey
20
+
21
+ ## Usage
22
+
23
+ ```
24
+ $ donkey help
25
+ NAME
26
+ donkey - Tools and scripts for building and managing infrastructure on AWS
27
+
28
+ SYNOPSIS
29
+ donkey [global options] command [command options] [arguments...]
30
+
31
+ VERSION
32
+ 0.0.1
33
+
34
+ GLOBAL OPTIONS
35
+ --help - Show this message
36
+ --profile=arg - AWS profile name (default: none)
37
+ --region=arg - AWS region (default: none)
38
+ -v, --verbose -
39
+ --version - Display the program version
40
+
41
+ COMMANDS
42
+ cf - Manage and view cloudformation stacks and templates
43
+ ec2 - Manage and view ec2 instances
44
+ help - Shows a list of commands or help for one command
45
+ ```
46
+
47
+ ### Selecting Resource Columns
48
+
49
+ You can select any resources column in either CamelCase or underscore.
50
+
51
+ ```
52
+ $ donkey ec2 ls --columns Id,Name,launch_time
53
+ Id Name State
54
+ i-0721bb9f71f8a6045 dev-cass-test-datanode running
55
+ i-029a8574fb8233c1b rhill-ftp-chef-node running
56
+ ...
57
+ ```
58
+
59
+ ### Filtering Resources
60
+
61
+ #### --filters 'Name=my-instance'
62
+
63
+ Literal filters
64
+
65
+ ```
66
+ $ donkey ec2 ls --filters Name=my-instance
67
+ Id Name State
68
+ i-0721bb9f71f8a6045 my-instance running
69
+ ```
70
+
71
+ #### --filters 'Name=?/^dev-/'
72
+
73
+ Regex filters
74
+
75
+ ```
76
+ $ donkey ec2 ls --filters 'Name=?/^dev-/'
77
+ Id Name State
78
+ i-0721bb9f71f8a6045 dev-cass-test-datanode running
79
+ i-029a8574fb8233c1b dev-rhill-ftp-chef-node running
80
+ ...
81
+ ```
82
+
83
+ #### --filters 'Name=!/^dev-/'
84
+
85
+ Negative regex
86
+
87
+ ```
88
+ $ donkey ec2 ls --filters 'Name=!/^dev-/'
89
+ Id Name State
90
+ i-0721bb9f71f8a6045 qa-cass-test-datanode running
91
+ i-029a8574fb8233c1b prod-rhill-ftp-chef-node running
92
+ ...
93
+ ```
94
+
95
+ ### Sorting
96
+
97
+ #### --sort 'Name,Id'
98
+
99
+ ```
100
+ $ donkey ec2 ls --sort 'LaunchTime,Name'
101
+ Id Name State
102
+ i-0721bb9f71f8a6045 qa-cass-test-datanode running
103
+ i-029a8574fb8233c1b prod-rhill-ftp-chef-node running
104
+ ...
105
+ ```
106
+
107
+ #### --sort 'Name=desc,Id=asc'
108
+
109
+ ```
110
+ $ donkey ec2 ls --sort 'LaunchTime,Name=desc,Id=asc'
111
+ Id Name State
112
+ i-0721bb9f71f8a6045 qa-cass-test-datanode running
113
+ i-029a8574fb8233c1b prod-rhill-ftp-chef-node running
114
+ ...
115
+ ```
116
+
117
+ ### Output Options
118
+
119
+ #### --format pretty
120
+
121
+ ```
122
+ $ donkey ec2 ls --format pretty
123
+ Id Name State
124
+ i-0721bb9f71f8a6045 dev-cass-test-datanode running
125
+ i-029a8574fb8233c1b rhill-ftp-chef-node running
126
+ ```
127
+
128
+ #### --format raw
129
+
130
+ ```
131
+ $ donkey ec2 ls --format pretty
132
+ Id,Name,State
133
+ i-0721bb9f71f8a6045,dev-cass-test-datanode,running
134
+ i-029a8574fb8233c1b,rhill-ftp-chef-node,running
135
+ ```
136
+
137
+ ### Raw
138
+
139
+ #### --raw
140
+
141
+ ```
142
+ $ donkey ec2 ls --raw
143
+ i-0721bb9f71f8a6045,dev-cass-test-datanode,running
144
+ i-029a8574fb8233c1b,rhill-ftp-chef-node,running
145
+ ```
146
+
147
+ ## Development
148
+
149
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
150
+
151
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
152
+
153
+ ## Contributing
154
+
155
+ Bug reports and pull requests are welcome on GitHub at https://github.com/petercoulton/steam_donkey.
156
+
157
+
158
+ ## License
159
+
160
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
161
+
data/README.rdoc ADDED
@@ -0,0 +1,6 @@
1
+ = steam_donkey
2
+
3
+ Describe your project here
4
+
5
+ :include:steam_donkey.rdoc
6
+
data/Rakefile ADDED
@@ -0,0 +1,54 @@
1
+ require 'rake/clean'
2
+ require 'rubygems'
3
+ require 'rubygems/package_task'
4
+ require 'rdoc/task'
5
+ require 'cucumber'
6
+ require 'cucumber/rake/task'
7
+ require "bundler/gem_tasks"
8
+ Rake::RDocTask.new do |rd|
9
+ rd.main = "README.rdoc"
10
+ rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
11
+ rd.title = 'Steam Donkey'
12
+ end
13
+
14
+ spec = eval(File.read('steam_donkey.gemspec'))
15
+
16
+ Gem::PackageTask.new(spec) do |pkg|
17
+ end
18
+ CUKE_RESULTS = 'results.html'
19
+ CLEAN << CUKE_RESULTS
20
+ desc 'Run features'
21
+ Cucumber::Rake::Task.new(:features) do |t|
22
+ opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
23
+ opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
24
+ t.cucumber_opts = opts
25
+ t.fork = false
26
+ end
27
+
28
+ desc 'Run features tagged as work-in-progress (@wip)'
29
+ Cucumber::Rake::Task.new('features:wip') do |t|
30
+ tag_opts = ' --tags ~@pending'
31
+ tag_opts = ' --tags @wip'
32
+ t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
33
+ t.fork = false
34
+ end
35
+
36
+ task :cucumber => :features
37
+ task 'cucumber:wip' => 'features:wip'
38
+ task :wip => 'features:wip'
39
+ require 'rake/testtask'
40
+ Rake::TestTask.new do |t|
41
+ t.libs << "test"
42
+ t.test_files = FileList['test/*_test.rb']
43
+ end
44
+
45
+ task :default => [:test,:features]
46
+
47
+ task :install_gem do
48
+ puts "Uninstalling steam_donkey gem"
49
+ %x{gem uninstall steam_donkey --executables}
50
+ puts "Building steam_donkey gem"
51
+ %x{gem build ./steam_donkey.gemspec}
52
+ puts "Installing steam_donkey gem"
53
+ %x{gem install ./steam_donkey-0.1.0.gem}
54
+ end
data/bin/donkey ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gli'
3
+ begin # XXX: Remove this begin/rescue before distributing your app
4
+ require 'steam_donkey'
5
+ require 'inifile'
6
+ rescue LoadError
7
+ STDERR.puts "In development, you need to use `bundle exec bin/steam_donkey` to run your app"
8
+ STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
9
+ STDERR.puts "Feel free to remove this message from bin/steam_donkey now"
10
+ exit 64
11
+ end
12
+
13
+ include GLI::App
14
+
15
+ program_desc 'Tools and scripts for building and managing infrastructure on AWS'
16
+
17
+ version SteamDonkey::VERSION
18
+
19
+ # sort_help :manually
20
+ subcommand_option_handling :normal
21
+ arguments :strict
22
+ # hide_commands_without_desc true
23
+
24
+ switch [:v, :verbose], :negatable => false, :desc => "Toggle verbose output"
25
+
26
+ flag :profile, :desc => "AWS profile name"
27
+ flag :region, :desc => "AWS region"
28
+
29
+ commands_from "steam_donkey/commands"
30
+
31
+ pre do |global, command, options, args|
32
+ SteamDonkey::Config.load('~/.donkeyrc', global)
33
+ true
34
+ end
35
+
36
+ post do |global, command, options, args|
37
+ end
38
+
39
+ on_error do |exception|
40
+ true
41
+ end
42
+
43
+ exit run(ARGV)
@@ -0,0 +1,8 @@
1
+ Feature: My bootstrapped app kinda works
2
+ In order to get going on coding my awesome app
3
+ I want to have aruba and cucumber setup
4
+ So I don't have to do it myself
5
+
6
+ Scenario: App just runs
7
+ When I get help for "steam_donkey"
8
+ Then the exit status should be 0
@@ -0,0 +1,6 @@
1
+ When /^I get help for "([^"]*)"$/ do |app_name|
2
+ @app_name = app_name
3
+ step %(I run `#{app_name} help`)
4
+ end
5
+
6
+ # Add more step definitions here
@@ -0,0 +1,15 @@
1
+ require 'aruba/cucumber'
2
+
3
+ ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
4
+ LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
5
+
6
+ Before do
7
+ # Using "announce" causes massive warnings on 1.9.2
8
+ @puts = true
9
+ @original_rubylib = ENV['RUBYLIB']
10
+ ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
11
+ end
12
+
13
+ After do
14
+ ENV['RUBYLIB'] = @original_rubylib
15
+ end
@@ -0,0 +1,2 @@
1
+ Resources:
2
+ Hello: World
@@ -0,0 +1,2 @@
1
+ Resources:
2
+ Hello: World
@@ -0,0 +1,2 @@
1
+ StackURL: ./1/child1.template
2
+ StackURL: ./child2.template
@@ -0,0 +1,12 @@
1
+ require 'steam_donkey/version.rb'
2
+ require 'steam_donkey/aws.rb'
3
+ require 'steam_donkey/config.rb'
4
+ require 'steam_donkey/resource_listing.rb'
5
+ require 'steam_donkey/ec2/instance_listing.rb'
6
+ require 'steam_donkey/cloudformation/stack_listing.rb'
7
+ require 'steam_donkey/cloudformation/exports_listing.rb'
8
+ require 'steam_donkey/cloudformation/event_log.rb'
9
+ require 'steam_donkey/cloudformation/deploy_stack.rb'
10
+ require 'steam_donkey/cloudformation/package.rb'
11
+ require 'steam_donkey/cli/output.rb'
12
+