sumodev 1.2.1 → 1.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/sumodev/commands/box.rb +87 -95
- data/lib/sumodev/commands/push.rb +3 -2
- data/lib/sumodev/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c20744ac1395f180d04f4b07a8b13406858a93ab
|
4
|
+
data.tar.gz: 1c55c3b01c438bb45b67abe872ed932e58a8e75e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f89cfbb8b39610708613f4b1c228e161bd1072d4f6659fe6b23ca11d2d8e95ffd1aa4c98f75cd23ad7ba26f26aa1f31b654c244897e7e85afa10ba3b0e21f6d
|
7
|
+
data.tar.gz: d0afac6d94889ab2ebe2f7becb51852baec0e54e2f37031effd62addcec5bd0d6a3f3fce2a65d8eb5ae4623451d6f0a91d49e0f5fffe11f07f9740bbf8ba521f
|
data/lib/sumodev/commands/box.rb
CHANGED
@@ -1,95 +1,87 @@
|
|
1
|
-
require 'sumodev/command'
|
2
|
-
require 'sumodev/config'
|
3
|
-
require 'sumodev/sumofile'
|
4
|
-
|
5
|
-
class Sumodev::Commands::Box < Sumodev::Command
|
6
|
-
namespace :box
|
7
|
-
|
8
|
-
no_commands do
|
9
|
-
def box_path
|
10
|
-
possible_paths = [
|
11
|
-
Dir.pwd,
|
12
|
-
Sumodev::Config.get('SUMO_VAGRANT_PATH')
|
13
|
-
]
|
14
|
-
|
15
|
-
vagrantfile = possible_paths.detect do |path|
|
16
|
-
File.file?(File.join(File.expand_path(path), "Vagrantfile"))
|
17
|
-
end || raise("No Vagrant file found in #{possible_paths.join(', ')}")
|
18
|
-
|
19
|
-
File.expand_path(vagrantfile)
|
20
|
-
end
|
21
|
-
|
22
|
-
def run_vagrant_command(command, *arguments)
|
23
|
-
# See https://github.com/mitchellh/vagrant/issues/5199#issuecomment-73278236
|
24
|
-
if ["reload", "halt"].include?(command.split(" ")[0])
|
25
|
-
system "rm -rf #{box_path}/.vagrant/machines/*/virtualbox/synced_folders"
|
26
|
-
end
|
27
|
-
system "cd #{box_path}; vagrant #{command} #{arguments.join(' ')}"
|
28
|
-
end
|
29
|
-
|
30
|
-
def box_running?
|
31
|
-
output = `cd #{box_path}; vagrant status`
|
32
|
-
output =~ /The VM is running/
|
33
|
-
end
|
34
|
-
|
35
|
-
def
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
say("
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
class_eval <<-VAGRANT_METHOD
|
89
|
-
desc '#{method}', 'Runs the #{method} vagrant command'
|
90
|
-
def #{method}(*args)
|
91
|
-
run_vagrant_command("#{method} \#{args.join(' ')}")
|
92
|
-
end
|
93
|
-
VAGRANT_METHOD
|
94
|
-
end
|
95
|
-
end
|
1
|
+
require 'sumodev/command'
|
2
|
+
require 'sumodev/config'
|
3
|
+
require 'sumodev/sumofile'
|
4
|
+
|
5
|
+
class Sumodev::Commands::Box < Sumodev::Command
|
6
|
+
namespace :box
|
7
|
+
|
8
|
+
no_commands do
|
9
|
+
def box_path
|
10
|
+
possible_paths = [
|
11
|
+
Dir.pwd,
|
12
|
+
Sumodev::Config.get('SUMO_VAGRANT_PATH')
|
13
|
+
]
|
14
|
+
|
15
|
+
vagrantfile = possible_paths.detect do |path|
|
16
|
+
File.file?(File.join(File.expand_path(path), "Vagrantfile"))
|
17
|
+
end || raise("No Vagrant file found in #{possible_paths.join(', ')}")
|
18
|
+
|
19
|
+
File.expand_path(vagrantfile)
|
20
|
+
end
|
21
|
+
|
22
|
+
def run_vagrant_command(command, *arguments)
|
23
|
+
# See https://github.com/mitchellh/vagrant/issues/5199#issuecomment-73278236
|
24
|
+
if ["reload", "halt"].include?(command.split(" ")[0])
|
25
|
+
system "rm -rf #{box_path}/.vagrant/machines/*/virtualbox/synced_folders"
|
26
|
+
end
|
27
|
+
system "cd #{box_path}; vagrant #{command} #{arguments.join(' ')}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def box_running?
|
31
|
+
output = `cd #{box_path}; vagrant status`
|
32
|
+
output =~ /The VM is running/
|
33
|
+
end
|
34
|
+
|
35
|
+
def convert_sumofile_into_env_variables
|
36
|
+
sumofile_path = Dir.pwd + "/Sumofile"
|
37
|
+
|
38
|
+
file = Sumodev::Sumofile.from_file sumofile_path
|
39
|
+
file.convert_into_json_file
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
desc 'up', "Starts the Vagrant-box"
|
44
|
+
def up
|
45
|
+
say("There is already a box running, you should manually start the box. Or halt the running instance", :red) && exit(1) if box_running?
|
46
|
+
|
47
|
+
convert_sumofile_into_env_variables
|
48
|
+
run_vagrant_command("up", "--provision")
|
49
|
+
rescue Sumodev::Sumofile::NoSuchFileError
|
50
|
+
say("No Sumofile found! Please define one so the correct versions will be used!", :red) && exit(1)
|
51
|
+
end
|
52
|
+
|
53
|
+
desc 'install', "Installs everything required to use the box command"
|
54
|
+
def install
|
55
|
+
# install vagrant plugins
|
56
|
+
%x(vagrant plugin install vagrant-share)
|
57
|
+
%x(vagrant plugin install vagrant-berkshelf)
|
58
|
+
|
59
|
+
# install .sumorc file
|
60
|
+
File.open(File.expand_path("~/.sumorc"), 'w') do |f|
|
61
|
+
f.write <<-SUMORC
|
62
|
+
export SUMO_VAGRANT_PATH=""
|
63
|
+
SUMORC
|
64
|
+
end unless File.exists?(File.expand_path("~/.sumorc"))
|
65
|
+
|
66
|
+
# setup resolver
|
67
|
+
File.open("/tmp/vagrant-resolver", 'w') do |f|
|
68
|
+
f.write <<-RESOLVER
|
69
|
+
# Created by sumo command
|
70
|
+
nameserver 10.11.12.13
|
71
|
+
port 53
|
72
|
+
RESOLVER
|
73
|
+
end
|
74
|
+
|
75
|
+
%x(sudo mv /tmp/vagrant-resolver /etc/resolver/vagrant)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Vagrant commands
|
79
|
+
%w(halt provision resume reload ssh status suspend).each do |method|
|
80
|
+
class_eval <<-VAGRANT_METHOD
|
81
|
+
desc '#{method}', 'Runs the #{method} vagrant command'
|
82
|
+
def #{method}(*args)
|
83
|
+
run_vagrant_command("#{method} \#{args.join(' ')}")
|
84
|
+
end
|
85
|
+
VAGRANT_METHOD
|
86
|
+
end
|
87
|
+
end
|
@@ -12,12 +12,13 @@ class Sumodev::Commands::Push < Thor::Group
|
|
12
12
|
Tijs = {:groups => ['admin', 'developer', 'root'], :identity => 'tijs@sumocoders.be', :key => 'AAAAB3NzaC1yc2EAAAABIwAAAQEAueoZUITVE/YVZVZVi4cngE7FPK5+a3mt0mTtELdFM4JmXg7UmrQ1On2IwIdHw5Cq+VnrutRgWvQkfp+WaC2tzOrlzccpMeMv5lTRH7bRp6qR4FivJ/Aq7YeUrNJpzncUVTwyeHrveuhfCxEQoOIM2gN0Y54NGDTOp01D7GHApsYkObsw/3N7jgQVoL6xKPwRTMI52tFzUlkv+df78vx87X7bYK05dO4Ol8U0yFyKlV17+BEM4UuI/aTXhkNsBVNCqiksaqQwEGDK8IqyrNFYhbRwYDunTXc8zdd6imYfEJUSNdjOzTXUNUc15ssTMBsGpfvF/2bhYRlHuRWZP9BUqw==', :protocol => 'rsa'}
|
13
13
|
Jens = {:groups => ['admin', 'root'], :identity => 'jens@dehaese.eu', :key => 'AAAAB3NzaC1yc2EAAAABIwAAAIEAojZQXjhcy3fpHNEBqlj2C3EV+G+vOTSBvcn+U3Sq7eml+NrQqGoasAvC+c6bajJTRB0ZujynsUAWghDM43zY1SIbZl6PC0jdZg7qGjzlpOFdG96b84agiE6Dnz8Mjnb6846tJdslRV2Yyc9Y8iSgW3s3mszmW2hqHpZ4EqbVuPc=', :protocol => 'rsa'}
|
14
14
|
Mathias = {:groups => ['developer'], :identity => 'mathias@sumocoders.be', :key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDLBHWXILbcsYfoDYCgJq4B3Q9ElcZq0hRWo8otXWsOP1pYU8Kq2thWbIB+RkuZr8Y7DMI2XtGXSquWJdx0Beddxt+yVoE/eReorVuB74bnEVXYtcZ8+mNHU6paC1T4XHMWjEXSgaEaSPdxnQxPPzQ+YDuJkYWaCrLxDyWe4sqio0R5SA5CasTkei5dHIfIzj8a16JvTj/FlbNrGHzdSwWY04QoSRdN3rpWJ4krzlHz5NIJmBhUxW15d9NgmKPGJYHmUyY1nfXdb82/zUS1vt6A/46hMJzRXhQuxzNVNBFN2q8d/bXhsNW6AZ467auWO3NLBUOfGHMX+Ga6FQiyCdhd', :protocol => 'rsa'}
|
15
|
-
Jonas = {:groups => ['developer'], :identity => 'jonas@sumocoders.be', :key => '
|
15
|
+
Jonas = {:groups => ['developer'], :identity => 'jonas@sumocoders.be', :key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQCtGlJ6rNof3BcHTh7mPELGfVOThfP9LnRZOXHYnzahok1XjWxhQlafdJYblFyhnC0qpo0IqHO6dqNzYXq3JAXDRT2b3Cuq7M1v9f91Fk3EVtP53k+Q8FdFSgjdGZj/JhrP3Y7yctXKXaUCpqBBTaVd+Wy2KEIPHBAmspCAKHcbrBmOUzuWhREI5+ZU3SQ85c8fkTFifln2Tlrc15StfgwQ/epAMZYuYzWZLwfamBLqQCGTIfUNMF4JdFiuQuDLr5enH3d5gM8GjQr/Z17K8MLZhNmKhqrlTOJfX8egD82TL/SYNpkHgnmyYfj4MF85zu5JuaR2Ab18gAYVyoCJfAzR', :protocol => 'rsa'}
|
16
16
|
Jelmer = {:groups => ['developer'], :identity => 'jelmer@sumocoders.be', :key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDEPm7EZctIAbdiTYIL/Oelaqiu39JjrSqxD0N80m66w/KLdvQiAEPWRinBKPCzBsmcMKuA0MMoDzykTLgNsVoAnR5hzAOJeL96803vN3FC/LeJw09Mcrh1WXoY6T5KLZFcPuaxwwx4IASWgbTEHetmJVtMey423phs1X1feT6QQaHeh3ryAe3qaMs1Z7ksOEsyifUOC67Aa/G0IbP3QJlYOk1wtLvQ+4+uIoyG3BJ9RM17gMrHMTBH2eUc/Tk4kYv/3LPlajwXb1U0fNNqgrWaOcsDoqsHShh+f0dPj83X1KTBp8FspTcm9ww7KaAjgvWwH6B3XIbsSAwgsQHNaWQj', :protocol => 'rsa'}
|
17
17
|
Daan = {:groups => ['developer'], :identity => 'daan@sumocoders.be', :key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQCfWibmP8Dc1GlR0x/PsmriYBcBg4GPjwpnuxrZ5G8vnFeYjXM5myZ2hFdRvzog/xO/wr+y42n4VQp5wjEw1QX8TvnmUJtEcczR930U5QSMXqiDJWRjFVXducJXfrERu2BonZUhMTaAxYnguSLkRmqBLeUIooDwKIPIaVVlkbW11H6Lk711/eZm+fdLXF732lzM5XA7pRZVpU1+PykMgQ8oJmJGCQmKIZQUh+qKDEjv9akiZt5jUu6jJkXb3lqtRMbgej5XacuXzebU2nW1OQZp3Qz4iBBA7pOfejgJWt1KN25dzfOA0vRZsfCxQav8sOP8ow4Mt1teJpDFgUH96n8x', :protocol => 'rsa'}
|
18
18
|
Wouter = {:groups => ['developer'], :identity => 'wouter@sumocoders.be', :key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDPMmfnXWFuuT9h/CRY+S4apJLbBfMpM6wZ1dcqtIk4O5P0rSmnXIZZpZP9XGxU5dP2+y6KGj+Egr4YZClKTHTgTcVEukW3n73c2ObCg5bCW+wJxvk3ns6G046rWACLIkX+Ben3YhBa09mXnPk0CRtzHUIrnMsExaxnaU/cJ7miF9gJq5pm8gwH0f0Ek7hWHtGVralEJX97wwey4rB/0js7YQqKjYtwtUncnVjRntyrLkIZ/gXnY9FZEqH+GGXho6yhqAT2+VkWdax+cyIZxvimfNcA7mCTStv/1pMSrrygMnONZ6TLDdJm+2THh9tRZ3UoWGQUlWJ1QnV5Ox2cVWvj', :protocol => 'rsa'}
|
19
19
|
Stijn = {:groups => ['developer'], :identity => 'stijn@sumocoders.be', :key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQD6OcLSJGrR8PQ4hCnPVrnyXbhiCQSeB2l8JitV1NcrbwxwZ15wh4xDNKhhUlIlxGnXWLLadOePEhJ2ESUjEm2x5FJ1p06Bj6rsEDGvKBtUjUq5PXFvKY8qoyc6jV1vjz6FXuZBHk7k9X5JIZhORAs1LcwCpOEQwsfjnJ1KGBanvcFbAIpRej4qlzAKcfDtykC8XTODlSgj6GSqLz65LY+SrdTDe2XZ4qHyntVXbnLjX9fRaVWInU8fkoKUkLogUTRXszAKUfqrJBI7em3FQqOu40gRrdzevS4vTbeNu+fe9rodVmlBKEFdbKELhppke7a/kN04vcATazXJOKoGh/v/', :protocol => 'rsa'}
|
20
20
|
Katrien = {:groups => ['developer'], :identity => 'katrien@sumocoders.be', :key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQCnIup0Q/3Ja/YQWrpg20yhWARfS3kdL2obssWvwlVOZv08vsxiH4S5KrYLQW5Fn5ethBsuKDb0yuZzFfsVkbv1uXMYRRqmEW+HnlF+tchsRqpVqUKNTWigtw3zeuDHDsk3GJzQHCpUI8ha/1CBZRre0oxYJCHYH8wslji33ZAn3HxbUH9Y+E3XnWjfrgK05oY5SVgbQ6bf0Fn1UZ3uai7+xh1kNPsUM3Rx91vdhhhQi4SesFwaslYB4gnG010fgp0Hn9DTV7P6Vk7AFVWRw12Zvmhi97BC9IglKP9qHYVf60gObbuuoXK5zBlIrRnbytm7ZXt/kVNT5OL+P5H9OLkt', :protocol => 'rsa'}
|
21
|
+
Dylan = {:groups => ['developer'], :identity => 'dylan@sumocoders.be', :key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDAYDY7+cZ1bJyD4VEhDru64KuuPzURoWeJblTI1bt/EESQPdIHKKqbMrxrL8l9C8ft++Dni70nKJy7foXHAirEO0SB/SXdcDKvr91mCmWRXCtZm54JptYU1sKP2Lpe1W2gdc5OazCzGhCI7mJoi/BuvcVOaK1EEB9dKR6cUm01tJ+CVonYSChiTors50MCFEyike5uq6TjDcVviHufmcxOTRJTd/0I5zCImGjhEXOydXU2DknxEbtPIlD94JLcMiOnmycOf4bPOOe4DF1XHgx5C4g+TKbmn5FjLIEyMZ3skGBSNh7HWBlAsUB4qilVkHfiq5ZP2JKEwGWmSw6XPMQ9', :protocol => 'rsa'}
|
21
22
|
|
22
23
|
def replace_keys
|
23
24
|
connect do |ssh|
|
@@ -59,7 +60,7 @@ class Sumodev::Commands::Push < Thor::Group
|
|
59
60
|
end
|
60
61
|
|
61
62
|
def users
|
62
|
-
[Jan, Tijs, Jens, Mathias, Jonas, Jelmer, Daan, Wouter, Stijn, Katrien]
|
63
|
+
[Jan, Tijs, Jens, Mathias, Jonas, Jelmer, Daan, Wouter, Stijn, Katrien, Dylan]
|
63
64
|
end
|
64
65
|
|
65
66
|
def authorized_users
|
data/lib/sumodev/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sumodev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan De Poorter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
116
|
+
rubygems_version: 2.5.1
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: SumoCoders Developers gem
|