Files
scratchbox/Makefile
T
s1d3sw1ped bc9077660b
CI / Go Tests (push) Failing after 9s
CI / Build (push) Successful in 9s
Format / gofmt (push) Successful in 7s
Release Artifacts / Validate release tag (push) Successful in 1s
Release Artifacts / Build and release executables (push) Failing after 8s
Release Artifacts / Build and release Docker image (push) Has been skipped
Add example environment configuration and Docker Compose setup
- Introduced a new `.env.example` file to provide a template for environment variables used by the Scratchbox server.
- Added a `docker-compose.example.yml` file to facilitate easy deployment of the Scratchbox service with Docker.
- Updated `docker-entrypoint.sh` to enforce environment variable settings for server configuration.
- Removed the generation of a config key file from the workflow, simplifying the configuration process.
- Adjusted the README.md to reflect changes in configuration management and usage instructions.
2026-06-01 04:36:53 -05:00

47 lines
1.1 KiB
Makefile

APP_NAME := scratchbox
CMD_DIR := ./cmd/scratchbox
BIN_DIR := ./bin
BIN := $(BIN_DIR)/$(APP_NAME)
CONFIG ?= config.yaml
DOCKER_IMAGE ?= scratchbox:dev
.PHONY: help run dev build docker test test-race fmt clean
help:
@echo "Targets:"
@echo " make run - Alias for make dev"
@echo " make dev - Build and run server (CONFIG=$(CONFIG))"
@echo " make build - Build Svelte UI and binary to $(BIN)"
@echo " make docker - Build Docker image (DOCKER_IMAGE=$(DOCKER_IMAGE))"
@echo " make test - Run all Go tests with timeout and shuffle"
@echo " make test-race - Run all Go tests with race detector and timeout"
@echo " make fmt - Format Go code"
@echo " make clean - Remove built artifacts"
run: dev
dev: build
$(BIN) server --config $(CONFIG)
build: clean
npm --prefix ./web/ui run build
mkdir -p $(BIN_DIR)
CGO_ENABLED=0 go build -o $(BIN) $(CMD_DIR)
docker:
docker build -t $(DOCKER_IMAGE) .
test:
go test -timeout 30s -shuffle=on ./...
test-race:
go test -race -timeout 30s -shuffle=on ./...
fmt:
go fmt ./...
clean:
rm -rf web/static
rm -rf $(CONFIG)
rm -rf $(BIN_DIR)