houcho 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +35 -40
- data/lib/Conductor.rb +13 -4
- data/lib/houcho.rb +1 -1
- data/lib/houcho/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzYzYmQ5YzQzYmZjZTM1ODk1Yzk5Y2ExMmY3N2JjMGM3ZDk1YTIwYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWY1YjUyYmZjMmY5YjVhMDVjYjFhMzkxMWNhZDNhMTQ3ZTA4YzExNA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODFlOGNkZTA0OWJkZjI4MDgzMGI0NmFkOTIxMDgyMzkxYjgyYzhiZGJmZjk5
|
10
|
+
ZWQ5ODZiMGVkNjhjOTM4NWU2OWY0MTUyNmIwMzJiOTBhMGY3ZGU1N2JkNzk2
|
11
|
+
MDRlYWQwY2YzMGQ4YmQ0ZGYzMjAwMTNjOGI0ZTM5Zjk1NDk3YTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTUxMzQ3YzE1ZmEyZjk4ZmQyODVkZDc4ZGYwYmFhYTUxZmU5Zjg0YzYyZTZh
|
14
|
+
YmYwMmUzMGU3ZGQzZWRjNmI5YTUyOWU2NTU5MzA2YWQzMjA0NDY1ODc4YWMz
|
15
|
+
Y2QzZWQ5MGJhM2Q5ODc2OGQxNjIyYzQ2ZTMwM2I2ZDZhNDViNmE=
|
data/README.md
CHANGED
@@ -2,16 +2,15 @@
|
|
2
2
|
- wrapping to execute serverspec
|
3
3
|
|
4
4
|
## Install and Initialize
|
5
|
-
-
|
5
|
+
- install houcho from ruby gems
|
6
6
|
|
7
7
|
```sh
|
8
|
-
$
|
9
|
-
$ echo PATH=`pwd`'/houcho/bin:$PATH' >> ~/.bachrc
|
8
|
+
$ gem install houcho
|
10
9
|
```
|
11
10
|
|
12
|
-
-
|
11
|
+
- make working directory and initialize.
|
13
12
|
- このディレクトリ配下にrole情報やspecなどが蓄積されます。
|
14
|
-
- `houcho init
|
13
|
+
- `houcho init` `git init`されます。
|
15
14
|
|
16
15
|
```sh
|
17
16
|
$ mkdir houcho-repo
|
@@ -20,44 +19,40 @@ $ houcho init
|
|
20
19
|
```
|
21
20
|
|
22
21
|
## Simple Usage
|
23
|
-
-
|
22
|
+
- example of the most simplest use case
|
24
23
|
|
25
24
|
```sh
|
26
|
-
$ houcho spec exec --specs houcho_sample --hosts test.studio3104.com
|
25
|
+
$ houcho spec exec --specs houcho_sample --hosts test.studio3104.com
|
27
26
|
```
|
28
27
|
|
29
|
-
- `test.studio3104.com
|
30
|
-
- `--specs
|
31
|
-
- `--specs
|
32
|
-
|
28
|
+
- run `houcho_sample_spec.rb` ro `test.studio3104.com`
|
29
|
+
- arguments of `--specs` and `--hosts` are able to specify multiple space-delimited.
|
30
|
+
- argument of `--specs` is able to specify exception of `_spec.rb`, and relative path from `spec/` under working directory.
|
31
|
+
|
33
32
|
## Create Role, Run Role
|
34
33
|
よく使う組み合わせをroleとして定義しておくことが出来ます。
|
35
34
|
|
36
|
-
-
|
35
|
+
- create role at first.
|
37
36
|
|
38
|
-
|
37
|
+
```sh
|
38
|
+
$ houcho role create studio3104::www
|
39
|
+
```
|
39
40
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
```sh
|
48
|
-
$ houcho host attach www01.studio3104.com studio3104::www
|
49
|
-
$ houcho host attach www02.studio3104.com studio3104::www
|
50
|
-
```
|
41
|
+
- attach a host to role just created.
|
42
|
+
|
43
|
+
```sh
|
44
|
+
$ houcho host attach www01.studio3104.com studio3104::www
|
45
|
+
$ houcho host attach www02.studio3104.com studio3104::www
|
46
|
+
```
|
51
47
|
|
52
|
-
|
53
|
-
|
54
|
-
- simple usageと同じように、作業ディレクトリの`spec/`からの相対パスで、`_spec.rb`を除いて指定します。
|
48
|
+
- attach a spec to role.
|
49
|
+
- argument is able to specify exception of `_spec.rb`, and relative path from `spec/` under working directory same as simple usage.
|
55
50
|
|
56
|
-
|
57
|
-
$ houcho spec attach houcho_sample studio3104::www
|
58
|
-
|
51
|
+
```sh
|
52
|
+
$ houcho spec attach houcho_sample studio3104::www
|
53
|
+
```
|
59
54
|
|
60
|
-
-
|
55
|
+
- show details of a role just created.
|
61
56
|
|
62
57
|
```sh
|
63
58
|
$ houcho role details studio3104::www
|
@@ -71,25 +66,25 @@ studio3104::www
|
|
71
66
|
└─ houcho_sample
|
72
67
|
```
|
73
68
|
|
74
|
-
- role
|
75
|
-
|
69
|
+
- execute role.
|
70
|
+
- it can specify multiple space-delimited.
|
76
71
|
|
77
72
|
```sh
|
78
|
-
$ houcho spec exec --roles studio3104::www
|
73
|
+
$ houcho spec exec --roles studio3104::www
|
79
74
|
```
|
80
75
|
|
81
|
-
|
76
|
+
- it is also possible to use regular expressions.
|
82
77
|
|
83
78
|
```sh
|
84
|
-
$ houcho spec exec --roles studio3104.+
|
79
|
+
$ houcho spec exec --roles studio3104.+
|
85
80
|
```
|
86
|
-
|
81
|
+
|
87
82
|
|
88
83
|
## Include CloudForecast's yaml file
|
89
|
-
|
84
|
+
houcho can load yaml of CloudForecast, and attach to the role defined.
|
90
85
|
|
91
|
-
-
|
92
|
-
|
86
|
+
- install yaml of CloudForecast to `role/cloudforecast/` under working directory.
|
87
|
+
- 拡張子を`yaml`にしておく必要があります。
|
93
88
|
|
94
89
|
- cloudforecastのyamlを読み込みます。(例では`role/cloudforecast/houcho_sample.yaml`を読み込んでいます。)
|
95
90
|
- yamlを置き換えるたびに実行してください。毎回実行する必要はありません。
|
data/lib/Conductor.rb
CHANGED
@@ -430,14 +430,14 @@ EOH
|
|
430
430
|
|
431
431
|
private
|
432
432
|
def prepare_list(roles, hosts, specs)
|
433
|
-
role_host_specs = {}
|
433
|
+
role_host_specs = { 'ManuallyRun' => {} }
|
434
434
|
|
435
435
|
rh = cfload
|
436
436
|
r = rolehandle
|
437
437
|
|
438
438
|
hosts.each do |host|
|
439
439
|
role_host_specs['ManuallyRun'][host] ||= []
|
440
|
-
role_host_specs['ManuallyRun'][host] = (role_host_specs['ManuallyRun'][host] + specs).
|
440
|
+
role_host_specs['ManuallyRun'][host] = (role_host_specs['ManuallyRun'][host] + specs).uniq
|
441
441
|
end
|
442
442
|
|
443
443
|
roles.each do |role|
|
@@ -508,8 +508,17 @@ EOH
|
|
508
508
|
end
|
509
509
|
|
510
510
|
def runspec(role, host, specs, ci = {}, dryrun = nil)
|
511
|
-
executable_specs =
|
512
|
-
|
511
|
+
executable_specs = []
|
512
|
+
specs.each do |spec|
|
513
|
+
if spec =~ /_spec.rb$/
|
514
|
+
executable_specs << spec
|
515
|
+
else
|
516
|
+
executable_specs << 'spec/' + spec + '_spec.rb'
|
517
|
+
end
|
518
|
+
end
|
519
|
+
|
520
|
+
command = "parallel_rspec #{executable_specs.sort.uniq.join(' ')}"
|
521
|
+
|
513
522
|
if dryrun
|
514
523
|
puts 'TARGET_HOST=' + host + ' ' + command
|
515
524
|
return
|
data/lib/houcho.rb
CHANGED
data/lib/houcho/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: houcho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Satoshi SUZUKI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|