Feat: add makefile target for mac
Some checks failed
Go test / run-go-vet (push) Successful in 5s
Go test / check-swagger-up-to-date (push) Successful in 9s
Go test / run-go-test (push) Failing after 10s
Go test / release-image (push) Has been skipped
Go test / cleanup-go-test (push) Successful in 4s

This commit is contained in:
2025-12-13 01:21:20 +08:00
parent ea88d8fa43
commit 6b5b7d257d
3 changed files with 18 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: all swagger install postgres test test-ci \
.PHONY: all swagger install postgres test test-ci mac \
docker docker-quiet docker-clean
SWAG ?= go run github.com/swaggo/swag/cmd/swag@v1.16.4
@@ -10,14 +10,26 @@ GO_ENV += CGO_ENABLED=0
SOURCE := $(shell find . -type f -name '*.go')
TARGET := backend
all: swagger docker
all: swagger docker-build-native docker
mac: swagger docker-build-run docker
swagger:
$(SWAG) fmt
$(SWAG) init -o docs -g cmds/serve.go -pdl 1
docker: $(TARGET)
$(COMPOSE) up -d --force-recreate --build backend
docker-build-native: $(TARGET)
$(DOCKER) build . --target native \
-t go2025/backend:native \
-t go2025/backend:latest
docker-build-run:
$(DOCKER) build . --target build-run \
-t go2025/backend:build-run \
-t go2025/backend:latest
docker:
$(COMPOSE) up -d --force-recreate backend
$(TARGET): $(SOURCE)
$(GO_ENV) go build -o $@

View File

@@ -60,9 +60,7 @@ services:
restart: unless-stopped
backend:
build:
context: .
target: native
image: go2025/backend:latest
env_file:
- path: ./.env
required: false

View File

@@ -192,7 +192,7 @@ func (self *BunDatabase) UpdateAliases(
return err
}
_, err = tx.NewDelete().
Model((*models.AliasImage)).
Model((*models.AliasImage)(nil)).
Where("image_id = ?", imageId).
Exec(ctx)
if err != nil {