catfish 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/README.md +0 -1
- data/lib/catfish/cli.rb +9 -1
- data/lib/catfish/cli/init.rb +6 -5
- data/lib/catfish/cli/plugin.rb +19 -0
- data/lib/catfish/cli/provision.rb +0 -9
- data/lib/catfish/cli/resolve.rb +2 -3
- data/lib/catfish/dsl.rb +6 -1
- data/lib/catfish/templates/Catfishfile.tt +4 -0
- data/lib/catfish/templates/Vagrantfile.tt +0 -1
- data/lib/catfish/version.rb +1 -1
- metadata +2 -5
- data/.vagrant/machines/10.52.100.79/managed/id +0 -1
- data/.vagrant/machines/10.52.100.79/managed/index_uuid +0 -1
- data/.vagrant/machines/10.52.101.106/managed/id +0 -1
- data/.vagrant/machines/10.52.101.106/managed/index_uuid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b209bc38fa7845bde7d77a923adbc95afde6e6a
|
4
|
+
data.tar.gz: 730626a1fde2ec8806945bfae9ae629133695b80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 532e16b65a907c6b86cb9e780d429b75991988cf815d644cab49b248235f9209c7161b8f759fd71d1171c36f82cba39cefa563c82ee9b9650fb1d4ea74b8d178
|
7
|
+
data.tar.gz: eae765e3a7a0ae3f15c1d8b6f087cb67238f270dee1d14f8b126b2635305573ab0ae9b60d68922f69312947bf20db4b9250a7382c07bd3a314cc3d6fac9d82ce
|
data/.gitignore
CHANGED
data/README.md
CHANGED
data/lib/catfish/cli.rb
CHANGED
@@ -38,6 +38,7 @@ module Catfish
|
|
38
38
|
method_option 'ssh-username', type: :string, banner: 'SSH username'
|
39
39
|
method_option 'ssh-private-key-path', type: :string, banner: 'Path to SSH private key'
|
40
40
|
method_option 'servers', type: :array, banner: 'Initial list of servers to include in Catfishfile'
|
41
|
+
method_option 'plugins', type: :array, banner: 'Vagrant plugins to be installed'
|
41
42
|
def init
|
42
43
|
require 'catfish/cli/init'
|
43
44
|
Init.new(options.dup, self).run
|
@@ -46,7 +47,13 @@ module Catfish
|
|
46
47
|
desc 'resolve [OPTIONS]', 'Resolves the servers listed in Catfishfile to .lock'
|
47
48
|
def resolve
|
48
49
|
require 'catfish/cli/resolve'
|
49
|
-
Resolve.new(options.dup
|
50
|
+
Resolve.new(options.dup).run
|
51
|
+
end
|
52
|
+
|
53
|
+
desc 'plugin', 'Install plugins defined in Catfishfile'
|
54
|
+
def plugin
|
55
|
+
require 'catfish/cli/plugin'
|
56
|
+
Plugin.new(options.dup).run
|
50
57
|
end
|
51
58
|
|
52
59
|
desc 'provision [OPTIONS]', 'Provision to the servers specified in Catfishfile.lock'
|
@@ -54,6 +61,7 @@ module Catfish
|
|
54
61
|
method_option 'parallel', type: :boolean, default: 'false', banner: 'Run provisioning in parallel'
|
55
62
|
def provision
|
56
63
|
invoke :resolve
|
64
|
+
invoke :plugin
|
57
65
|
require 'catfish/cli/provision'
|
58
66
|
Provision.new(options.dup).run
|
59
67
|
end
|
data/lib/catfish/cli/init.rb
CHANGED
@@ -17,14 +17,15 @@ module Catfish
|
|
17
17
|
}
|
18
18
|
|
19
19
|
opts = {
|
20
|
-
provisioners: options[:provisioners]
|
21
|
-
shell_paths: options['shell-paths']
|
22
|
-
communicator: options[:communicator]
|
20
|
+
provisioners: options[:provisioners] || [],
|
21
|
+
shell_paths: options['shell-paths'] || ['{{PATH_TO_YOUR_SCRIPT}}'],
|
22
|
+
communicator: options[:communicator] || 'ssh',
|
23
23
|
winrm_username: options['winrm-username'] || '{{YOUR_WINRM_USERNAME}}',
|
24
24
|
winrm_password: options['winrm-password'] || '{{YOUR_WINRM_PASSWORD}}',
|
25
|
-
ssh_username: options['ssh-username']
|
25
|
+
ssh_username: options['ssh-username'] || '{{YOUR_SSH_USERNAME}}',
|
26
26
|
ssh_private_key_path: options['ssh-private-key-path'] || '{{PATH_TO_YOUR_SSH_PRIVATE_KEY}}',
|
27
|
-
servers: options['servers']
|
27
|
+
servers: options['servers'] || [],
|
28
|
+
plugins: options['plugins'] || []
|
28
29
|
}
|
29
30
|
|
30
31
|
templates.each do |src, dst|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Catfish
|
2
|
+
class CLI::Plugin
|
3
|
+
attr_reader :options
|
4
|
+
|
5
|
+
def initialize(options)
|
6
|
+
@options = options
|
7
|
+
end
|
8
|
+
|
9
|
+
def run
|
10
|
+
puts 'Installing plugins'
|
11
|
+
builder = Dsl.new
|
12
|
+
builder.eval_catfishfile
|
13
|
+
|
14
|
+
builder.plugins.each do |plugin|
|
15
|
+
system("vagrant plugin install #{plugin}") unless `vagrant plugin list`.include? plugin
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -9,7 +9,6 @@ module Catfish
|
|
9
9
|
def run
|
10
10
|
p 'Provisioning to servers using Catfishfile.lock'
|
11
11
|
vagrant_version
|
12
|
-
vagrant_plugins
|
13
12
|
begin
|
14
13
|
# Connect to the servers. The --provider=managed is the key here.
|
15
14
|
system("vagrant up --provider=#{options[:provider]}")
|
@@ -37,14 +36,6 @@ module Catfish
|
|
37
36
|
fail "#{vagrant_version} or greater is a prerequisite" unless `vagrant --version`.include? vagrant_version
|
38
37
|
end
|
39
38
|
|
40
|
-
def vagrant_plugins
|
41
|
-
# Make sure that the vagrant-managed-servers plugin is installed
|
42
|
-
plugins = ['vagrant-managed-servers']
|
43
|
-
plugins.each do |plugin|
|
44
|
-
system("vagrant plugin install #{plugin}") unless `vagrant plugin list`.include? plugin
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
39
|
def provision
|
49
40
|
if options[:parallel]
|
50
41
|
machines = status.split("\n").collect do |line|
|
data/lib/catfish/cli/resolve.rb
CHANGED
data/lib/catfish/dsl.rb
CHANGED
@@ -5,10 +5,11 @@ module Catfish
|
|
5
5
|
builder.eval_catfishfile
|
6
6
|
end
|
7
7
|
|
8
|
-
attr_accessor :servers
|
8
|
+
attr_accessor :servers, :plugins
|
9
9
|
|
10
10
|
def initialize
|
11
11
|
@servers = []
|
12
|
+
@plugins = ['vagrant-managed-servers']
|
12
13
|
end
|
13
14
|
|
14
15
|
def eval_catfishfile
|
@@ -20,5 +21,9 @@ module Catfish
|
|
20
21
|
def server(name, *_args)
|
21
22
|
servers << name
|
22
23
|
end
|
24
|
+
|
25
|
+
def plugin(name, *_args)
|
26
|
+
plugins << name
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
data/lib/catfish/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: catfish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Baldauf
|
@@ -76,10 +76,6 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- .gitignore
|
78
78
|
- .rubocop.yml
|
79
|
-
- .vagrant/machines/10.52.100.79/managed/id
|
80
|
-
- .vagrant/machines/10.52.100.79/managed/index_uuid
|
81
|
-
- .vagrant/machines/10.52.101.106/managed/id
|
82
|
-
- .vagrant/machines/10.52.101.106/managed/index_uuid
|
83
79
|
- Gemfile
|
84
80
|
- LICENSE
|
85
81
|
- README.md
|
@@ -89,6 +85,7 @@ files:
|
|
89
85
|
- lib/catfish.rb
|
90
86
|
- lib/catfish/cli.rb
|
91
87
|
- lib/catfish/cli/init.rb
|
88
|
+
- lib/catfish/cli/plugin.rb
|
92
89
|
- lib/catfish/cli/provision.rb
|
93
90
|
- lib/catfish/cli/resolve.rb
|
94
91
|
- lib/catfish/dsl.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
10.52.100.79
|
@@ -1 +0,0 @@
|
|
1
|
-
43c409ec41664be6a0323efe51fadc38
|
@@ -1 +0,0 @@
|
|
1
|
-
10.52.101.106
|
@@ -1 +0,0 @@
|
|
1
|
-
64a8ed314d0748a9b5567f5e122dad48
|