itamae-plugin-recipe-rtn_git 0.0.1
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 +7 -0
- data/.gitignore +293 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +43 -0
- data/Rakefile +21 -0
- data/Vagrantfile +18 -0
- data/itamae-plugin-recipe-rtn_git.gemspec +26 -0
- data/lib/itamae/plugin/recipe/rtn_git.rb +51 -0
- data/lib/itamae/plugin/recipe/rtn_git/version.rb +9 -0
- data/spec/git_spec.rb +6 -0
- data/spec/node.json +5 -0
- data/spec/role.rb +8 -0
- data/spec/spec_helper.rb +41 -0
- metadata +117 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 007c5371ec3cf0ac4d55057dfa4a91337c1e8a04
|
|
4
|
+
data.tar.gz: 6503360c615867c3b0bc8cb42c9d27bce1f6764e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: f6ff95fef117ff43c45b93b3963699d22402824095266c60a80c237effb5a42d3efba4d455edee15ee95fa577af85625bf7bf7386eaa49ee1e621a9ec9b0256b
|
|
7
|
+
data.tar.gz: 45e34d23044123cea322c17d427541a27e72bf8bc74497e441cb718bf70dd4aabc79d0b062bc4f4d43b0ab27f4d5d5cf920c3dd090c120b5b6f87d31408b10e7
|
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 Ru/MuckRu
|
|
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,43 @@
|
|
|
1
|
+
# Itamae::Plugin::Recipe::RtnGit
|
|
2
|
+
|
|
3
|
+
[Itamae](https://github.com/itamae-kitchen/itamae) recipe plugin for git (from source).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'itamae-plugin-recipe-rtn_git'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
Or install it yourself as:
|
|
18
|
+
|
|
19
|
+
$ gem install itamae-plugin-recipe-rtn_git
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### Add your recipe or role
|
|
24
|
+
```ruby
|
|
25
|
+
include_recipe 'rtn_php_nabe::system'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### node.json
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"rtn_git": {
|
|
32
|
+
"versions": "2.3.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Contributing
|
|
38
|
+
|
|
39
|
+
1. Fork it ( https://github.com/rutan/itamae-plugin-recipe-rtn_git/fork )
|
|
40
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
41
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
42
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
43
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'rake'
|
|
4
|
+
require 'bundler/gem_tasks'
|
|
5
|
+
require 'rspec/core/rake_task'
|
|
6
|
+
|
|
7
|
+
task spec: 'spec:all'
|
|
8
|
+
task default: :spec
|
|
9
|
+
|
|
10
|
+
namespace :spec do
|
|
11
|
+
platforms = %w[sl6 ubuntu1404]
|
|
12
|
+
task default: :all
|
|
13
|
+
|
|
14
|
+
platforms.each do |platform|
|
|
15
|
+
desc "Run serverspec tests in #{platform}"
|
|
16
|
+
RSpec::Core::RakeTask.new('all') do |t|
|
|
17
|
+
ENV['TARGET_HOST'] = platform
|
|
18
|
+
t.pattern = "spec/*_spec.rb"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/Vagrantfile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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 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
|
+
|
|
13
|
+
config.vm.define :ubuntu1404 do |c|
|
|
14
|
+
c.vm.box = "ubuntu1404"
|
|
15
|
+
c.vm.box_url = 'https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box'
|
|
16
|
+
c.vm.network :private_network, ip: '192.168.33.13'
|
|
17
|
+
end
|
|
18
|
+
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_git/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = 'itamae-plugin-recipe-rtn_git'
|
|
8
|
+
spec.version = Itamae::Plugin::Recipe::RtnGit::VERSION
|
|
9
|
+
spec.authors = ['Ru/MuckRu']
|
|
10
|
+
spec.email = ['ru_shalm@hazimu.com']
|
|
11
|
+
spec.summary = %q{Itamae recipe plugin for git.}
|
|
12
|
+
spec.description = %q{Itamae recipe plugin for git.}
|
|
13
|
+
spec.homepage = ''
|
|
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,51 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
node[:rtn_git] ||= {}
|
|
4
|
+
node[:rtn_git][:version] ||= '2.3.0'
|
|
5
|
+
node[:rtn_git][:archive_path] ||= 'https://github.com/git/git/archive/'
|
|
6
|
+
node[:rtn_git][:archive_url] ||= "#{node[:rtn_git][:archive_path]}v#{node[:rtn_git][:version]}.tar.gz"
|
|
7
|
+
node[:rtn_git][:install_path] ||= '/usr/local'
|
|
8
|
+
|
|
9
|
+
define :git_install, install_path: nil, archive_url: nil do
|
|
10
|
+
params = self.params
|
|
11
|
+
|
|
12
|
+
tmp_dir = '/tmp'
|
|
13
|
+
filename = File.basename(params[:archive_url])
|
|
14
|
+
dirname = "git-#{params[:name]}"
|
|
15
|
+
|
|
16
|
+
packages = %w[wget gcc gettext]
|
|
17
|
+
case os[:family]
|
|
18
|
+
when %r(debian|ubuntu)
|
|
19
|
+
packages << 'libssl-dev'
|
|
20
|
+
packages << 'libcurl4-openssl-dev'
|
|
21
|
+
packages << 'libexpat1-dev'
|
|
22
|
+
when %r(redhat)
|
|
23
|
+
packages << 'openssl-devel'
|
|
24
|
+
packages << 'libcurl-devel'
|
|
25
|
+
packages << 'expat-devel'
|
|
26
|
+
packages << 'perl-ExtUtils-MakeMaker'
|
|
27
|
+
else
|
|
28
|
+
raise 'not supported your OS'
|
|
29
|
+
end
|
|
30
|
+
packages.each &method(:package)
|
|
31
|
+
|
|
32
|
+
execute "cd #{tmp_dir} && wget #{params[:archive_url]}" do
|
|
33
|
+
not_if "test -O #{tmp_dir}/#{filename}"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
execute "cd #{tmp_dir} && \
|
|
37
|
+
tar zxvf #{filename}"
|
|
38
|
+
execute "cd #{tmp_dir}/#{dirname} && \
|
|
39
|
+
make prefix=#{params[:install_path]} all && \
|
|
40
|
+
make prefix=#{params[:install_path]} install"
|
|
41
|
+
|
|
42
|
+
execute 'add path' do
|
|
43
|
+
command "echo 'PATH=#{params[:install_path]}/bin:$PATH' > /etc/profile.d/git.sh"
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
git_install node[:rtn_git][:version] do
|
|
48
|
+
install_path node[:rtn_git][:install_path]
|
|
49
|
+
archive_url node[:rtn_git][:archive_url]
|
|
50
|
+
not_if ". /etc/profile && git --version | grep '#{node[:rtn_git][:version]}'"
|
|
51
|
+
end
|
data/spec/git_spec.rb
ADDED
data/spec/role.rb
ADDED
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
|
|
20
|
+
`vagrant up #{host}`
|
|
21
|
+
system("bundle exec itamae ssh -h #{host} --vagrant '#{File.expand_path("../role.rb", __FILE__)}' -j '#{File.expand_path("../node.json", __FILE__)}' --log-level=#{ENV['LOG_LEVEL'] || 'INFO'}")
|
|
22
|
+
|
|
23
|
+
config = Tempfile.new('', Dir.tmpdir)
|
|
24
|
+
`vagrant ssh-config #{host} > #{config.path}`
|
|
25
|
+
|
|
26
|
+
options = Net::SSH::Config.for(host, [config.path])
|
|
27
|
+
|
|
28
|
+
options[:user] ||= Etc.getlogin
|
|
29
|
+
|
|
30
|
+
set :host, options[:host_name] || host
|
|
31
|
+
set :ssh_options, options
|
|
32
|
+
|
|
33
|
+
# Disable sudo
|
|
34
|
+
# set :disable_sudo, true
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# Set environment variables
|
|
38
|
+
# set :env, :LANG => 'C', :LC_MESSAGES => 'C'
|
|
39
|
+
|
|
40
|
+
# Set PATH
|
|
41
|
+
# set :path, '/sbin:/usr/local/sbin:$PATH'
|
metadata
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: itamae-plugin-recipe-rtn_git
|
|
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-02-19 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 git.
|
|
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_git.gemspec
|
|
83
|
+
- lib/itamae/plugin/recipe/rtn_git.rb
|
|
84
|
+
- lib/itamae/plugin/recipe/rtn_git/version.rb
|
|
85
|
+
- spec/git_spec.rb
|
|
86
|
+
- spec/node.json
|
|
87
|
+
- spec/role.rb
|
|
88
|
+
- spec/spec_helper.rb
|
|
89
|
+
homepage: ''
|
|
90
|
+
licenses:
|
|
91
|
+
- MIT
|
|
92
|
+
metadata: {}
|
|
93
|
+
post_install_message:
|
|
94
|
+
rdoc_options: []
|
|
95
|
+
require_paths:
|
|
96
|
+
- lib
|
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
|
+
requirements:
|
|
99
|
+
- - ">="
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: '0'
|
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
|
+
requirements:
|
|
104
|
+
- - ">="
|
|
105
|
+
- !ruby/object:Gem::Version
|
|
106
|
+
version: '0'
|
|
107
|
+
requirements: []
|
|
108
|
+
rubyforge_project:
|
|
109
|
+
rubygems_version: 2.4.5
|
|
110
|
+
signing_key:
|
|
111
|
+
specification_version: 4
|
|
112
|
+
summary: Itamae recipe plugin for git.
|
|
113
|
+
test_files:
|
|
114
|
+
- spec/git_spec.rb
|
|
115
|
+
- spec/node.json
|
|
116
|
+
- spec/role.rb
|
|
117
|
+
- spec/spec_helper.rb
|