chore(ci): makefile

This commit is contained in:
rjshrjndrn 2025-04-17 08:37:37 +02:00 committed by Alexander
parent 48fdf2c9c9
commit 82a29f8623
2 changed files with 29 additions and 2 deletions

24
assist-server/Makefile Normal file
View file

@ -0,0 +1,24 @@
ee ?= "false" # true to build ee
arch ?= "amd64" # default amd64
docker_runtime ?= "docker" # default docker runtime
docker_repo ?= "public.ecr.aws/p1t3u8a3"
docker_build_args ?= $(if $(filter depot,$(docker_runtime)),"--push","")
.PHONY: help
help: ## Prints help for targets with comments
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Docker
.PHONY: build
build: ## Build the backend. ee=true for ee build.
@DOCKER_BUILD_ARGS=$(docker_build_args) DOCKER_REPO=$(docker_repo) ARCH=$(arch) DOCKER_RUNTIME=$(docker_runtime) bash build.sh $(ee)
##@ Local Dev
.PHONY: scan
scan: ## Scan the backend
@echo scanning foss
@trivy fs -q .
@echo scanning ee
@trivy fs -q ../ee/assist-server/

View file

@ -1,7 +1,10 @@
ee ?= "false" # true to build ee
distro ?= "foss" # ee to build ee
app ?= "" # app name, default all
arch ?= "amd64" # default amd64
docker_repo ?= "public.ecr.aws/p1t3u8a3"
docker_runtime ?= "docker" # default docker runtime
image_tag ?= "" # image tag to build. Default is git sha short
docker_build_args ?= $(if $(filter depot,$(docker_runtime)),"--push","")
.PHONY: help
help: ## Prints help for targets with comments
@ -11,7 +14,7 @@ help: ## Prints help for targets with comments
.PHONY: build
build: ## Build the backend. ee=true for ee build. app=app name for only one app. Default build all apps.
ARCH=$(arch) DOCKER_RUNTIME=$(docker_runtime) bash build.sh $(ee) $(app)
IMAGE_TAG=$(image_tag) DOCKER_BUILD_ARGS=$(docker_build_args) DOCKER_REPO=$(docker_repo) ARCH=$(arch) DOCKER_RUNTIME=$(docker_runtime) bash build.sh $(ee) $(app)
##@ Local Dev