Skip to content

Commit

Permalink
More robust package build
Browse files Browse the repository at this point in the history
  • Loading branch information
dividedmind committed Dec 21, 2015
1 parent 801a4b8 commit c677026
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ end

desc "Package cookbooks into a chef-solo tarball"
task :package => :vendor do
`rm -rf vendor/cookbooks/conjur`
`mkdir -p vendor/cookbooks/conjur`
`cp -r metadata.rb Berksfile Berksfile.lock CHANGELOG.md chefignore README.md attributes recipes spec vendor/cookbooks/conjur`
version=`git describe --tags`.strip
`cp -r metadata.rb Berksfile Berksfile.lock CHANGELOG.md chefignore \
README.md attributes recipes files templates libraries \
vendor/cookbooks/conjur`
version=`git describe --tags --dirty`.strip
Dir.chdir 'vendor'
tarball = "conjur-#{version}.tar.gz"
puts "Building cookbook tarball #{tarball}"
`tar czf ../#{tarball} cookbooks`
`tar czv --numeric-owner --owner=0 --group=root --mode=og+r -f ../#{tarball} cookbooks`
end

0 comments on commit c677026

Please sign in to comment.