Project

General

Profile

« Previous | Next » 

Revision 9f019d1e

Added by Dominic Cleal almost 10 years ago

refs #5793 - add pkg:generate_source rake task to create tar.bz2

View differences:

.gitignore
.rvmrc*
.ruby-*
.bundle
pkg/
Rakefile
require 'rubygems/package_task'
load 'tasks/proxy_tasks.rake'
load 'tasks/jenkins.rake'
load 'tasks/pkg.rake'
# Test for 1.9
if (RUBY_VERSION.split('.').map{|s|s.to_i} <=> [1,9,0]) > 0 then
VERSION
1.6.0-develop
lib/proxy.rb
module Proxy
MODULES = %w{dns dhcp tftp puppetca puppet bmc chefproxy realm}
VERSION = "1.6-develop"
VERSION = File.read(File.join(File.dirname(__FILE__), '../VERSION')).chomp
require "checks"
require "proxy/settings"
tasks/pkg.rake
require 'fileutils'
namespace :pkg do
desc 'Generate package source tar.bz2, supply ref=<tag> for tags'
task :generate_source do
File.exist?('pkg') || FileUtils.mkdir('pkg')
ref = ENV['ref'] || 'HEAD'
version = `git show #{ref}:VERSION`.chomp.chomp('-develop')
raise "can't find VERSION from #{ref}" if version.length == 0
`git archive --prefix=foreman-proxy-#{version}/ #{ref} | bzip2 -9 > pkg/foreman-proxy-#{version}.tar.bz2`
end
end

Also available in: Unified diff