Skip to content

Commit 0c59d3f

Browse files
test: mock-support-server (#124)
1 parent e146c5f commit 0c59d3f

19 files changed

+2457
-0
lines changed

mock-support-server/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM golang:1.24-alpine3.22 AS build
2+
WORKDIR /src/mock-support-server
3+
4+
# Copy module files and download dependencies (cached)
5+
COPY mock-support-server/go.mod ./go.mod
6+
COPY mock-support-server/go.sum ./go.sum
7+
RUN --mount=type=cache,target=/go/pkg/mod \
8+
go mod download
9+
10+
# Copy sources (protos are already generated and checked in)
11+
COPY mock-support-server/main.go ./main.go
12+
COPY mock-support-server/genproto ./genproto
13+
14+
# Build statically linked binary
15+
RUN --mount=type=cache,target=/go/pkg/mod \
16+
--mount=type=cache,target=/root/.cache/go-build \
17+
CGO_ENABLED=0 go build -o /out/mock-support-server .
18+
19+
FROM alpine:3.22
20+
COPY --from=build /out/mock-support-server /mock-support-server
21+
COPY data/account_id /data/account_id
22+
COPY data/resolver_state_current.pb /data/resolver_state_current.pb
23+
# Single unified port for HTTP+h2c (REST+gRPC)
24+
ENV PORT=8081
25+
EXPOSE 8081
26+
ENTRYPOINT ["/mock-support-server"]
27+
28+

mock-support-server/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
PROTO_SRC := $(shell find proto/mock -type f -name '*.proto' | sort)
2+
GEN_DIR := genproto
3+
GOBIN := $(shell go env GOPATH)/bin
4+
5+
.PHONY: gen run-iam clean
6+
7+
gen: $(PROTO_SRC)
8+
@mkdir -p $(GEN_DIR)
9+
PATH="$(GOBIN):$$PATH" protoc -I proto \
10+
--go_out=paths=source_relative:$(GEN_DIR) \
11+
--go-grpc_out=paths=source_relative:$(GEN_DIR) \
12+
--grpc-gateway_out=paths=source_relative,allow_delete_body=true:$(GEN_DIR) \
13+
$(PROTO_SRC)
14+
15+
clean:
16+
rm -rf $(GEN_DIR)
17+
18+

mock-support-server/genproto/mock/flags_admin.pb.go

Lines changed: 193 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mock-support-server/genproto/mock/flags_admin.pb.gw.go

Lines changed: 156 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)