Skip to content

Commit

Permalink
Merge pull request #28 from sourcetoad/sub-folder
Browse files Browse the repository at this point in the history
Support for "directory" parameter
  • Loading branch information
Marshall Davis authored Mar 11, 2021
2 parents 567834c + e822f93 commit d9203c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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
Expand Down Expand Up @@ -57,6 +58,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
Expand Down
6 changes: 5 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d9203c7

Please sign in to comment.