diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b1ac1a..c28f2e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,14 @@ ## [Unreleased] +# 1.12.0 + ### Added - Debify now packages and publishes an RPM file, alongside a debian file. [conjurinc/debify#49](https://github.com/conjurinc/debify/pull/49) +- `debify package` now offers an `--additional-files` flag to provide a comma + separated list of files to include in the FPM build that are not provided + automatically by `git ls-files`. + [conjurinc/debify#52](https://github.com/conjurinc/debify/pull/52) ### Fixed - Bug causing `all` files in the git repo to be added to the debian file. diff --git a/VERSION b/VERSION index e6dbb7c..0eed1a2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.11.5 +1.12.0 diff --git a/lib/conjur/debify.rb b/lib/conjur/debify.rb index e0da7bb..49652a8 100644 --- a/lib/conjur/debify.rb +++ b/lib/conjur/debify.rb @@ -240,6 +240,9 @@ def copy_packages_from_container(container, package_name, dev_package_name) c.desc "Specify a custom Dockerfile.fpm" c.flag [ :dockerfile] + c.desc "Specify files to add to the FPM image that are not included from the git repo" + c.flag [ :'additional-files' ] + c.action do |global_options,cmd_options,args| raise "project-name is required" unless project_name = args.shift @@ -253,6 +256,11 @@ def copy_packages_from_container(container, package_name, dev_package_name) dir = cmd_options[:dir] || '.' pwd = File.dirname(__FILE__) + additional_files = [] + if cmd_options[:'additional-files'] + additional_files = cmd_options[:'additional-files'].split(',').map(&:strip) + end + fpm_image = Docker::Image.build_from_dir File.expand_path('fpm', File.dirname(__FILE__)), tag: "debify-fpm", &DebugMixin::DOCKER DebugMixin.debug_write "Built base fpm image '#{fpm_image.id}'\n" dir = File.expand_path(dir) @@ -265,12 +273,13 @@ def copy_packages_from_container(container, package_name, dev_package_name) # that aren't mentioned in the dockerignore to the deb temp_dir = Dir.mktmpdir DebugMixin.debug_write "Copying git files to tmp dir '#{temp_dir}'\n" - git_files.each do |fname| + (git_files + additional_files).each do |fname| original_file = File.join(dir, fname) destination_path = File.join(temp_dir, fname) FileUtils.mkdir_p(File.dirname(destination_path)) FileUtils.cp(original_file, destination_path) end + # rename specified dockerfile to 'Dockerfile' during copy, incase name is different dockerfile_path = cmd_options[:dockerfile] || File.expand_path("debify/Dockerfile.fpm", pwd) temp_dockerfile = File.join(temp_dir, "Dockerfile")