Skip to content

Commit

Permalink
Merge pull request #6 from mtrdesign/make_commands
Browse files Browse the repository at this point in the history
Added MAKE commands to handle the local dev process
  • Loading branch information
akolevutd authored May 22, 2022
2 parents 953d72f + e12c355 commit ba960df
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
docker-build:
docker build --pull -t mtrdesign/s3-logs-parser .
docker rm --force s3-logs-parser
docker run --name s3-logs-parser \
-v ${PWD}:/app \
-it mtrdesign/s3-logs-parser \
composer install

docker-bash:
docker rm --force s3-logs-parser
docker run --name s3-logs-parser \
-v ${PWD}:/app \
-it mtrdesign/s3-logs-parser \
/bin/bash

run-phpcs:
docker rm --force s3-logs-parser
docker run --name s3-logs-parser \
-v ${PWD}:/app \
-it mtrdesign/s3-logs-parser \
vendor/bin/phpcs -p --standard=PSR2 src tests

run-phpstan:
docker rm --force s3-logs-parser
docker run --name s3-logs-parser \
-v ${PWD}:/app \
-it mtrdesign/s3-logs-parser \
vendor/bin/phpstan analyse --level 7 src

run-phpunit:
docker rm --force s3-logs-parser
docker run --name s3-logs-parser \
-v ${PWD}:/app \
-it mtrdesign/s3-logs-parser \
vendor/bin/phpunit --coverage-clover=coverage.xml --verbose
26 changes: 26 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
[![StyleCI](https://styleci.io/repos/191744669/shield?style=flat-square)](https://styleci.io/repos/191744669)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-44CC11.svg?longCache=true)](https://github.com/phpstan/phpstan)

* [Getting Started](#getting-started)
* [Usage](#usage)
* [Contributing](#contributing)
* [Requirements](#requirements)
* [Installation steps](#installation-steps)
* [License](#license)

AWS S3 Logs Parser is a simple [PHP](https://php.net/) package to parse [Amazon Simple Storage Service (Amazon S3)](https://aws.amazon.com/s3/) logs into a readable JSON format. The detailed usage report will show you how much times a file is downloaded and how much bytes are transferred.

## Getting Started
Expand Down Expand Up @@ -89,6 +96,25 @@ This is how service response should look like:
}
```

## Contributing

Ensure all the guides are followed and style/test checkers pass before pushing your code.

### Requirements

* [Git](https://git-scm.com)
* [Docker](https://docker.com)
* [Docker Compose](https://docs.docker.com/compose)
* [GNU Make](https://www.gnu.org/software/make)

### Installation steps

1. Build the required services and Docker container with `$ make docker-build`
2. SSH into the container with `$ make docker-bash`
3. Confirm [code style checker](https://github.com/squizlabs/php_codesniffer) passes with `$ make run-phpcs`
4. Confirm [code quality checker](https://github.com/phpstan/phpstan) passes with `$ make run-phpstan`
5. Confirm [code texts checker](https://github.com/sebastianbergmann/phpunit) passes with `$ make run-phpunit`

## License

AWS S3 Logs Parser is open source and available under the [MIT License](LICENSE.md).

0 comments on commit ba960df

Please sign in to comment.