management 1.3 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Minimalist EC2 configuration & deployment tool.
4
4
 
5
- - Version: **1.3**
6
-
7
5
  [![Build Status](https://travis-ci.org/sdegutis/management.svg?branch=master)](https://travis-ci.org/sdegutis/management)
8
6
  [![Dependency Status](https://gemnasium.com/sdegutis/management.svg)](https://gemnasium.com/sdegutis/management)
9
7
  [![Code Climate](https://codeclimate.com/github/sdegutis/management.png)](https://codeclimate.com/github/sdegutis/management)
@@ -71,7 +69,7 @@ Put this in `management_config.yml` at the root of some project:
71
69
  flavor_id: m1.small
72
70
  key_name: my-ssh-key-name
73
71
  groups: ["web"]
74
- ssh_key_path: resources/my-ssh-key
72
+ ssh_key_path: resources/keys/id_rsa_aws
75
73
 
76
74
  scripts:
77
75
  setup-web:
@@ -87,18 +85,21 @@ Management doesn't care where any of your files are, with the exception of
87
85
  root. Here's the relevant part of the file structure that the above
88
86
  sample config assumes:
89
87
 
90
- ./my-project
91
- |-- management_config.yml
92
- `-- resources
93
- |-- files
94
- | |-- nginx.conf
95
- | `-- web.conf.erb
96
- |-- keys
97
- | |-- id_rsa_digitalocean
98
- | `-- id_rsa_digitalocean.pub
99
- `-- scripts
100
- |-- bootstrap_base.sh
101
- `-- start_web_server.sh
88
+ $ tree my-project/
89
+ my-project/
90
+ ├── management_config.yml
91
+ └── resources
92
+ ├── files
93
+ │   ├── nginx.conf
94
+ │   └── web.conf.erb
95
+ ├── keys
96
+ │   ├── id_rsa_aws
97
+ │   └── id_rsa_aws.pub
98
+ └── scripts
99
+ ├── bootstrap_base.sh
100
+ └── start_web_server.sh
101
+
102
+ 4 directories, 7 files
102
103
 
103
104
  #### Details
104
105
 
@@ -1,4 +1,3 @@
1
- require_relative 'ext/fog'
2
1
  require_relative 'management/version'
3
2
  require_relative 'management/interpreter'
4
3
  require_relative 'management/helper'
@@ -1,8 +1,4 @@
1
1
  require_relative '../command'
2
- require 'tmpdir'
3
- require 'fileutils'
4
- require 'erb'
5
- require 'shellwords'
6
2
 
7
3
  module Management
8
4
 
@@ -11,6 +7,11 @@ module Management
11
7
  include Management::Helper
12
8
 
13
9
  def run(server_name, script_name)
10
+ require 'tmpdir'
11
+ require 'fileutils'
12
+ require 'erb'
13
+ require 'shellwords'
14
+
14
15
  server = get_server(server_name)
15
16
  script = get_script(script_name)
16
17
 
@@ -1,6 +1,3 @@
1
- require 'fog'
2
- require 'yaml'
3
-
4
1
  module Management
5
2
 
6
3
  module Helper
@@ -40,6 +37,8 @@ module Management
40
37
  end
41
38
 
42
39
  def cloud
40
+ require 'fog'
41
+ require_relative '../ext/fog'
43
42
  @cloud ||= Fog::Compute.new(config[:cloud])
44
43
  end
45
44
 
@@ -52,6 +51,7 @@ module Management
52
51
  private
53
52
 
54
53
  def raw_yaml
54
+ require 'yaml'
55
55
  YAML.load(File.read("management_config.yml"))
56
56
  end
57
57
 
@@ -1,8 +1,8 @@
1
- require 'optparse'
2
-
3
1
  module Management
4
2
 
5
3
  def self.interpret!(argv)
4
+ require 'optparse'
5
+
6
6
  commands = Management::Command.all
7
7
 
8
8
  parser = OptionParser.new do |opts|
@@ -11,8 +11,8 @@ module Management
11
11
  opts.separator('Commands:')
12
12
  commands.each { |command| opts.separator command.help_string }
13
13
  opts.separator('')
14
- opts.on('-h', '--help', 'Display this screen') { puts opts; exit }
15
- opts.on('-v', '--version', 'Show version') { puts Management::VERSION; exit }
14
+ opts.on('-h', '--help', 'Display this screen') { abort opts.to_s }
15
+ opts.on('-v', '--version', 'Show version') { abort Management::VERSION }
16
16
  end
17
17
 
18
18
  abort parser.help if argv.empty?
@@ -1,3 +1,3 @@
1
1
  module Management
2
- VERSION = "1.3"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -3,7 +3,8 @@ require 'fakefs/spec_helpers'
3
3
  require 'stringio'
4
4
  require 'pry'
5
5
  require 'etc'
6
-
6
+ require 'yaml'
7
+ require 'timeout'
7
8
 
8
9
  SampleConfig = <<EOC
9
10
  cloud:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: management
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-12 00:00:00.000000000 Z
12
+ date: 2014-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog