opskeleton 0.1.1 → 0.1.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.
- data/README.md +21 -3
- data/lib/opskeleton/package.rb +5 -9
- data/lib/opskeleton/version.rb +1 -1
- data/templates/vagrant.erb +1 -1
- data/test/package_test.rb +1 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -9,7 +9,7 @@ Opsk aims to solve the following common issues:
|
|
9
9
|
* Devops develop Puppet modules on master machines which results with 'It works on my (machine) master' approach.
|
10
10
|
* Implicit/Missing dependencies, like ruby version used, operating system, gems, third party puppet module
|
11
11
|
* Manual steps in setting up puppet modules and local sandboxes (like installing third party code).
|
12
|
-
* Non standard layout, projects missing README and LICENSE files, no clear
|
12
|
+
* Non standard layout, projects missing README and LICENSE files, no clear separation between developed and dependant code.
|
13
13
|
* No clear development guidelines, for example extracting general modules and exporting them.
|
14
14
|
|
15
15
|
|
@@ -18,11 +18,29 @@ See it in action [here](https://www.youtube.com/watch?v=LNlHC54Ej8c).
|
|
18
18
|
Usage
|
19
19
|
=========
|
20
20
|
|
21
|
+
Installing perquisites (on Ubuntu)
|
22
|
+
|
23
|
+
```bash
|
24
|
+
$ sudo aptitude install ruby1.9.1 ruby1.9.1-dev
|
25
|
+
# see https://rvm.io/rvm/install/
|
26
|
+
$ curl -L https://get.rvm.io | bash -s stable --ruby
|
27
|
+
# re-launch current terminal session, the following should work
|
28
|
+
$ rvm use system
|
29
|
+
$ sudo gem install opskeleton
|
30
|
+
```
|
31
|
+
|
32
|
+
Creating out first sandbox
|
33
|
+
|
21
34
|
```bash
|
22
|
-
$
|
35
|
+
$ rvm use system
|
36
|
+
# parameters include name vagrant-box
|
37
|
+
$ opsk generate redis ubuntu-12.10
|
38
|
+
$ cd redis-sandbox
|
39
|
+
# bundle installs gems in the background
|
40
|
+
$ librarian-puppet install
|
41
|
+
$ vagrant up
|
23
42
|
```
|
24
43
|
|
25
|
-
|
26
44
|
## Layout
|
27
45
|
|
28
46
|
Opskelaton creates the complete folder structure fine tuned to match best practices:
|
data/lib/opskeleton/package.rb
CHANGED
@@ -18,21 +18,17 @@ module Opsk
|
|
18
18
|
empty_directory(artifact)
|
19
19
|
path = Dir.getwd
|
20
20
|
directory path , artifact
|
21
|
+
empty_directory("#{artifact}/scripts")
|
22
|
+
%w(lookup.sh run.sh).each do |s|
|
23
|
+
template("templates/scripts/#{s}", "#{artifact}/scripts/#{s}")
|
24
|
+
chmod("#{artifact}/scripts/#{s}", 0755)
|
25
|
+
end
|
21
26
|
end
|
22
27
|
|
23
28
|
def create_pkg
|
24
29
|
empty_directory('pkg')
|
25
30
|
end
|
26
31
|
|
27
|
-
def create_scripts
|
28
|
-
empty_directory('scripts')
|
29
|
-
%w(lookup.sh run.sh).each do |s|
|
30
|
-
template("templates/scripts/#{s}", "scripts/#{s}")
|
31
|
-
chmod("scripts/#{s}", 0755)
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
32
|
def package
|
37
33
|
ignored = IO.readlines('.gitignore').map(&:chomp)
|
38
34
|
ignored.delete('modules')
|
data/lib/opskeleton/version.rb
CHANGED
data/templates/vagrant.erb
CHANGED
@@ -8,7 +8,7 @@ Vagrant::Config.run do |config|
|
|
8
8
|
<%= name%>.vm.network :bridged
|
9
9
|
<%= name%>.vm.customize ['modifyvm', :id, '--memory', 2048, '--cpus', 4]
|
10
10
|
<%= name%>.vm.host_name = '<%= name %>'
|
11
|
-
<%= name%>.vm.provision :puppet, :options => ["--modulepath=/vagrant/modules:/vagrant/static-modules"]<% if(box.include?('centos')) %>
|
11
|
+
<%= name%>.vm.provision :puppet, :options => ["--modulepath=/vagrant/modules:/vagrant/static-modules", , "--hiera_config /vagrant/hiera.yaml"]<% if(box.include?('centos')) %>
|
12
12
|
# https://github.com/mitchellh/vagrant/issues/713
|
13
13
|
config.vm.customize ['setextradata', :id, 'VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root', '1']
|
14
14
|
<% end %>
|
data/test/package_test.rb
CHANGED
@@ -26,6 +26,7 @@ class PackageTest < MiniTest::Unit::TestCase
|
|
26
26
|
Opsk::Root.start ['package']
|
27
27
|
end
|
28
28
|
assert File.exists?('foo-sandbox/foo-sandbox-0.0.1/Puppetfile')
|
29
|
+
assert File.exists?('foo-sandbox/foo-sandbox-0.0.1/scripts/run.sh')
|
29
30
|
|
30
31
|
assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1.tar.gz')
|
31
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opskeleton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|