cookbook 'zipr', '= 2.0.2'
zipr (11) Versions 2.0.2 Follow0
Provides idempotent compression and extraction resources for zip and 7-zip files
cookbook 'zipr', '= 2.0.2', :supermarket
knife supermarket install zipr
knife supermarket download zipr
zipr Cookbook
Provides resources and helper methods for extracting and compressing files
Contents
- Attributes
-
- zipr_archive Extracts a zip file idempotently or creates a zip archive.
- zipr_sfx Creates a self extracting 7-zip archive.
-
- default Default recipe
Requirements
Platforms
- Windows Server 2012 (R2)
- Centos
Chef
- Chef 12+
- If chef-client version is <= 13.4, pin windows cookbook to a version <= 4.3.4 if using windows
Cookbooks
- seven_zip
Attributes
-
node['seven_zip']['home']
- 7-zip home directory. default is%PROGRAMFILES%\7-zip
Resource/Provider
zipr_archive
Creates or extracts an archive
Actions
default
= :extract
-
:extract
- extracts an existing zip file; suggestion: use a :before notification to download the zip file -
:create
- creates a zip file -
:create_if_missing
- creates a zip file only if it does not exist
Properties
-
archive_path
- Specifies the path to the zip file. String, name property -
delete_after_processing
- Deletes source files after processing, such as a zip file when extracting or source files when creating an archive. True or false, default:false
-
exclude_files
- Exclude files from extraction or creation. Use relative paths for extraction and full paths for creation. String or array of strings, default:[]
-
archive_type
- The type of archive being created or extracted. Symbol, default::zip
, options::zip
,:seven_zip
-
target_files
- The files to be compressed, only used during:create
and:create_if_missing
. String or array of strings, default:[]
-
destination_folder
- The destination folder where a zip file is extracted, only used during:extract
. String, required for action::extract
-
exclude_unless_missing
- Exclude files from extraction if the destination file already exists, only used during:extract
. String or array of strings, default:[]
Examples
# Extract files from test_archive.zip zipr_archive '~/zipr_test/test_archive.zip' do destination_folder '~/zipr_test/extract_test' exclude_files ['file1.txt', 'subfolder/file2.txt'] exclude_unless_missing 'app.config' delete_after_processing true action :extract notifies :create, 'remote_file[~/zipr_test/test_archive.zip]', :before end
# Create the archive test_archive.7z from the files returned by Dir.glob('~/zipr_test/**/*') excluding ~/zipr_test/file1.txt zipr_archive "~/zipr_test/test_archive.7z" do archive_type :seven_zip target_files Dir.glob('~/zipr_test/**/*') exclude_files '~/zipr_test/file1.txt' action :create end
Usage
default recipe
Installs seven_zip_ruby and rubyzip gems
License and Author
- Author:: Alex Munoz (amunoz951@gmail.com)
Copyright 2016-2018, Alex Munoz. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Dependent cookbooks
build-essential >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
2.0.2 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
2.0.2 passed this metric
Foodcritic Metric
2.0.2 failed this metric
FC121: Cookbook depends on cookbook made obsolete by Chef 14: zipr/metadata.rb:1
Run with Foodcritic Version 14.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.0.2 failed this metric
Failure: Cookbook should not contain binaries. Found:
zipr/files/default/seven_zip_ruby-1.2.5.gem
zipr/files/default/rubyzip-1.2.0.gem
zipr/files/default/7zsd_All.sfx
Testing File Metric
2.0.2 passed this metric
Version Tag Metric
2.0.2 passed this metric
2.0.2 failed this metric
2.0.2 passed this metric
Foodcritic Metric
2.0.2 failed this metric
FC121: Cookbook depends on cookbook made obsolete by Chef 14: zipr/metadata.rb:1
Run with Foodcritic Version 14.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.0.2 failed this metric
Failure: Cookbook should not contain binaries. Found:
zipr/files/default/seven_zip_ruby-1.2.5.gem
zipr/files/default/rubyzip-1.2.0.gem
zipr/files/default/7zsd_All.sfx
Testing File Metric
2.0.2 passed this metric
Version Tag Metric
2.0.2 passed this metric
2.0.2 failed this metric
Run with Foodcritic Version 14.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
2.0.2 failed this metric
Failure: Cookbook should not contain binaries. Found:
zipr/files/default/seven_zip_ruby-1.2.5.gem
zipr/files/default/rubyzip-1.2.0.gem
zipr/files/default/7zsd_All.sfx
Testing File Metric
2.0.2 passed this metric
Version Tag Metric
2.0.2 passed this metric
2.0.2 passed this metric
2.0.2 passed this metric