From 6c5d8c49c2b39371cf78b902bc996599ae1a242a Mon Sep 17 00:00:00 2001 From: CHIKAMATSU Naohiro Date: Tue, 26 Dec 2023 21:52:20 +0900 Subject: [PATCH 1/2] Update README --- README.md | 16 +- doc/common/developers.md | 49 + doc/img/localstack-readme-banner.svg | 1390 ++++++++++++++++++++++++++ 3 files changed, 1453 insertions(+), 2 deletions(-) create mode 100644 doc/common/developers.md create mode 100644 doc/img/localstack-readme-banner.svg diff --git a/README.md b/README.md index 37d4c6a..5cf7faa 100644 --- a/README.md +++ b/README.md @@ -35,12 +35,24 @@ The rainbow project is a toolset for managing AWS resources. This project consis This project is licensed under the terms of the MIT license. See the [LICENSE](./LICENSE) file. ## Contributing -Contributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md), [Code of Conduct](./CODE_OF_CONDUCT.md), [Principle](./doc/common/principle.md) for more information. This project incurs costs on AWS, and financial support from you would make it easier to maintain the project. If you wish to provide financial support, please do so through [GitHub Sponsors](https://github.com/sponsors/nao1215) +Contributions are welcome! Please see the following documents for details: +- [CONTRIBUTING.md](./CONTRIBUTING.md) +- [Code of Conduct](./CODE_OF_CONDUCT.md) +- [Principle](./doc/common/principle.md) +- [Development Eviorment Setup](./doc/common/developers.md) + +This project incurs costs on AWS, and financial support from you would make it easier to maintain the project. If you wish to provide financial support, please do so through [GitHub Sponsors](https://github.com/sponsors/nao1215) ## GitHub Star History -Stars from you motivate me to keep going. +GitHub Star is motivation for me. If you like this project, please star it. [![Star History Chart](https://api.star-history.com/svg?repos=nao1215/rainbow&type=Date)](https://star-history.com/#nao1215/rainbow&Date) +## Special Thanks +![localstack](./doc/img/localstack-readme-banner.svg) +[LocalStack](https://www.localstack.cloud/) is a service that mocks AWS, covering a wide range of AWS services. It is not easy to set up an AWS infrastructure for personal development, but LocalStack has lowered the barrier for server application development. + +It has been incredibly helpful for my technical learning, and among the open-source software (OSS) I encountered in 2023, LocalStack is undoubtedly the best tool. I would like to take this opportunity to express my gratitude. + ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): diff --git a/doc/common/developers.md b/doc/common/developers.md new file mode 100644 index 0000000..554c07f --- /dev/null +++ b/doc/common/developers.md @@ -0,0 +1,49 @@ +## Development Eviorment Setup +### Install Prerequisites +- [Install Golang](https://go.dev/doc/install) +- [Install make](https://www.gnu.org/software/make/) +- [Install Docker](https://docs.docker.com/get-docker/) +- [Install Docker Compose](https://docs.docker.com/compose/install/) +- Install development tools by running the following command: + ```shell + make tools + ``` + +### Makefile Usage +If you want to print help information, you can run the following command: +```shell +$ make +build Build binary +changelog Generate changelog +clean Clean project +docker Start docker (localstack) +generate Generate code from templates +test Start unit test +tools Install dependency tools +``` + +### localstack Setup +The localstack is used to simulate the AWS environment. First, you configure a custom profile to use with LocalStack. Add the following profile to your AWS configuration file (by default, this file is at ~/.aws/config): + +```shell +[profile localstack] +region=us-east-1 +output=json +endpoint_url = http://localhost:4566 +``` + +Add the following profile to your AWS credentials file (by default, this file is at ~/.aws/credentials): +```shell +[localstack] +aws_access_key_id=test +aws_secret_access_key=test +``` + +> [!NOTE] +> Alternatively, you can also set the AWS_PROFILE=localstack environment variable, in which case the --profile localstack parameter can be omitted in the commands above. + +### Run localstack +```shell +make docker +``` + diff --git a/doc/img/localstack-readme-banner.svg b/doc/img/localstack-readme-banner.svg new file mode 100644 index 0000000..54c7864 --- /dev/null +++ b/doc/img/localstack-readme-banner.svg @@ -0,0 +1,1390 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From aa26d6acf443b2c358257b34bfbda244c505972a Mon Sep 17 00:00:00 2001 From: CHIKAMATSU Naohiro Date: Tue, 26 Dec 2023 21:52:47 +0900 Subject: [PATCH 2/2] add: docker target and generate target --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 40aa761..4bd191e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build test clean changelog tools help +.PHONY: build test clean changelog tools help docker generate S3HUB = s3hub VERSION = $(shell git describe --tags --abbrev=0) @@ -20,7 +20,7 @@ build: ## Build binary clean: ## Clean project -rm -rf $(S3HUB) cover.out cover.html -test: ## Start test +test: ## Start unit test env GOOS=$(GOOS) $(GO_TEST) -cover $(GO_PKGROOT) -coverprofile=cover.out $(GO_TOOL) cover -html=cover.out -o cover.html @@ -32,6 +32,12 @@ tools: ## Install dependency tools $(GO_INSTALL) github.com/nao1215/hottest@latest $(GO_INSTALL) github.com/google/wire/cmd/wire@latest +generate: ## Generate code from templates + $(GO) generate ./... + +docker: ## Start docker (localstack) + docker compose up -d + .DEFAULT_GOAL := help help: @grep -E '^[0-9a-zA-Z_-]+[[:blank:]]*:.*?## .*$$' $(MAKEFILE_LIST) | sort \