-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
64 lines (56 loc) · 2.09 KB
/
Rakefile
File metadata and controls
64 lines (56 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
##############################################################################
# Rakefile - Configuration file for rake (http://rake.rubyforge.org/)
# Time-stamp: <Wed 2017-08-23 15:17 svarrette>
#
# Copyright (c) 2017 UL HPC Team <hpc-sysadmins@uni.lu>
# ____ _ __ _ _
# | _ \ __ _| | _____ / _(_) | ___
# | |_) / _` | |/ / _ \ |_| | |/ _ \
# | _ < (_| | < __/ _| | | __/
# |_| \_\__,_|_|\_\___|_| |_|_|\___|
#
# Use 'rake -T' to list the available actions
#
# Resources:
# * http://www.stuartellis.eu/articles/rake/
#
# See also https://github.com/garethr/puppet-module-skeleton
##############################################################################
require 'falkorlib'
#require 'puppetlabs_spec_helper/rake_tasks'
## placeholder for custom configuration of FalkorLib.config.*
## See https://github.com/Falkor/falkorlib
# Adapt the versioning aspects
FalkorLib.config.versioning do |c|
c[:type] = 'puppet_module'
end
# Adapt the Git flow aspects
FalkorLib.config.gitflow do |c|
c[:branches] = {
:master => 'production',
:develop => 'devel'
}
end
require 'falkorlib/tasks/git'
require 'falkorlib/tasks/puppet'
Rake::Task['puppet:module:build'].clear
namespace :puppet do
namespace :module do
########### puppet:module:build ###########
desc "Build the puppet module to publish it on the Puppet Forge"
task :build do |t|
info(t.comment).to_s
run %( pdk build --force)
if File.exist?('metadata.json')
metadata = JSON.parse( IO.read( 'metadata.json' ) )
name = metadata["name"]
version = metadata["version"]
run %( gunzip pkg/#{name}-#{version}.tar.gz)
run %( tar --numeric-owner -rvf pkg/#{name}-#{version}.tar --transform='s,^,#{name}-#{version}/,' metadata.json)
run %( gzip pkg/#{name}-#{version}.tar)
end
end # task build
end
end
##############################################################################
#TOP_SRCDIR = File.expand_path(File.join(File.dirname(__FILE__), "."))