This repository has been archived on 2024-01-12. You can view files and clone it, but cannot push or open issues or pull requests.
summer/Makefile

37 lines
882 B
Makefile

.PHONY: all build test dev dev-down run-cli
SHELL := bash
VERSION := $(shell git describe --dirty --always)
ifdef CI_BUILD_NUMBER
VERSION := "build.$(CI_BUILD_NUMBER)-$(VERSION)"
endif
BUILD_DATE = $(shell date '+%Y-%m-%d %H:%M:%S')
UTILS_PKG = code.mrmelon54.com/melon/summer/pkg/utils
LD_FLAGS = -s -w -X '${UTILS_PKG}.BuildVersion=${VERSION}' -X '${UTILS_PKG}.BuildDate=${BUILD_DATE}'
CC = go
BUILD_DIR = $(shell pwd)
PROGRAMS = azalea buttercup marigold rose
ifdef debug
TAGS=DEBUG
endif
all: build
build:
"$(BUILD_DIR)/scripts/raw-build.sh" "$(BUILD_DIR)" "$(CC)" "$(LD_FLAGS)" "$(PROGRAMS)" "$(TAGS)"
test:
$(CC) test ./... -tags TEST
dev:
docker compose -f docker-compose.development.yml build
docker compose -f docker-compose.development.yml up
dev-down:
docker compose -f docker-compose.development.yml down
run-cli:
docker exec -ti summer-cli-1 /bin/bash