From 626cbd5fb6f312fef7004238f2d2762b4697b81f Mon Sep 17 00:00:00 2001 From: Jack Humphries Date: Wed, 2 Dec 2020 04:32:57 +0000 Subject: [PATCH 1/2] Support prepending paths within generated archives --- .gitignore | 3 ++ internal/provider/archive-content.zip | Bin 412 -> 0 bytes internal/provider/archive-dir.zip | Bin 466 -> 0 bytes internal/provider/archive-file.zip | Bin 166 -> 0 bytes internal/provider/archiver.go | 4 +-- internal/provider/data_source_archive_file.go | 17 ++++++++++-- .../provider/data_source_archive_file_test.go | 18 ++++++++++++ internal/provider/zip_archiver.go | 14 ++++++---- internal/provider/zip_archiver_test.go | 26 ++++++++++++++---- 9 files changed, 66 insertions(+), 16 deletions(-) delete mode 100644 internal/provider/archive-content.zip delete mode 100644 internal/provider/archive-dir.zip delete mode 100644 internal/provider/archive-file.zip diff --git a/.gitignore b/.gitignore index 7b993acb..1caeb871 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ website/vendor # Test exclusions !command/test-fixtures/**/*.tfstate !command/test-fixtures/**/.terraform/ + +# Archives generated by tests +internal/provider/*.zip diff --git a/internal/provider/archive-content.zip b/internal/provider/archive-content.zip deleted file mode 100644 index a1c5368520a5770702d67b0eef0ccc1d73395293..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 412 zcmWIWW@Zs#-~d8&zzGyc%gjkN)GMhd;W~LjCk%)@PM`4%HDF<3VEF$(z?+@JD^RdY z1gMY?hyw^3WrS%I6Wpi|3=+b`8)b}X6dT;AGz0k*gi(x4A`A#GBD)ymMN|OyaDX?e sHe}bKYV!t~0MZ8b9J)4Sm!N8!2Gs`kNPssh8^|HdK)4i0KLl|Y0AeUUN&o-= diff --git a/internal/provider/archive-dir.zip b/internal/provider/archive-dir.zip deleted file mode 100644 index b88214af33bd92826043583cbdb0976773ef63ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 466 zcmWIWW@Zs#-~d7f2E{HQ0SCfBR!M4ciEc_}k&%8{W=^W1UP(m>*U1w)VL;?@`iy6& z0SgNQ!~g#Q-s~J+fr4EkKrMVg96*Ah#+Zh(!3|9_kWV3OC@;*VAV(q_r{Srq7wB>B zyte0AZAQ4Ed)~bNA_dd}GC07Skx7IZ5dg@(00jUHENKL>umlIX0mv>!H6Rqj0I=85 k4M27s$YU_Dq;VCH33dU@n*rXeY#?c7AlwV2|AROT07x5NssI20 diff --git a/internal/provider/archive-file.zip b/internal/provider/archive-file.zip deleted file mode 100644 index b2a7ea85c992d3350de84eddce675a32292842a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166 zcmWIWW@Zs#-~d7f2E{HQ0SCN5R!M4ciEdhEPO4r>MG4o*6FOl)q~WQn7wB>Byte0A zZAKObhX4NqyxBSSym|jc3aCW{hy%PCnM9Zo#v;psjD>+EjUX0^B>~>7Y#>2KAhZV3 Ip&$+e0Ev Date: Wed, 2 Dec 2020 04:40:11 +0000 Subject: [PATCH 2/2] Add prepended path to documentation --- website/docs/d/archive_file.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/d/archive_file.html.markdown b/website/docs/d/archive_file.html.markdown index 48c9c503..5540d21b 100644 --- a/website/docs/d/archive_file.html.markdown +++ b/website/docs/d/archive_file.html.markdown @@ -70,6 +70,8 @@ NOTE: One of `source`, `source_content_filename` (with `source_content`), `sourc * `excludes` - (Optional) Specify files to ignore when reading the `source_dir`. +* `prepended_path` - (Optional) Specifies the path prefix to prepend to `source_file` or `source_dir` in the archive path. + The `source` block supports the following: * `content` - (Required) Add this content to the archive with `filename` as the filename.