[#369] Add loghttp Make targets
Some checks failed
/ DCO (pull_request) Successful in 49s
/ Vulncheck (pull_request) Successful in 1m8s
/ Builds (1.20) (pull_request) Successful in 1m15s
/ Builds (1.21) (pull_request) Successful in 1m13s
/ Lint (pull_request) Successful in 1m51s
/ Tests (1.20) (pull_request) Failing after 1m2s
/ Tests (1.21) (pull_request) Successful in 1m26s
Some checks failed
/ DCO (pull_request) Successful in 49s
/ Vulncheck (pull_request) Successful in 1m8s
/ Builds (1.20) (pull_request) Successful in 1m15s
/ Builds (1.21) (pull_request) Successful in 1m13s
/ Lint (pull_request) Successful in 1m51s
/ Tests (1.20) (pull_request) Failing after 1m2s
/ Tests (1.21) (pull_request) Successful in 1m26s
Add the following Make targets: loghttp, docker/loghttp, image-loghttp. Signed-off-by: Nikita Zinkevich <n.zinkevich@yadro.com>
This commit is contained in:
parent
5af88b1e77
commit
ac0fe42d29
3 changed files with 10 additions and 3 deletions
|
@ -3,11 +3,12 @@ FROM golang:1.21 as builder
|
|||
ARG BUILD=now
|
||||
ARG REPO=git.frostfs.info/TrueCloudLab/frostfs-s3-gw
|
||||
ARG VERSION=dev
|
||||
ARG BUILD_TAGS=""
|
||||
|
||||
WORKDIR /src
|
||||
COPY . /src
|
||||
|
||||
RUN make
|
||||
RUN make BUILD_TAGS=${BUILD_TAGS}
|
||||
|
||||
# Executable image
|
||||
FROM alpine AS frostfs-s3-gw
|
||||
|
|
8
Makefile
8
Makefile
|
@ -14,6 +14,10 @@ METRICS_DUMP_OUT ?= ./metrics-dump.json
|
|||
CMDS = $(addprefix frostfs-, $(notdir $(wildcard cmd/*)))
|
||||
BINS = $(addprefix $(BINDIR)/, $(CMDS))
|
||||
|
||||
# Variables for loghttp
|
||||
BUILD_TAGS ?=
|
||||
TARGET ?= ""
|
||||
|
||||
# Variables for docker
|
||||
REPO_BASENAME = $(shell basename `go list -m`)
|
||||
HUB_IMAGE ?= "truecloudlab/$(REPO_BASENAME)"
|
||||
|
@ -40,6 +44,7 @@ $(BINS): $(BINDIR) dep
|
|||
CGO_ENABLED=0 \
|
||||
go build -v -trimpath \
|
||||
-ldflags "-X $(REPO)/internal/version.Version=$(VERSION)" \
|
||||
-tags "$(BUILD_TAGS)" \
|
||||
-o $@ ./cmd/$(subst frostfs-,,$(notdir $@))
|
||||
|
||||
$(BINDIR):
|
||||
|
@ -64,7 +69,7 @@ docker/%:
|
|||
-w /src \
|
||||
-u `stat -c "%u:%g" .` \
|
||||
--env HOME=/src \
|
||||
golang:$(GO_VERSION) make $*,\
|
||||
golang:$(GO_VERSION) make BUILD_TAGS=$(BUILD_TAGS) $*,\
|
||||
@echo "supported docker targets: all $(BINS) lint")
|
||||
|
||||
# Run tests
|
||||
|
@ -87,6 +92,7 @@ image:
|
|||
@docker build \
|
||||
--build-arg REPO=$(REPO) \
|
||||
--build-arg VERSION=$(VERSION) \
|
||||
--build-arg BUILD_TAGS=$(BUILD_TAGS) \
|
||||
--rm \
|
||||
-f .docker/Dockerfile \
|
||||
-t $(HUB_IMAGE):$(HUB_TAG) .
|
||||
|
|
2
help.mk
2
help.mk
|
@ -12,7 +12,7 @@ help:
|
|||
|
||||
# Show help for docker/% IGNORE
|
||||
help.docker/%:
|
||||
$(eval TARGETS:=$(notdir all lint) ${BINS})
|
||||
$(eval TARGETS:=$(notdir all lint loghttp) ${BINS})
|
||||
@echo ' Usage:'
|
||||
@echo ''
|
||||
@echo ' make docker/% -- Run `make %` in Golang container'
|
||||
|
|
Loading…
Reference in a new issue