itamae-plugin-recipe-rtn_php_nabe 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +293 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +55 -0
- data/Rakefile +28 -0
- data/Vagrantfile +12 -0
- data/itamae-plugin-recipe-rtn_php_nabe.gemspec +26 -0
- data/lib/itamae/plugin/recipe/rtn_php_nabe.rb +2 -0
- data/lib/itamae/plugin/recipe/rtn_php_nabe/system.rb +58 -0
- data/lib/itamae/plugin/recipe/rtn_php_nabe/version.rb +9 -0
- data/spec/spec_helper.rb +42 -0
- data/spec/system/node.json +15 -0
- data/spec/system/php_nabe_spec.rb +29 -0
- data/spec/system/role.rb +2 -0
- metadata +118 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 437936e27173844b8cc2faa8900cfb191a4f0792
|
4
|
+
data.tar.gz: 13f32007cbd921f59a15afaf4ec6f55906e2e679
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2917088f72f59662081707937495201fb2dcb289069b96c83975a6ae883ebd5e1df272960782727cb3225976c824abcb2b8ff949e0374a4d5588afc2d389ea5f
|
7
|
+
data.tar.gz: 82de05bc236db3de19913c1838e809cf83adbce59746bd73065da97af0b375ea2bfba934d0d5c2b5aab725e28819d1a732c76b40e26c19d163bff6e928fd27fb
|
data/.gitignore
ADDED
@@ -0,0 +1,293 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
10
|
+
*.bundle
|
11
|
+
*.so
|
12
|
+
*.o
|
13
|
+
*.a
|
14
|
+
mkmf.log
|
15
|
+
|
16
|
+
.vagrant
|
17
|
+
|
18
|
+
# Created by https://www.gitignore.io
|
19
|
+
|
20
|
+
### OSX ###
|
21
|
+
.DS_Store
|
22
|
+
.AppleDouble
|
23
|
+
.LSOverride
|
24
|
+
|
25
|
+
# Icon must end with two \r
|
26
|
+
Icon
|
27
|
+
|
28
|
+
|
29
|
+
# Thumbnails
|
30
|
+
._*
|
31
|
+
|
32
|
+
# Files that might appear on external disk
|
33
|
+
.Spotlight-V100
|
34
|
+
.Trashes
|
35
|
+
|
36
|
+
# Directories potentially created on remote AFP share
|
37
|
+
.AppleDB
|
38
|
+
.AppleDesktop
|
39
|
+
Network Trash Folder
|
40
|
+
Temporary Items
|
41
|
+
.apdisk
|
42
|
+
|
43
|
+
|
44
|
+
### Windows ###
|
45
|
+
# Windows image file caches
|
46
|
+
Thumbs.db
|
47
|
+
ehthumbs.db
|
48
|
+
|
49
|
+
# Folder config file
|
50
|
+
Desktop.ini
|
51
|
+
|
52
|
+
# Recycle Bin used on file shares
|
53
|
+
$RECYCLE.BIN/
|
54
|
+
|
55
|
+
# Windows Installer files
|
56
|
+
*.cab
|
57
|
+
*.msi
|
58
|
+
*.msm
|
59
|
+
*.msp
|
60
|
+
|
61
|
+
# Windows shortcuts
|
62
|
+
*.lnk
|
63
|
+
|
64
|
+
|
65
|
+
### Linux ###
|
66
|
+
*~
|
67
|
+
|
68
|
+
# KDE directory preferences
|
69
|
+
.directory
|
70
|
+
|
71
|
+
|
72
|
+
### vim ###
|
73
|
+
[._]*.s[a-w][a-z]
|
74
|
+
[._]s[a-w][a-z]
|
75
|
+
*.un~
|
76
|
+
Session.vim
|
77
|
+
.netrwhist
|
78
|
+
*~
|
79
|
+
|
80
|
+
|
81
|
+
### Emacs ###
|
82
|
+
# -*- mode: gitignore; -*-
|
83
|
+
*~
|
84
|
+
\#*\#
|
85
|
+
/.emacs.desktop
|
86
|
+
/.emacs.desktop.lock
|
87
|
+
*.elc
|
88
|
+
auto-save-list
|
89
|
+
tramp
|
90
|
+
.\#*
|
91
|
+
|
92
|
+
# Org-mode
|
93
|
+
.org-id-locations
|
94
|
+
*_archive
|
95
|
+
|
96
|
+
# flymake-mode
|
97
|
+
*_flymake.*
|
98
|
+
|
99
|
+
# eshell files
|
100
|
+
/eshell/history
|
101
|
+
/eshell/lastdir
|
102
|
+
|
103
|
+
# elpa packages
|
104
|
+
/elpa/
|
105
|
+
|
106
|
+
# reftex files
|
107
|
+
*.rel
|
108
|
+
|
109
|
+
# AUCTeX auto folder
|
110
|
+
/auto/
|
111
|
+
|
112
|
+
|
113
|
+
### SublimeText ###
|
114
|
+
# cache files for sublime text
|
115
|
+
*.tmlanguage.cache
|
116
|
+
*.tmPreferences.cache
|
117
|
+
*.stTheme.cache
|
118
|
+
|
119
|
+
# workspace files are user-specific
|
120
|
+
*.sublime-workspace
|
121
|
+
|
122
|
+
# project files should be checked into the repository, unless a significant
|
123
|
+
# proportion of contributors will probably not be using SublimeText
|
124
|
+
# *.sublime-project
|
125
|
+
|
126
|
+
# sftp configuration file
|
127
|
+
sftp-config.json
|
128
|
+
|
129
|
+
|
130
|
+
### Intellij ###
|
131
|
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
|
132
|
+
|
133
|
+
/*.iml
|
134
|
+
|
135
|
+
## Directory-based project format:
|
136
|
+
.idea/
|
137
|
+
# if you remove the above rule, at least ignore the follwing:
|
138
|
+
|
139
|
+
# User-specific stuff:
|
140
|
+
# .idea/workspace.xml
|
141
|
+
# .idea/tasks.xml
|
142
|
+
# .idea/dictionaries
|
143
|
+
|
144
|
+
# Sensitive or high-churn files:
|
145
|
+
# .idea/dataSources.ids
|
146
|
+
# .idea/dataSources.xml
|
147
|
+
# .idea/sqlDataSources.xml
|
148
|
+
# .idea/dynamic.xml
|
149
|
+
# .idea/uiDesigner.xml
|
150
|
+
|
151
|
+
# Gradle:
|
152
|
+
# .idea/gradle.xml
|
153
|
+
# .idea/libraries
|
154
|
+
|
155
|
+
# Mongo Explorer plugin:
|
156
|
+
# .idea/mongoSettings.xml
|
157
|
+
|
158
|
+
## File-based project format:
|
159
|
+
*.ipr
|
160
|
+
*.iws
|
161
|
+
|
162
|
+
## Plugin-specific files:
|
163
|
+
|
164
|
+
# IntelliJ
|
165
|
+
out/
|
166
|
+
|
167
|
+
# mpeltonen/sbt-idea plugin
|
168
|
+
.idea_modules/
|
169
|
+
|
170
|
+
# JIRA plugin
|
171
|
+
atlassian-ide-plugin.xml
|
172
|
+
|
173
|
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
174
|
+
com_crashlytics_export_strings.xml
|
175
|
+
|
176
|
+
|
177
|
+
### RubyMine ###
|
178
|
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
|
179
|
+
|
180
|
+
/*.iml
|
181
|
+
|
182
|
+
## Directory-based project format:
|
183
|
+
.idea/
|
184
|
+
# if you remove the above rule, at least ignore the follwing:
|
185
|
+
|
186
|
+
# User-specific stuff:
|
187
|
+
# .idea/workspace.xml
|
188
|
+
# .idea/tasks.xml
|
189
|
+
# .idea/dictionaries
|
190
|
+
|
191
|
+
# Sensitive or high-churn files:
|
192
|
+
# .idea/dataSources.ids
|
193
|
+
# .idea/dataSources.xml
|
194
|
+
# .idea/sqlDataSources.xml
|
195
|
+
# .idea/dynamic.xml
|
196
|
+
# .idea/uiDesigner.xml
|
197
|
+
|
198
|
+
# Gradle:
|
199
|
+
# .idea/gradle.xml
|
200
|
+
# .idea/libraries
|
201
|
+
|
202
|
+
# Mongo Explorer plugin:
|
203
|
+
# .idea/mongoSettings.xml
|
204
|
+
|
205
|
+
## File-based project format:
|
206
|
+
*.ipr
|
207
|
+
*.iws
|
208
|
+
|
209
|
+
## Plugin-specific files:
|
210
|
+
|
211
|
+
# IntelliJ
|
212
|
+
out/
|
213
|
+
|
214
|
+
# mpeltonen/sbt-idea plugin
|
215
|
+
.idea_modules/
|
216
|
+
|
217
|
+
# JIRA plugin
|
218
|
+
atlassian-ide-plugin.xml
|
219
|
+
|
220
|
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
221
|
+
com_crashlytics_export_strings.xml
|
222
|
+
|
223
|
+
|
224
|
+
### Ruby ###
|
225
|
+
*.gem
|
226
|
+
*.rbc
|
227
|
+
/.config
|
228
|
+
/coverage/
|
229
|
+
/InstalledFiles
|
230
|
+
/pkg/
|
231
|
+
/spec/reports/
|
232
|
+
/test/tmp/
|
233
|
+
/test/version_tmp/
|
234
|
+
/tmp/
|
235
|
+
|
236
|
+
## Specific to RubyMotion:
|
237
|
+
.dat*
|
238
|
+
.repl_history
|
239
|
+
build/
|
240
|
+
|
241
|
+
## Documentation cache and generated files:
|
242
|
+
/.yardoc/
|
243
|
+
/_yardoc/
|
244
|
+
/doc/
|
245
|
+
/rdoc/
|
246
|
+
|
247
|
+
## Environment normalisation:
|
248
|
+
/.bundle/
|
249
|
+
/lib/bundler/man/
|
250
|
+
|
251
|
+
# for a library or gem, you might want to ignore these files since the code is
|
252
|
+
# intended to run in multiple environments; otherwise, check them in:
|
253
|
+
# Gemfile.lock
|
254
|
+
# .ruby-version
|
255
|
+
# .ruby-gemset
|
256
|
+
|
257
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
258
|
+
.rvmrc
|
259
|
+
|
260
|
+
|
261
|
+
### Rails ###
|
262
|
+
*.rbc
|
263
|
+
capybara-*.html
|
264
|
+
.rspec
|
265
|
+
/log
|
266
|
+
/tmp
|
267
|
+
/db/*.sqlite3
|
268
|
+
/public/system
|
269
|
+
/coverage/
|
270
|
+
/spec/tmp
|
271
|
+
**.orig
|
272
|
+
rerun.txt
|
273
|
+
pickle-email-*.html
|
274
|
+
|
275
|
+
# TODO Comment out these rules if you are OK with secrets being uploaded to the repo
|
276
|
+
config/initializers/secret_token.rb
|
277
|
+
config/secrets.yml
|
278
|
+
|
279
|
+
## Environment normalisation:
|
280
|
+
/.bundle
|
281
|
+
/vendor/bundle
|
282
|
+
|
283
|
+
# these should all be checked in to normalise the environment:
|
284
|
+
# Gemfile.lock, .ruby-version, .ruby-gemset
|
285
|
+
|
286
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
287
|
+
.rvmrc
|
288
|
+
|
289
|
+
# if using bower-rails ignore default bower_components path bower.json files
|
290
|
+
/vendor/assets/bower_components
|
291
|
+
*.bowerrc
|
292
|
+
bower.json
|
293
|
+
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Yuichi FUKAI
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# Itamae::Plugin::Recipe::RtnPhpNabe
|
2
|
+
|
3
|
+
[Itamae](https://github.com/itamae-kitchen/itamae) recipe plugin for [php-nabe](https://github.com/kawahara/php-nabe).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'itamae-plugin-recipe-rtn_php_nabe'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install itamae-plugin-recipe-rtn_php_nabe
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
### install for system
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
include_recipe 'rtn_php_nabe::system'
|
27
|
+
```
|
28
|
+
|
29
|
+
### node.json
|
30
|
+
|
31
|
+
```json
|
32
|
+
{
|
33
|
+
"rtn_php_nabe": {
|
34
|
+
"versions": {
|
35
|
+
"5.6.4": {
|
36
|
+
"configure": "--with-curl --enable-sockets",
|
37
|
+
"extensions": ["mbstring"]
|
38
|
+
},
|
39
|
+
"5.5.20": {
|
40
|
+
"configure": "",
|
41
|
+
"extensions": []
|
42
|
+
}
|
43
|
+
},
|
44
|
+
"use": "5.6.4"
|
45
|
+
}
|
46
|
+
}
|
47
|
+
```
|
48
|
+
|
49
|
+
## Contributing
|
50
|
+
|
51
|
+
1. Fork it ( https://github.com/rutan/itamae-plugin-recipe-rtn_php_nabe/fork )
|
52
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
53
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
54
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
55
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
task :spec => 'spec:all'
|
6
|
+
task :default => :spec
|
7
|
+
|
8
|
+
namespace :spec do
|
9
|
+
targets = []
|
10
|
+
Dir.glob('./spec/*').each do |dir|
|
11
|
+
next unless File.directory?(dir)
|
12
|
+
targets << File.basename(dir)
|
13
|
+
end
|
14
|
+
platforms = %w[sl6]
|
15
|
+
|
16
|
+
task :all => targets
|
17
|
+
task :default => :all
|
18
|
+
|
19
|
+
targets.each do |target|
|
20
|
+
platforms.each do |platform|
|
21
|
+
desc "Run serverspec tests to #{target} in #{platform}"
|
22
|
+
RSpec::Core::RakeTask.new(target.to_sym) do |t|
|
23
|
+
ENV['TARGET_HOST'] = "#{platform}_#{target}"
|
24
|
+
t.pattern = "spec/#{target}/*_spec.rb"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/Vagrantfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
VAGRANTFILE_API_VERSION = "2"
|
5
|
+
|
6
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
7
|
+
config.vm.define :sl6_system do |c|
|
8
|
+
c.vm.box = "sl6"
|
9
|
+
c.vm.box_url = 'http://files.rutan.info/box/scientific-6-5-x64-virtualbox.box'
|
10
|
+
c.vm.network :private_network, ip: '192.168.33.12'
|
11
|
+
end
|
12
|
+
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 'itamae/plugin/recipe/rtn_php_nabe/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'itamae-plugin-recipe-rtn_php_nabe'
|
8
|
+
spec.version = Itamae::Plugin::Recipe::RtnPhpNabe::VERSION
|
9
|
+
spec.authors = ["Ru/MuckRu"]
|
10
|
+
spec.email = ["ru_shalm@hazimu.com"]
|
11
|
+
spec.summary = %q{Itamae recipe plugin for php-nabe.}
|
12
|
+
spec.description = %q{Itamae recipe plugin for php-nabe.}
|
13
|
+
spec.homepage = "https://github.com/rutan/itamae-plugin-recipe-rtn_php_nabe"
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_dependency "itamae", "~> 1.0"
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
24
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
25
|
+
spec.add_development_dependency "serverspec", "~> 2.0"
|
26
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
node[:rtn_php_nabe] ||= {}
|
4
|
+
node[:rtn_php_nabe][:git_url] ||= 'https://github.com/kawahara/php-nabe.git'
|
5
|
+
node[:rtn_php_nabe][:install_path] ||= '/usr/local/php-nabe'
|
6
|
+
node[:rtn_php_nabe][:versions] ||= []
|
7
|
+
node[:rtn_php_nabe][:use] ||= nil
|
8
|
+
|
9
|
+
packages = %w[
|
10
|
+
rpmforge-release
|
11
|
+
gcc
|
12
|
+
git
|
13
|
+
bison
|
14
|
+
libcurl-devel
|
15
|
+
libmcrypt-devel
|
16
|
+
libjpeg-devel
|
17
|
+
libpng-devel
|
18
|
+
libxslt-devel
|
19
|
+
libtidy-devel
|
20
|
+
libxml2-devel
|
21
|
+
re2c
|
22
|
+
readline-devel
|
23
|
+
texinfo
|
24
|
+
]
|
25
|
+
packages.each { |package_name| package package_name }
|
26
|
+
|
27
|
+
git node[:rtn_php_nabe][:install_path] do
|
28
|
+
repository node[:rtn_php_nabe][:git_url]
|
29
|
+
end
|
30
|
+
|
31
|
+
setting = <<"EOS"
|
32
|
+
# php-nabe
|
33
|
+
export PHP_NABE_ROOT=#{node[:rtn_php_nabe][:install_path]}
|
34
|
+
export PATH="$PHP_NABE_ROOT:$PHP_NABE_ROOT/bin:$PATH"
|
35
|
+
EOS
|
36
|
+
|
37
|
+
profile_path = '/etc/profile.d/php-nabe.sh'
|
38
|
+
execute 'add php-nabe settings' do
|
39
|
+
command "echo '#{setting}' >> #{profile_path}"
|
40
|
+
not_if "test `touch #{profile_path} && cat #{profile_path} | grep 'php-nabe' -c` != 0"
|
41
|
+
end
|
42
|
+
|
43
|
+
node[:rtn_php_nabe][:versions].each do |php_version, parameters|
|
44
|
+
execute ". #{profile_path} && php-nabe install #{php_version} #{parameters['configure']}" do
|
45
|
+
not_if "test `. #{profile_path} && php-nabe ls | grep '#{php_version}' -c` != 0"
|
46
|
+
end
|
47
|
+
execute ". #{profile_path} && php-nabe use #{php_version}"
|
48
|
+
(parameters['extensions'] || []).each do |name|
|
49
|
+
execute ". #{profile_path} && php-nabe ext-install #{name}" do
|
50
|
+
not_if "test `. #{profile_path} && php -m | grep '#{name}' -c` != 0"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
if version = node[:rtn_php_nabe][:use]
|
56
|
+
execute ". #{profile_path} && php-nabe use #{version}"
|
57
|
+
end
|
58
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'serverspec'
|
2
|
+
require 'net/ssh'
|
3
|
+
require 'tempfile'
|
4
|
+
|
5
|
+
set :backend, :ssh
|
6
|
+
|
7
|
+
if ENV['ASK_SUDO_PASSWORD']
|
8
|
+
begin
|
9
|
+
require 'highline/import'
|
10
|
+
rescue LoadError
|
11
|
+
fail "highline is not available. Try installing it."
|
12
|
+
end
|
13
|
+
set :sudo_password, ask("Enter sudo password: ") { |q| q.echo = false }
|
14
|
+
else
|
15
|
+
set :sudo_password, ENV['SUDO_PASSWORD']
|
16
|
+
end
|
17
|
+
|
18
|
+
host = ENV['TARGET_HOST']
|
19
|
+
target = host.split('_')[1]
|
20
|
+
|
21
|
+
`vagrant up #{host}`
|
22
|
+
system("bundle exec itamae ssh -h #{host} --vagrant '#{File.expand_path("../#{target}/role.rb", __FILE__)}' -j '#{File.expand_path("../#{target}/node.json", __FILE__)}'")
|
23
|
+
|
24
|
+
config = Tempfile.new('', Dir.tmpdir)
|
25
|
+
`vagrant ssh-config #{host} > #{config.path}`
|
26
|
+
|
27
|
+
options = Net::SSH::Config.for(host, [config.path])
|
28
|
+
|
29
|
+
options[:user] ||= Etc.getlogin
|
30
|
+
|
31
|
+
set :host, options[:host_name] || host
|
32
|
+
set :ssh_options, options
|
33
|
+
|
34
|
+
# Disable sudo
|
35
|
+
# set :disable_sudo, true
|
36
|
+
|
37
|
+
|
38
|
+
# Set environment variables
|
39
|
+
# set :env, :LANG => 'C', :LC_MESSAGES => 'C'
|
40
|
+
|
41
|
+
# Set PATH
|
42
|
+
# set :path, '/sbin:/usr/local/sbin:$PATH'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe command('. /etc/profile && which php-nabe') do
|
4
|
+
let(:disable_sudo) { true }
|
5
|
+
its(:stdout) { should match '/usr/local/php-nabe/php-nabe' }
|
6
|
+
end
|
7
|
+
|
8
|
+
%w[5.6.4 5.5.20].each do |php_version|
|
9
|
+
describe command(". /etc/profile && php-nabe ls | grep '#{php_version}'") do
|
10
|
+
let(:disable_sudo) { true }
|
11
|
+
its(:stdout) { should match /#{Regexp.escape(php_version)}/ }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe command(". /etc/profile && php -v") do
|
16
|
+
let(:disable_sudo) { true }
|
17
|
+
its(:stdout) { should match /5\.6\.4/ }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe command(". /etc/profile && php-config --configure-options") do
|
21
|
+
let(:disable_sudo) { true }
|
22
|
+
its(:stdout) { should match /with-curl/ }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe command(". /etc/profile && php -m") do
|
26
|
+
let(:disable_sudo) { true }
|
27
|
+
its(:stdout) { should match /mbstring/ }
|
28
|
+
end
|
29
|
+
|
data/spec/system/role.rb
ADDED
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: itamae-plugin-recipe-rtn_php_nabe
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ru/MuckRu
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: itamae
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: serverspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
69
|
+
description: Itamae recipe plugin for php-nabe.
|
70
|
+
email:
|
71
|
+
- ru_shalm@hazimu.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- Gemfile
|
78
|
+
- LICENSE.txt
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- Vagrantfile
|
82
|
+
- itamae-plugin-recipe-rtn_php_nabe.gemspec
|
83
|
+
- lib/itamae/plugin/recipe/rtn_php_nabe.rb
|
84
|
+
- lib/itamae/plugin/recipe/rtn_php_nabe/system.rb
|
85
|
+
- lib/itamae/plugin/recipe/rtn_php_nabe/version.rb
|
86
|
+
- spec/spec_helper.rb
|
87
|
+
- spec/system/node.json
|
88
|
+
- spec/system/php_nabe_spec.rb
|
89
|
+
- spec/system/role.rb
|
90
|
+
homepage: https://github.com/rutan/itamae-plugin-recipe-rtn_php_nabe
|
91
|
+
licenses:
|
92
|
+
- MIT
|
93
|
+
metadata: {}
|
94
|
+
post_install_message:
|
95
|
+
rdoc_options: []
|
96
|
+
require_paths:
|
97
|
+
- lib
|
98
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
requirements: []
|
109
|
+
rubyforge_project:
|
110
|
+
rubygems_version: 2.4.5
|
111
|
+
signing_key:
|
112
|
+
specification_version: 4
|
113
|
+
summary: Itamae recipe plugin for php-nabe.
|
114
|
+
test_files:
|
115
|
+
- spec/spec_helper.rb
|
116
|
+
- spec/system/node.json
|
117
|
+
- spec/system/php_nabe_spec.rb
|
118
|
+
- spec/system/role.rb
|