houcho 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjRkYjFlODg2OGNmOTY1ZWY1NzIzMGM0NDZiOTJlZDIyNThiMjcwYQ==
4
+ YzYzYmQ5YzQzYmZjZTM1ODk1Yzk5Y2ExMmY3N2JjMGM3ZDk1YTIwYg==
5
5
  data.tar.gz: !binary |-
6
- YzYzNDQ0NzI2MmViN2QzNThkMDk5NmMwYjIzOTVkYTBiYjg3OTgzZg==
6
+ NWY1YjUyYmZjMmY5YjVhMDVjYjFhMzkxMWNhZDNhMTQ3ZTA4YzExNA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTQwOGM5YWY2MjM0NmYxNDM1ZGY5YmFjNTI5OTlmOTI0ZjBkMzdhNzdhNDAx
10
- NDg5Yzk3NzA2M2RlZDU4MmZjYWEwZjBkNjUwZjFkMWI5ZTkwMzg2NGMzNGZi
11
- MzU3Y2E5OTI1ZGFkMGY4MTE1Y2U3MjYyZGRlMzZhMTc2MTNhODY=
9
+ ODFlOGNkZTA0OWJkZjI4MDgzMGI0NmFkOTIxMDgyMzkxYjgyYzhiZGJmZjk5
10
+ ZWQ5ODZiMGVkNjhjOTM4NWU2OWY0MTUyNmIwMzJiOTBhMGY3ZGU1N2JkNzk2
11
+ MDRlYWQwY2YzMGQ4YmQ0ZGYzMjAwMTNjOGI0ZTM5Zjk1NDk3YTk=
12
12
  data.tar.gz: !binary |-
13
- ODNlM2NiYTBmZTUxZmIyMjI4ZTA3M2Q4OWNiYmJiMWZiNzg5ZGZhOTAzZjMy
14
- ZGZjMWFjZTBhMjAwY2QzNjRhMjZjZTFiZmJjZWYyZjQwMzRkODA3OTIwY2Jl
15
- MGQ0ZjUxMTJlMDliZmNiMWVjNTRkMjQ4NWViOTE5OWIzMWIzNDE=
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
- - git cloneして、bin/にPATHを通します。
5
+ - install houcho from ruby gems
6
6
 
7
7
  ```sh
8
- $ git clone git://github.com/studio3104/houcho.git
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`すると`git 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`に`houcho_sample_spec.rb`を実行します。
30
- - `--specs`,`--hosts`の引数は、スペース区切りで複数指定が可能です。
31
- - `--specs`の引数は、作業ディレクトリの`spec/`からの相対パスで、`_spec.rb`を除いて指定します。
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
- - まずはroleの作成。
35
+ - create role at first.
37
36
 
38
- - role名はフリーワードでokです。
37
+ ```sh
38
+ $ houcho role create studio3104::www
39
+ ```
39
40
 
40
- ```sh
41
- $ houcho role create studio3104::www
42
- ```
43
-
44
- - 作成したroleにホストをattachします。
45
- - TODO: 複数指定出来るようにする。
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
- - specをattachします。
53
- - TODO: 複数指定出来るようにする。
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
- ```sh
57
- $ houcho spec attach houcho_sample studio3104::www
58
- ```
51
+ ```sh
52
+ $ houcho spec attach houcho_sample studio3104::www
53
+ ```
59
54
 
60
- - 作成したroleの内容を確認します。
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
- cloudoforecastのyamlを読み込み、定義済みのオリジナルroleにattach出来ます。
84
+ houcho can load yaml of CloudForecast, and attach to the role defined.
90
85
 
91
- - cloudforecastのyamlを、`role/cloudforecast/`に設置します。
92
- - 拡張子を`yaml`にしておく必要があります。
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を置き換えるたびに実行してください。毎回実行する必要はありません。
@@ -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).uniqspecs
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 = specs.map {|spec| 'spec/' + spec + '_spec.rb'}.join(' ')
512
- command = "parallel_rspec #{executable_specs}"
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
@@ -1,4 +1,4 @@
1
- require "houcho/version"
1
+ require 'houcho/version'
2
2
 
3
3
  module Houcho
4
4
  # Your code goes here...
@@ -1,3 +1,3 @@
1
1
  module Houcho
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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-09 00:00:00.000000000 Z
11
+ date: 2013-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow