From dd52f6b17fc008c4a229ee09f7c553cc8ebd9d35 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 11 Mar 2021 11:31:46 -0500 Subject: [PATCH 1/2] docs: add note about "directory" param --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c310a1c..11a6a0b 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Laravel (All Properties) Example s3_folder: production excluded_files: '.git/* .env storage/framework/cache/* node_modules/*' max_polling_iterations: 60 + directory: ./ ``` Laravel (Only Required) Example @@ -52,6 +53,7 @@ Following inputs can be used as `step.with` keys | `s3_bucket` | Yes | String | S3 Bucket for archive to be uploaded. | | `s3_folder` | Yes | String | S3 Folder for archive to be uploaded within bucket. | | `excluded_files` | No | String | Space delimited list of patterns to exclude from archive | +| `directory` | No | String | Directory to archive. Defaults to root of project. | | `max_polling_iterations` | No | Number | Number of 15s iterations to poll max. (default: `60`) | ## IAM Permissions From dc59c464088e20980076099098bb34e366b0de14 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 11 Mar 2021 11:32:00 -0500 Subject: [PATCH 2/2] fix: properly zip project if directory used --- deploy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 86ea99e..a0d5a67 100755 --- a/deploy.sh +++ b/deploy.sh @@ -58,7 +58,11 @@ echo "$INPUT_EXCLUDED_FILES" | tr ' ' '\n' > "$EXCLUSION_FILE" echo "::debug::Exclusion file created for files to ignore in Zip Generation." -zip -r --quiet "$ZIP_FILENAME" "$DIR_TO_ZIP" -x "@$EXCLUSION_FILE" +if [ -n "$DIR_TO_ZIP" ]; then + cd "$DIR_TO_ZIP"; +fi + +zip -r --quiet "$ZIP_FILENAME" . -x "@$EXCLUSION_FILE" if [ ! -f "$ZIP_FILENAME" ]; then echo "::error::$ZIP_FILENAME was not generated properly (zip generation failed)." exit 1;