opskeleton 0.3.3 → 0.4.0
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/Gemfile.lock +1 -1
- data/bin/opsk +1 -0
- data/lib/opskeleton/bump.rb +20 -0
- data/lib/opskeleton/clean.rb +0 -1
- data/lib/opskeleton/package.rb +16 -8
- data/lib/opskeleton/version.rb +1 -1
- data/lib/opskeleton.rb +1 -0
- data/test/package_test.rb +3 -3
- metadata +5 -4
data/Gemfile.lock
CHANGED
data/bin/opsk
CHANGED
|
@@ -14,6 +14,7 @@ module Opsk
|
|
|
14
14
|
register Opsk::Module, 'module', 'module [name]', 'generate an rspec ready Puppet module'
|
|
15
15
|
register Opsk::Package, 'package', 'package', 'packages current module for celestial'
|
|
16
16
|
register Opsk::Clean, 'clean', 'clean', 'cleans up packaging products'
|
|
17
|
+
register Opsk::Bump, 'bump', 'bump', 'bumps up version (clearing old version also)'
|
|
17
18
|
|
|
18
19
|
desc 'version', 'print opsk version'
|
|
19
20
|
def version
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Opsk
|
|
2
|
+
class Bump < Thor::Group
|
|
3
|
+
include Thorable, Thor::Actions
|
|
4
|
+
|
|
5
|
+
argument :version, :type => :string, :desc => 'new version number'
|
|
6
|
+
|
|
7
|
+
def meta
|
|
8
|
+
OpenStruct.new(YAML.load_file('opsk.yml'))
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def bump
|
|
12
|
+
new_meta = meta
|
|
13
|
+
new_meta.version = version
|
|
14
|
+
File.open('opsk.yml', 'w') {|f| f.write(new_meta.marshal_dump.to_yaml)}
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
|
data/lib/opskeleton/clean.rb
CHANGED
data/lib/opskeleton/package.rb
CHANGED
|
@@ -14,16 +14,20 @@ module Opsk
|
|
|
14
14
|
"#{name}-#{meta.version}"
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
def artifact_path
|
|
18
|
+
"pkg/#{name}-#{meta.version}"
|
|
19
|
+
end
|
|
20
|
+
|
|
17
21
|
def create_build
|
|
18
|
-
empty_directory(
|
|
19
|
-
|
|
20
|
-
directory path
|
|
21
|
-
empty_directory("#{
|
|
22
|
+
empty_directory(artifact_path)
|
|
23
|
+
path = Dir.getwd
|
|
24
|
+
directory path, artifact_path, :verbose => false
|
|
25
|
+
empty_directory("#{artifact_path}/scripts")
|
|
22
26
|
%w(lookup.rb run.sh).each do |s|
|
|
23
|
-
template("templates/scripts/#{s}", "#{
|
|
24
|
-
chmod("#{
|
|
27
|
+
template("templates/scripts/#{s}", "#{artifact_path}/scripts/#{s}")
|
|
28
|
+
chmod("#{artifact_path}/scripts/#{s}", 0755)
|
|
25
29
|
end
|
|
26
|
-
template('templates/puppet/site.erb', "#{
|
|
30
|
+
template('templates/puppet/site.erb', "#{artifact_path}/manifests/site.pp")
|
|
27
31
|
end
|
|
28
32
|
|
|
29
33
|
def create_pkg
|
|
@@ -34,7 +38,11 @@ module Opsk
|
|
|
34
38
|
ignored = IO.readlines('.gitignore').map(&:chomp)
|
|
35
39
|
ignored.delete('modules')
|
|
36
40
|
excludes = ignored.map{|f| "'#{f}'"}.join(" --exclude=") << ' --exclude-backups --exclude-vcs --exclude=pkg'
|
|
37
|
-
|
|
41
|
+
tar = "#{artifact}.tar.gz"
|
|
42
|
+
input = artifact
|
|
43
|
+
inside('pkg') do
|
|
44
|
+
run("tar --exclude=#{excludes} -czf #{tar} #{input}")
|
|
45
|
+
end
|
|
38
46
|
end
|
|
39
47
|
|
|
40
48
|
end
|
data/lib/opskeleton/version.rb
CHANGED
data/lib/opskeleton.rb
CHANGED
data/test/package_test.rb
CHANGED
|
@@ -25,9 +25,9 @@ class PackageTest < MiniTest::Unit::TestCase
|
|
|
25
25
|
with_cwd 'foo-sandbox' do
|
|
26
26
|
Opsk::Root.start ['package']
|
|
27
27
|
end
|
|
28
|
-
assert File.exists?('foo-sandbox/foo-sandbox-0.0.1/Puppetfile')
|
|
29
|
-
assert File.exists?('foo-sandbox/foo-sandbox-0.0.1/manifests/site.pp')
|
|
30
|
-
assert File.exists?('foo-sandbox/foo-sandbox-0.0.1/scripts/run.sh')
|
|
28
|
+
assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/Puppetfile')
|
|
29
|
+
assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/manifests/site.pp')
|
|
30
|
+
assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/scripts/run.sh')
|
|
31
31
|
assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1.tar.gz')
|
|
32
32
|
end
|
|
33
33
|
|
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.
|
|
4
|
+
version: 0.4.0
|
|
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-08-
|
|
12
|
+
date: 2013-08-31 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: thor
|
|
@@ -112,6 +112,7 @@ files:
|
|
|
112
112
|
- autocomplete/opsk_bash_completion
|
|
113
113
|
- bin/opsk
|
|
114
114
|
- lib/opskeleton.rb
|
|
115
|
+
- lib/opskeleton/bump.rb
|
|
115
116
|
- lib/opskeleton/clean.rb
|
|
116
117
|
- lib/opskeleton/generate.rb
|
|
117
118
|
- lib/opskeleton/module.rb
|
|
@@ -158,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
158
159
|
version: '0'
|
|
159
160
|
segments:
|
|
160
161
|
- 0
|
|
161
|
-
hash:
|
|
162
|
+
hash: 970481843702191626
|
|
162
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
164
|
none: false
|
|
164
165
|
requirements:
|
|
@@ -167,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
167
168
|
version: '0'
|
|
168
169
|
segments:
|
|
169
170
|
- 0
|
|
170
|
-
hash:
|
|
171
|
+
hash: 970481843702191626
|
|
171
172
|
requirements: []
|
|
172
173
|
rubyforge_project:
|
|
173
174
|
rubygems_version: 1.8.25
|