deterministic-zip

Crates.iodeterministic-zip
lib.rsdeterministic-zip
version0.0.4
sourcesrc
created_at2019-12-08 22:31:01.157683
updated_at2020-03-09 19:00:51.869473
descriptionA tool to generate consistent Zip files.
homepage
repositoryhttps://github.com/orf/deterministic-zip
max_upload_size
id187394
size34,568
Tom Forbes (orf)

documentation

README

Deterministic zip 🗄

Crates.io Actions Status

Regular zip utilities do not create deterministic zipfiles when given identical content. Things like the file modification times, directory iteration ordering and file permissions can change the hash of the zip file.

This is particularly annoying when using terraform with AWS Lambda. Without this tool every rebuild of the lambda source would result in a zip file with a different hash which would result in the lambda being re-deployed even if the source had not changed.

Install 💿

Homebrew (MacOS, Linux)

brew tap orf/brew, then brew install deterministic-zip

Cargo

cargo install deterministic-zip

Github releases

Download a prebuilt binary from the releases page

Usage 📀

The command is run like so: deterministic-zip [output-file] [files...]

For example: deterministic-zip output.zip my-source-code/

You can customize the compression with --compression.

Alternatives 🌎

https://github.com/bboe/deterministic_zip and https://www.npmjs.com/package/deterministic-zip

Commit count: 58

cargo fmt