Skip to content

Commit

Permalink
Merge pull request #55 from pratikkumar-mohite/pm/issue-34
Browse files Browse the repository at this point in the history
Issue 54: updated readme with AWS_UPLOAD_TEST_FILES
  • Loading branch information
pratikkumar-mohite authored Oct 13, 2024
2 parents 9fa2914 + 302b87f commit 0e103a7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,29 @@ This project is a Go application designed to delete AWS S3 buckets. It retrieve
## Test
As of now the actual test are not there because we dont have s3 mock apis to mimic the s3 object behaviour specifically in go, this project has dependency on [S3Mock project](https://github.com/pratikkumar-mohite/S3Mock) to enable the `go test`.

There is an alternative to test the application with actual AWS S3 bucket with s3-cleaner.

1. Perform the above Build stage
2. Create test directory
```sh
mkdir -p test/files
```
3. Create dummy files
```sh
dd if=/dev/urandom of=test/files/file1.txt count=100 bs=1M
dd if=/dev/urandom of=test/files/file2.txt count=100 bs=1M
```
4. Export AWS_UPLOAD_TEST_FILES
```sh
export AWS_UPLOAD_TEST_FILES=true
```
5. Run the application
```sh
make run
```
This will upload `file1.txt` and `file2.txt` to S3 bucket and then perform S3 object + bucket cleanup.


## Usage

1. Ensure you have AWS credentials configured. You can set them up using the AWS CLI(ignore if already set):
Expand All @@ -47,10 +70,11 @@ As of now the actual test are not there because we dont have s3 mock apis to mim
export AWS_DELETE_S3_BUCKET=pratikkumar-mohite-test
export AWS_PROFILE=pratikkumar-mohite-aws
```
2. Run the application:
3. Run the application:
```sh
s3-cleaner
```
![Usage](docs/gif/s3-cleaner-usage.gif)

## Contributing

Expand Down
Binary file added docs/gif/s3-cleaner-usage.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0e103a7

Please sign in to comment.