opskeleton 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opskeleton/generate.rb +4 -0
- data/lib/opskeleton/version.rb +1 -1
- data/templates/Rakefile +10 -1
- data/templates/gemfile +1 -0
- data/templates/parent/spec/default/httpd_spec.rb +19 -0
- data/templates/parent/spec/spec_helper.rb +46 -0
- data/templates/parent/travis.erb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fc7f3c7be28794db4f4439d770863d598989ba5
|
4
|
+
data.tar.gz: a39ccc598356b656e7429dbcad46f9c11f0fc604
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a036c652786fc5bf457b6fd01e1076ea0d25923d4fe0cf2d3660685349fe3a60e1c55e0da74e4cf396e6fa6689c02ebc97ec592a2d4d26e5bde94f1383cb6793
|
7
|
+
data.tar.gz: f06e8eb48afc25c213fd49ef7f753b569568ce729627e5bb654f909be84af4fc7e56e5872d5695b19af0a4f482c59a114b75fe743ce0b0e0eec8b6976866aba0
|
data/lib/opskeleton/generate.rb
CHANGED
data/lib/opskeleton/version.rb
CHANGED
data/templates/Rakefile
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
-
|
1
|
+
require 'rake'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
5
|
+
t.pattern = 'spec/*/*_spec.rb'
|
6
|
+
end
|
7
|
+
|
8
|
+
task :default => :spec
|
9
|
+
|
10
|
+
task :modspec do
|
2
11
|
FileList["static-modules/**/Rakefile"].each do |project|
|
3
12
|
Rake::Task.clear
|
4
13
|
load project
|
data/templates/gemfile
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe package('httpd') do
|
4
|
+
it { should be_installed }
|
5
|
+
end
|
6
|
+
|
7
|
+
describe service('httpd') do
|
8
|
+
it { should be_enabled }
|
9
|
+
it { should be_running }
|
10
|
+
end
|
11
|
+
|
12
|
+
describe port(80) do
|
13
|
+
it { should be_listening }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe file('/etc/httpd/conf/httpd.conf') do
|
17
|
+
it { should be_file }
|
18
|
+
its(:content) { should match /ServerName default/ }
|
19
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'serverspec'
|
2
|
+
require 'pathname'
|
3
|
+
require 'net/ssh'
|
4
|
+
|
5
|
+
include SpecInfra::Helper::Ssh
|
6
|
+
include SpecInfra::Helper::DetectOS
|
7
|
+
|
8
|
+
RSpec.configure do |c|
|
9
|
+
if ENV['ASK_SUDO_PASSWORD']
|
10
|
+
require 'highline/import'
|
11
|
+
c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false }
|
12
|
+
else
|
13
|
+
c.sudo_password = ENV['SUDO_PASSWORD']
|
14
|
+
end
|
15
|
+
c.before :all do
|
16
|
+
block = self.class.metadata[:example_group_block]
|
17
|
+
if RUBY_VERSION.start_with?('1.8')
|
18
|
+
file = block.to_s.match(/.*@(.*):[0-9]+>/)[1]
|
19
|
+
else
|
20
|
+
file = block.source_location.first
|
21
|
+
end
|
22
|
+
host = File.basename(Pathname.new(file).dirname)
|
23
|
+
if c.host != host
|
24
|
+
c.ssh.close if c.ssh
|
25
|
+
c.host = host
|
26
|
+
options = Net::SSH::Config.for(c.host)
|
27
|
+
user = options[:user] || Etc.getlogin
|
28
|
+
vagrant_up = `vagrant up default`
|
29
|
+
config = `vagrant ssh-config default`
|
30
|
+
if config != ''
|
31
|
+
config.each_line do |line|
|
32
|
+
if match = /HostName (.*)/.match(line)
|
33
|
+
host = match[1]
|
34
|
+
elsif match = /User (.*)/.match(line)
|
35
|
+
user = match[1]
|
36
|
+
elsif match = /IdentityFile (.*)/.match(line)
|
37
|
+
options[:keys] = [match[1].gsub(/"/,'')]
|
38
|
+
elsif match = /Port (.*)/.match(line)
|
39
|
+
options[:port] = match[1]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
c.ssh = Net::SSH.start(host, user, options)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/templates/parent/travis.erb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opskeleton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- narkisr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -136,6 +136,8 @@ files:
|
|
136
136
|
- templates/module/Rakefile.erb
|
137
137
|
- templates/module/spec_helper.rb
|
138
138
|
- templates/opsk.yml
|
139
|
+
- templates/parent/spec/default/httpd_spec.rb
|
140
|
+
- templates/parent/spec/spec_helper.rb
|
139
141
|
- templates/parent/travis.erb
|
140
142
|
- templates/puppet/default.erb
|
141
143
|
- templates/puppet/site.erb
|