https://github.com/daronenko/go-template
https://github.com/daronenko/go-template
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/daronenko/go-template
- Owner: daronenko
- Created: 2024-09-02T08:55:38.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-21T19:51:24.000Z (9 months ago)
- Last Synced: 2025-01-18T08:19:11.524Z (5 months ago)
- Language: Makefile
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Go Template
## Requirements
- [go](https://go.dev/doc/install)
- [goose](https://github.com/pressly/goose)
- [golangci-lint](https://golangci-lint.run/welcome/install/#local-installation)
- [make](https://www.gnu.org/software/make/)
- [docker](https://docs.docker.com/get-started/get-docker/)
- [docker compose](https://docs.docker.com/compose/install/)
- [kubectl](https://kubernetes.io/docs/tasks/tools/)
- [minikube](https://kubernetes.io/ru/docs/tasks/tools/install-minikube/)## Getting Started
1. Run `make help` to get documentation
```shell
make help
```2. Try some commands inside microservice directory
```shell
cd service/hellomake lint
make formatmake test
make view-coverage-htmlmake docker-build
make docker-postgres-migrate
make docker-start
make postgres-statemake docker-ash # run `exit` to exit
make docker-psql # run `\q` to exitcurl localhost:8080/health
make docker-stop
```3. Try to deploy project to `minikube` cluster
```shell
cd ../.. # go to root of the projectmake cluster
make deploy
make deploy-postgres-migrate service=hellomake port-forwarding
# add line `127.0.0.1 deploy.local` to the `/etc/hosts` file
echo '127.0.0.1 deploy.local' | sudo tee -a /etc/hosts >> /dev/nullcurl -k https://deploy.local/api/hello/health
make delete-cluster
```