rundock-plugin-operation-itamae 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +35 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +71 -0
- data/LICENSE +21 -0
- data/README.md +26 -0
- data/Rakefile +31 -0
- data/lib/rundock/plugin/operation/itamae.rb +38 -0
- data/lib/rundock/plugin/operation/itamae/version.rb +9 -0
- data/rundock-plugin-operation-itamae.gemspec +26 -0
- data/scenario_sample.yml +14 -0
- metadata +126 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f831935f38231ed106b914c71b95496919556447
|
4
|
+
data.tar.gz: 3632f3ad9cdc805fa2eb5e7ec3279f4b18d4599a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 436c9f9df22243a70980b453ba831fff7eac8c04e8ed74354bb6e2d7ce39eb0256906742fb768948c1ece7e4d0e179b93f491a8bfa97f1fb1eb3b623680cea21
|
7
|
+
data.tar.gz: 6c9d64812e9de5a2eb04e101752b12298ea1bd0a578fd69b6db89e7c2d0bd5dce222d5a3f5f22670e37ccecfe7d6316b06df8433e0627c6ebd19e538c519132f
|
data/.gitignore
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/test/tmp/
|
9
|
+
/test/version_tmp/
|
10
|
+
/tmp/
|
11
|
+
|
12
|
+
## Specific to RubyMotion:
|
13
|
+
.dat*
|
14
|
+
.repl_history
|
15
|
+
build/
|
16
|
+
|
17
|
+
## Documentation cache and generated files:
|
18
|
+
/.yardoc/
|
19
|
+
/_yardoc/
|
20
|
+
/doc/
|
21
|
+
/rdoc/
|
22
|
+
|
23
|
+
## Environment normalisation:
|
24
|
+
/.bundle/
|
25
|
+
/vendor/bundle
|
26
|
+
/lib/bundler/man/
|
27
|
+
|
28
|
+
# for a library or gem, you might want to ignore these files since the code is
|
29
|
+
# intended to run in multiple environments; otherwise, check them in:
|
30
|
+
# Gemfile.lock
|
31
|
+
# .ruby-version
|
32
|
+
# .ruby-gemset
|
33
|
+
|
34
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
35
|
+
.rvmrc
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rundock-plugin-operation-itamae (0.1.0)
|
5
|
+
itamae
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ansi (1.5.0)
|
11
|
+
diff-lcs (1.2.5)
|
12
|
+
hashie (3.4.2)
|
13
|
+
itamae (1.4.3)
|
14
|
+
ansi
|
15
|
+
hashie
|
16
|
+
schash (~> 0.1.0)
|
17
|
+
specinfra (>= 2.37.0, < 3.0.0)
|
18
|
+
thor
|
19
|
+
multi_json (1.11.2)
|
20
|
+
net-scp (1.2.1)
|
21
|
+
net-ssh (>= 2.6.5)
|
22
|
+
net-ssh (2.9.2)
|
23
|
+
net-telnet (0.1.1)
|
24
|
+
rake (10.4.2)
|
25
|
+
rspec (3.3.0)
|
26
|
+
rspec-core (~> 3.3.0)
|
27
|
+
rspec-expectations (~> 3.3.0)
|
28
|
+
rspec-mocks (~> 3.3.0)
|
29
|
+
rspec-core (3.3.2)
|
30
|
+
rspec-support (~> 3.3.0)
|
31
|
+
rspec-expectations (3.3.1)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.3.0)
|
34
|
+
rspec-its (1.2.0)
|
35
|
+
rspec-core (>= 3.0.0)
|
36
|
+
rspec-expectations (>= 3.0.0)
|
37
|
+
rspec-mocks (3.3.2)
|
38
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
+
rspec-support (~> 3.3.0)
|
40
|
+
rspec-support (3.3.0)
|
41
|
+
rundock (0.2.5)
|
42
|
+
ansi
|
43
|
+
net-ssh
|
44
|
+
specinfra (>= 2.31.0, < 3.0.0)
|
45
|
+
thor
|
46
|
+
schash (0.1.2)
|
47
|
+
serverspec (2.20.0)
|
48
|
+
multi_json
|
49
|
+
rspec (~> 3.0)
|
50
|
+
rspec-its
|
51
|
+
specinfra (~> 2.38)
|
52
|
+
sfl (2.2)
|
53
|
+
specinfra (2.40.0)
|
54
|
+
net-scp
|
55
|
+
net-ssh (~> 2.7)
|
56
|
+
net-telnet
|
57
|
+
sfl
|
58
|
+
thor (0.19.1)
|
59
|
+
|
60
|
+
PLATFORMS
|
61
|
+
ruby
|
62
|
+
|
63
|
+
DEPENDENCIES
|
64
|
+
bundler (~> 1.9)
|
65
|
+
rake (~> 10.0)
|
66
|
+
rundock
|
67
|
+
rundock-plugin-operation-itamae!
|
68
|
+
serverspec (~> 2.1)
|
69
|
+
|
70
|
+
BUNDLED WITH
|
71
|
+
1.10.6
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 hiracy
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# Rundock::Plugin::Operation::Itamae
|
2
|
+
|
3
|
+
[Rundock](https://github.com/hiracy/rundock) plugin for itamae operation.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```
|
8
|
+
$ gem install rundock-plugin-operation-itamae
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
TODO: Write usage instructions here
|
14
|
+
|
15
|
+
## Contributing
|
16
|
+
|
17
|
+
1. Fork it ( https://github.com/[my-github-username]/rundock-plugin-operation-itamae/fork )
|
18
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
19
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
20
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
21
|
+
5. Create a new Pull Request
|
22
|
+
|
23
|
+
## License
|
24
|
+
|
25
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
26
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
task :default => [:spec]
|
5
|
+
|
6
|
+
desc 'Run all tests.'
|
7
|
+
task :spec => ['clean', 'rundock', 'serverspec']
|
8
|
+
|
9
|
+
desc 'Cleaning environments'
|
10
|
+
|
11
|
+
task :clean do
|
12
|
+
Bundler.with_clean_env do
|
13
|
+
system 'rm -f /var/tmp/hello_rundock*'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run rundock-itamae plugin"
|
18
|
+
|
19
|
+
task :rundock do
|
20
|
+
cmd = 'bundle exec rundock do ./spec/integration/scenario.yml -l debug'
|
21
|
+
puts "[EXEC: ] #{cmd}"
|
22
|
+
system cmd
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Run serverspec tests"
|
26
|
+
|
27
|
+
RSpec::Core::RakeTask.new(:serverspec) do |t|
|
28
|
+
ENV['TARGET_HOST'] = 'localhost'
|
29
|
+
t.ruby_opts = '-I ./spec/integration'
|
30
|
+
t.pattern = ['./spec/integration/recipes/*_spec.rb']
|
31
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'itamae'
|
2
|
+
|
3
|
+
module Rundock
|
4
|
+
module Operation
|
5
|
+
|
6
|
+
# You can use this sample as following scenario.yml for example.
|
7
|
+
#
|
8
|
+
# - node: anyhost-01
|
9
|
+
# itamae:
|
10
|
+
# - nginx.rb
|
11
|
+
# - /tmp/mysql.rb
|
12
|
+
# - node_json: /tmp/attr.js
|
13
|
+
# - log_level: info
|
14
|
+
# ---
|
15
|
+
# anyhost-01:
|
16
|
+
# host: 192.168.1.11
|
17
|
+
# ssh_opts:
|
18
|
+
# port: 22
|
19
|
+
# user: anyuser
|
20
|
+
# key: ~/.ssh/id_rsa
|
21
|
+
# ---
|
22
|
+
class Itamae < Base
|
23
|
+
def run(backend, attributes)
|
24
|
+
recipe_files = []
|
25
|
+
options = {}
|
26
|
+
attributes[:itamae].each do |arg|
|
27
|
+
recipe_files << arg if arg.is_a?(String)
|
28
|
+
arg.each { |k, v| options[k] = v } if arg.is_a?(Hash)
|
29
|
+
end
|
30
|
+
|
31
|
+
options[:log_level] = 'info' unless options[:log_level]
|
32
|
+
::Itamae::Logger.level = ::Logger.const_get(options[:log_level].upcase)
|
33
|
+
::Itamae::Logger.formatter.colored = options[:color]
|
34
|
+
::Itamae::Runner.run(recipe_files, :local, options)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rundock/plugin/operation/itamae/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "rundock-plugin-operation-itamae"
|
8
|
+
spec.version = Rundock::Plugin::Operation::Itamae::VERSION
|
9
|
+
spec.authors = ["hiracy"]
|
10
|
+
spec.email = ["leizhen@mbr.nifty.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{rundock plugin for itamae operation}
|
13
|
+
spec.homepage = 'https://github.com/hiracy/rundock-plugin-operation-itamae'
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.9'
|
22
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
23
|
+
spec.add_development_dependency 'serverspec', '~> 2.1'
|
24
|
+
spec.add_development_dependency "rundock"
|
25
|
+
spec.add_runtime_dependency "itamae"
|
26
|
+
end
|
data/scenario_sample.yml
ADDED
metadata
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rundock-plugin-operation-itamae
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- hiracy
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: serverspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rundock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: itamae
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
- leizhen@mbr.nifty.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- .rspec
|
92
|
+
- .travis.yml
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- LICENSE
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- lib/rundock/plugin/operation/itamae.rb
|
99
|
+
- lib/rundock/plugin/operation/itamae/version.rb
|
100
|
+
- rundock-plugin-operation-itamae.gemspec
|
101
|
+
- scenario_sample.yml
|
102
|
+
homepage: https://github.com/hiracy/rundock-plugin-operation-itamae
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata: {}
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
requirements: []
|
121
|
+
rubyforge_project:
|
122
|
+
rubygems_version: 2.4.5
|
123
|
+
signing_key:
|
124
|
+
specification_version: 4
|
125
|
+
summary: rundock plugin for itamae operation
|
126
|
+
test_files: []
|