Update Makefile targets and doc
This commit is contained in:
11
Makefile
11
Makefile
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
BINARY_NAME=middleware
|
BINARY_NAME=middleware
|
||||||
DOCKER_IMAGE=slack-to-ntfy
|
DOCKER_IMAGE=slack-to-ntfy
|
||||||
|
VERSION?=latest
|
||||||
|
|
||||||
|
# DOCKER_REGISTRY is optional. If set, it will be used for pushing. Otherwise, images are loaded locally.
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
help:
|
help:
|
||||||
@@ -29,7 +32,13 @@ clean:
|
|||||||
rm -f $(BINARY_NAME)
|
rm -f $(BINARY_NAME)
|
||||||
|
|
||||||
docker-build:
|
docker-build:
|
||||||
docker build -t $(DOCKER_IMAGE) .
|
ifndef DOCKER_REGISTRY
|
||||||
|
# DOCKER_REGISTRY is not set, load locally
|
||||||
|
docker buildx build --platform linux/amd64,linux/arm64 -t $(DOCKER_IMAGE):$(VERSION) --load .
|
||||||
|
else
|
||||||
|
# DOCKER_REGISTRY is set, push to registry
|
||||||
|
docker buildx build --platform linux/amd64,linux/arm64 -t $(DOCKER_REGISTRY)/$(DOCKER_IMAGE):$(VERSION) --push .
|
||||||
|
endif
|
||||||
|
|
||||||
docker-run:
|
docker-run:
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -8,7 +8,7 @@ A lightweight Go service that acts as a middleware between Slack webhooks and nt
|
|||||||
- ✅ Forwards alerts to self-hosted ntfy servers
|
- ✅ Forwards alerts to self-hosted ntfy servers
|
||||||
- ✅ Bearer token authentication support
|
- ✅ Bearer token authentication support
|
||||||
- ✅ Health check endpoint
|
- ✅ Health check endpoint
|
||||||
- ✅ Lightweight Docker container (~8MB)
|
- ✅ Lightweight Docker container (~8.4MB)
|
||||||
- ✅ High performance and low resource usage
|
- ✅ High performance and low resource usage
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
@@ -59,18 +59,18 @@ A lightweight Go service that acts as a middleware between Slack webhooks and nt
|
|||||||
|
|
||||||
### Build locally
|
### Build locally
|
||||||
```bash
|
```bash
|
||||||
go build -o middleware main.go
|
make build
|
||||||
./middleware
|
make run
|
||||||
```
|
```
|
||||||
|
|
||||||
### Build Docker image
|
### Build Docker image
|
||||||
```bash
|
```bash
|
||||||
docker build -t slack-to-ntfy .
|
make docker-build
|
||||||
```
|
```
|
||||||
|
|
||||||
### Run tests
|
### Run tests
|
||||||
```bash
|
```bash
|
||||||
go test ./...
|
make test
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
Reference in New Issue
Block a user