Project

General

Profile

« Previous | Next » 

Revision bdbbecb9

Added by Ewoud Kohl van Wijngaarden almost 6 years ago

Refs #23825 - Improve the rake task for tarballs

This introduces the name variable so that's the single line where it
differs from the smart-proxy task.

It also adds a check on the git archive tasks exit status.

View differences:

lib/tasks/pkg.rake
task :generate_source do
File.exist?('pkg') || FileUtils.mkdir('pkg')
ref = ENV['ref'] || 'HEAD'
name = 'foreman'
version = `git show #{ref}:VERSION`.chomp.chomp('-develop')
filename = "pkg/foreman-#{version}.tar.bz2"
raise "can't find VERSION from #{ref}" if version.empty?
`git archive --prefix=foreman-#{version}/ #{ref} | bzip2 -9 > #{filename}`
filename = "pkg/#{name}-#{version}.tar.bz2"
`git archive --prefix=#{name}-#{version}/ #{ref} | bzip2 -9 > #{filename}`
raise 'Failed to generate the source archive' if $? != 0
puts filename
end
end

Also available in: Unified diff