Class: Buildizer::Target::Fpm
- Includes:
- PackageNameMod
- Defined in:
- lib/buildizer/target/fpm.rb
Instance Attribute Summary collapse
-
#fpm_config_files ⇒ Object
readonly
Returns the value of attribute fpm_config_files.
-
#fpm_conflicts ⇒ Object
readonly
Returns the value of attribute fpm_conflicts.
-
#fpm_depends ⇒ Object
readonly
Returns the value of attribute fpm_depends.
-
#fpm_description ⇒ Object
readonly
Returns the value of attribute fpm_description.
-
#fpm_files ⇒ Object
readonly
Returns the value of attribute fpm_files.
-
#fpm_provides ⇒ Object
readonly
Returns the value of attribute fpm_provides.
-
#fpm_replaces ⇒ Object
readonly
Returns the value of attribute fpm_replaces.
-
#fpm_script ⇒ Object
readonly
Returns the value of attribute fpm_script.
-
#fpm_url ⇒ Object
readonly
Returns the value of attribute fpm_url.
Attributes inherited from Base
#before_build, #build_dep, #builder, #image, #maintainer, #name, #package_cloud, #package_name, #package_version, #prepare
Instance Method Summary collapse
- #_expand_files_directive(files) ⇒ Object
- #fpm_config_files_expand ⇒ Object
- #fpm_files_expand ⇒ Object
- #image_work_path ⇒ Object
-
#initialize(builder, image, fpm_script: [], fpm_config_files: {}, fpm_files: {}, fpm_conflicts: [], fpm_replaces: {}, fpm_provides: [], fpm_depends: [], fpm_description: nil, fpm_url: nil, **kwargs, &blk) ⇒ Fpm
constructor
A new instance of Fpm.
- #package_version_tag_param_name ⇒ Object
Methods included from PackageNameMod
#container_package_name, #package_release, #package_upstream_version
Methods inherited from Base
#_package_cloud_path, #base_package_name, #container_package_archive_name, #container_package_archive_path, #container_package_name, #container_package_path, #docker_cache_image, #docker_image, #docker_image_repository, #docker_image_tag, #image_build_path, #image_extra_path, #maintainer_email, #package_version_tag
Constructor Details
#initialize(builder, image, fpm_script: [], fpm_config_files: {}, fpm_files: {}, fpm_conflicts: [], fpm_replaces: {}, fpm_provides: [], fpm_depends: [], fpm_description: nil, fpm_url: nil, **kwargs, &blk) ⇒ Fpm
Returns a new instance of Fpm.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/buildizer/target/fpm.rb', line 16 def initialize(builder, image, fpm_script: [], fpm_config_files: {}, fpm_files: {}, fpm_conflicts: [], fpm_replaces: {}, fpm_provides: [], fpm_depends: [], fpm_description: nil, fpm_url: nil, **kwargs, &blk) super(builder, image, **kwargs) do @fpm_script = fpm_script @fpm_config_files = fpm_config_files @fpm_files = fpm_files @fpm_conflicts = fpm_conflicts @fpm_replaces = fpm_replaces @fpm_provides = fpm_provides @fpm_depends = fpm_depends @fpm_description = fpm_description @fpm_url = fpm_url yield if block_given? end end |
Instance Attribute Details
#fpm_config_files ⇒ Object (readonly)
Returns the value of attribute fpm_config_files.
7 8 9 |
# File 'lib/buildizer/target/fpm.rb', line 7 def fpm_config_files @fpm_config_files end |
#fpm_conflicts ⇒ Object (readonly)
Returns the value of attribute fpm_conflicts.
9 10 11 |
# File 'lib/buildizer/target/fpm.rb', line 9 def fpm_conflicts @fpm_conflicts end |
#fpm_depends ⇒ Object (readonly)
Returns the value of attribute fpm_depends.
12 13 14 |
# File 'lib/buildizer/target/fpm.rb', line 12 def fpm_depends @fpm_depends end |
#fpm_description ⇒ Object (readonly)
Returns the value of attribute fpm_description.
13 14 15 |
# File 'lib/buildizer/target/fpm.rb', line 13 def fpm_description @fpm_description end |
#fpm_files ⇒ Object (readonly)
Returns the value of attribute fpm_files.
8 9 10 |
# File 'lib/buildizer/target/fpm.rb', line 8 def fpm_files @fpm_files end |
#fpm_provides ⇒ Object (readonly)
Returns the value of attribute fpm_provides.
11 12 13 |
# File 'lib/buildizer/target/fpm.rb', line 11 def fpm_provides @fpm_provides end |
#fpm_replaces ⇒ Object (readonly)
Returns the value of attribute fpm_replaces.
10 11 12 |
# File 'lib/buildizer/target/fpm.rb', line 10 def fpm_replaces @fpm_replaces end |
#fpm_script ⇒ Object (readonly)
Returns the value of attribute fpm_script.
6 7 8 |
# File 'lib/buildizer/target/fpm.rb', line 6 def fpm_script @fpm_script end |
#fpm_url ⇒ Object (readonly)
Returns the value of attribute fpm_url.
14 15 16 |
# File 'lib/buildizer/target/fpm.rb', line 14 def fpm_url @fpm_url end |
Instance Method Details
#_expand_files_directive(files) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/buildizer/target/fpm.rb', line 51 def (files) files.reduce({}) do |res, (dst, src)| if src.is_a? Array res.merge src.map {|src_file| [File.join(dst, src_file), src_file]}.to_h elsif src.nil? res.merge dst => File.basename(dst) else res.merge dst => src end end end |
#fpm_config_files_expand ⇒ Object
43 44 45 |
# File 'lib/buildizer/target/fpm.rb', line 43 def fpm_config_files end |
#fpm_files_expand ⇒ Object
47 48 49 |
# File 'lib/buildizer/target/fpm.rb', line 47 def fpm_files end |
#image_work_path ⇒ Object
35 36 37 |
# File 'lib/buildizer/target/fpm.rb', line 35 def image_work_path builder.work_path.join('fpm').join(package_name).join(package_version).join(name) end |
#package_version_tag_param_name ⇒ Object
39 40 41 |
# File 'lib/buildizer/target/fpm.rb', line 39 def package_version_tag_param_name :package_version end |