homeseed 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -27
- data/bin/homeseed +1 -1
- data/lib/homeseed/connection.rb +3 -1
- data/lib/homeseed/homeshick.rb +17 -21
- data/lib/homeseed/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4e2162e7ab5ff24a5c7ec699b97b85146e13157
|
4
|
+
data.tar.gz: 974de6e59cd38fdb4be2c386d0a3503369486ea8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad123e26a1ca61a73e857b77596381aadd50e8db8618a40cf37daa731391396680203b555f27571e53bcf824cdb31862d256dcd68334ecee9726a11ad5199d9
|
7
|
+
data.tar.gz: 5659bc5ab5dfb8d30faf645941ce19791378d8fac877c00cfb1d3a7a8e65e0b1ee526ee36539d8be3f86efe7bebca951954c3afcb2289953523d71558fa2b144
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
## Usage
|
21
21
|
|
22
22
|
homeseed commands
|
23
|
-
```
|
23
|
+
```bash
|
24
24
|
$ homeseed
|
25
25
|
Commands:
|
26
26
|
homeseed exec [-e <command> or -f <files>] [-u <user>] [-p <has_password>] -s, --servers=SERVERS # executes bash login session(s) on remote servers to run inline bash commands or bash ...
|
@@ -31,46 +31,34 @@ Commands:
|
|
31
31
|
```
|
32
32
|
|
33
33
|
to distribute and install your dot profile(s) on multiple of servers run
|
34
|
-
```
|
34
|
+
```bash
|
35
35
|
$ homeseed plant -s blackberry,blueberry,raspberry
|
36
36
|
```
|
37
|
-
this uses
|
38
|
-
```
|
37
|
+
this uses your user's local $HOME/.homeseed.yml by default; a url can be given instead to override this
|
38
|
+
```bash
|
39
39
|
$ homeseed plant -s pom --url 'i_am_a_homeseed.yml_file'
|
40
40
|
```
|
41
41
|
localhost can be specified as the target for system initialization
|
42
|
-
```
|
42
|
+
```bash
|
43
43
|
$ homeseed exec -s localhost --url 'setup_bluez_mupen_and_such.yml'
|
44
44
|
```
|
45
45
|
|
46
|
-
|
47
|
-
```
|
48
|
-
homeshick:
|
49
|
-
clone:
|
50
|
-
- https://github.com/rbuchss/terminator.git --batch
|
51
|
-
- https://github.com/rbuchss/vim-4-eva.git --batch
|
52
|
-
link:
|
53
|
-
- terminator --force
|
54
|
-
- vim-4-eva --force
|
55
|
-
```
|
56
|
-
|
57
|
-
to update run; uses $HOME/.homeup.yml (same url based overrides apply here as well)
|
58
|
-
```
|
46
|
+
to update run; uses $HOME/.homeseed.yml by default (same url based overrides apply here as well)
|
47
|
+
```bash
|
59
48
|
$ homeseed update -s soho
|
60
49
|
```
|
61
50
|
localhost can be specified here as well
|
62
|
-
```
|
51
|
+
```bash
|
63
52
|
$ homeseed update -s localhost
|
64
53
|
```
|
65
54
|
|
66
|
-
ex $HOME/.
|
67
|
-
```
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
-
|
73
|
-
- vim-4-eva --force
|
55
|
+
ex user config ($HOME/.homeseed.yml)
|
56
|
+
```ruby
|
57
|
+
:repos:
|
58
|
+
terminator:
|
59
|
+
:origin: https://github.com/rbuchss/terminator.git
|
60
|
+
vim-4-eva:
|
61
|
+
:origin: https://github.com/rbuchss/vim-4-eva.git
|
74
62
|
```
|
75
63
|
|
76
64
|
## Contributing
|
data/bin/homeseed
CHANGED
@@ -34,7 +34,7 @@ module Homeseed
|
|
34
34
|
method_option :servers, required: true, aliases: '-s', desc: 'ssh hostname(s) or localhost; csv if multiple'
|
35
35
|
method_option :user, aliases: '-u', desc: 'ssh username', default: ENV['USER']
|
36
36
|
method_option :has_password, aliases: '-p', type: :boolean, default: false, desc: 'connection uses password; no ssh keys'
|
37
|
-
method_option :clean, type: :boolean, default:
|
37
|
+
method_option :clean, alias: '-c', type: :boolean, default: false, desc: 'clean install toogle'
|
38
38
|
method_option :url, desc: "url to use vs file default: #{ENV['HOME']}/.homeseed.yml"
|
39
39
|
def plant
|
40
40
|
homeshick = Homeseed::Homeshick.new options
|
data/lib/homeseed/connection.rb
CHANGED
@@ -71,11 +71,13 @@ module Homeseed
|
|
71
71
|
combined_key = [current_key, new_key].delete_if { |k| k == '' }.join(" ")
|
72
72
|
process_hash(commands, combined_key, value)
|
73
73
|
end
|
74
|
-
|
74
|
+
elsif obj.is_a?(Array)
|
75
75
|
obj.each do |value|
|
76
76
|
combined_key = [current_key, value].delete_if { |k| k == '' }.join(" ")
|
77
77
|
commands << combined_key
|
78
78
|
end
|
79
|
+
else
|
80
|
+
commands
|
79
81
|
end
|
80
82
|
end
|
81
83
|
|
data/lib/homeseed/homeshick.rb
CHANGED
@@ -2,7 +2,7 @@ module Homeseed
|
|
2
2
|
class Homeshick < Connection
|
3
3
|
include Logging
|
4
4
|
|
5
|
-
EXEC_PATH = '$HOME/.homesick/repos/homeshick/bin/homeshick
|
5
|
+
EXEC_PATH = '$HOME/.homesick/repos/homeshick/bin/homeshick'
|
6
6
|
|
7
7
|
def initialize(params={})
|
8
8
|
super
|
@@ -13,36 +13,32 @@ module Homeseed
|
|
13
13
|
@config_files = Array[config_file_path('homeshick-install.yml')]
|
14
14
|
@config_files.unshift(config_file_path('homeshick-prep.yml')) if params[:clean]
|
15
15
|
push_commands(files: @config_files)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
exec(params.merge(user_config: :local, file: '.homeseed.yml'))
|
16
|
+
fetch_user_config(params)
|
17
|
+
user_commands = @user_config[:repos].map do |repo_name,repo_meta|
|
18
|
+
"#{EXEC_PATH} clone #{repo_meta[:origin]} --batch && #{EXEC_PATH} symlink #{repo_name} --force"
|
20
19
|
end
|
20
|
+
push_commands(command: user_commands)
|
21
|
+
exec
|
21
22
|
end
|
22
23
|
|
23
24
|
def update(params={})
|
24
25
|
fetch_user_config(params)
|
25
|
-
|
26
|
-
|
27
|
-
else
|
28
|
-
exec(params.merge(user_config: :local, file: '.homeup.yml'))
|
26
|
+
user_commands = @user_config[:repos].map do |repo_name,repo_meta|
|
27
|
+
"#{EXEC_PATH} pull #{repo_name} --batch && #{EXEC_PATH} symlink #{repo_name} --force"
|
29
28
|
end
|
29
|
+
push_commands(command: user_commands)
|
30
|
+
exec
|
30
31
|
end
|
31
32
|
|
32
33
|
def fetch_user_config(params={})
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
if params[:url]
|
35
|
+
response = HTTParty.get(params[:url])
|
36
|
+
raise HTTPartyError unless response.code == 200
|
37
|
+
@user_config = YAML.load(response.body)
|
38
|
+
else
|
39
|
+
file = File.expand_path('.homeseed.yml', ENV['HOME'])
|
40
|
+
@user_config = YAML.load_file(file)
|
39
41
|
end
|
40
|
-
@commands.map! { |command| command.gsub(/^homeshick /, EXEC_PATH) }
|
41
|
-
end
|
42
|
-
|
43
|
-
def exec(params={})
|
44
|
-
fetch_user_config(params)
|
45
|
-
super
|
46
42
|
end
|
47
43
|
end
|
48
44
|
end
|
data/lib/homeseed/version.rb
CHANGED