From 80d61b1527831b657a8c0ce96908be17f37fa233 Mon Sep 17 00:00:00 2001 From: "jaeseung.bae" Date: Thu, 23 May 2024 09:37:52 +0900 Subject: [PATCH 1/5] build: refresh docker container's bound volume for proto and swagger generation --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1245af80fe..1b365dab32 100644 --- a/Makefile +++ b/Makefile @@ -402,7 +402,7 @@ proto-all: proto-format proto-lint proto-gen proto-gen: @echo "Generating Protobuf files" - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --rm --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ sh ./scripts/protocgen.sh; fi @go mod tidy @@ -413,7 +413,7 @@ proto-gen-any: proto-swagger-gen: @echo "Generating Protobuf Swagger" - @if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then $(DOCKER) start -a $(containerProtoGenSwagger); else $(DOCKER) run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ + @if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then $(DOCKER) start -a $(containerProtoGenSwagger); else $(DOCKER) run --rm --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ sh ./scripts/protoc-swagger-gen.sh; fi proto-format: From f351a3631c5f3946f3fc7ef3a2a14a1df735dd39 Mon Sep 17 00:00:00 2001 From: "jaeseung.bae" Date: Fri, 24 May 2024 14:28:03 +0900 Subject: [PATCH 2/5] Revert "build: refresh docker container's bound volume for proto and swagger generation" This reverts commit 80d61b1527831b657a8c0ce96908be17f37fa233. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1b365dab32..1245af80fe 100644 --- a/Makefile +++ b/Makefile @@ -402,7 +402,7 @@ proto-all: proto-format proto-lint proto-gen proto-gen: @echo "Generating Protobuf files" - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --rm --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ sh ./scripts/protocgen.sh; fi @go mod tidy @@ -413,7 +413,7 @@ proto-gen-any: proto-swagger-gen: @echo "Generating Protobuf Swagger" - @if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then $(DOCKER) start -a $(containerProtoGenSwagger); else $(DOCKER) run --rm --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ + @if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then $(DOCKER) start -a $(containerProtoGenSwagger); else $(DOCKER) run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ sh ./scripts/protoc-swagger-gen.sh; fi proto-format: From 6b093d65e8e193f2755dfe7ca3e04449644a7dfc Mon Sep 17 00:00:00 2001 From: "jaeseung.bae" Date: Fri, 24 May 2024 14:31:37 +0900 Subject: [PATCH 3/5] build: add current directory as suffix for docker container --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1245af80fe..a82034aa4e 100644 --- a/Makefile +++ b/Makefile @@ -394,8 +394,9 @@ easyjson-gen: containerProtoVer=v0.2 containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer) -containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer) -containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer) +containerSuffix=$(shell echo $(CURDIR) | sed 's/\//./g') +containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)-$(containerSuffix) +containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer)-$(containerSuffix) containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer) proto-all: proto-format proto-lint proto-gen From 5560446d074594f85b1e8ae7a0933a3b81403cf8 Mon Sep 17 00:00:00 2001 From: "jaeseung.bae" Date: Fri, 24 May 2024 14:35:26 +0900 Subject: [PATCH 4/5] chore: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2003eab02e..b238cff226 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -112,3 +112,4 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (docs) [\#1059](https://github.com/Finschia/finschia-sdk/pull/1059) create ERRORS.md for x/module * (docs) [\#1083](https://github.com/Finschia/finschia-sdk/pull/1083) Add detailed explanation about default events * (x/token,collection) [#1201](https://github.com/Finschia/finschia-sdk/pull/1201) Deprecate legacy features on x/token,collection +* (build) [\#1393](https://github.com/Finschia/finschia-sdk/pull/1393) add current directory as suffix for docker container \ No newline at end of file From 253f77bc52b6ea291cb062b1e8023e39d1e18bda Mon Sep 17 00:00:00 2001 From: "jaeseung.bae" Date: Fri, 24 May 2024 16:00:14 +0900 Subject: [PATCH 5/5] chore: update pattern --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a82034aa4e..9ff1bc3c1d 100644 --- a/Makefile +++ b/Makefile @@ -394,7 +394,7 @@ easyjson-gen: containerProtoVer=v0.2 containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer) -containerSuffix=$(shell echo $(CURDIR) | sed 's/\//./g') +containerSuffix=$(shell echo $(CURDIR) | sed 's/[^[:alnum:]_-]/./g') containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)-$(containerSuffix) containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer)-$(containerSuffix) containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer) @@ -403,28 +403,28 @@ proto-all: proto-format proto-lint proto-gen proto-gen: @echo "Generating Protobuf files" - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v "$(CURDIR)":/workspace --workdir /workspace $(containerProtoImage) \ sh ./scripts/protocgen.sh; fi @go mod tidy # This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed proto-gen-any: @echo "Generating Protobuf Any" - $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen-any.sh + $(DOCKER) run --rm -v "$(CURDIR)":/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen-any.sh proto-swagger-gen: @echo "Generating Protobuf Swagger" - @if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then $(DOCKER) start -a $(containerProtoGenSwagger); else $(DOCKER) run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ + @if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then $(DOCKER) start -a $(containerProtoGenSwagger); else $(DOCKER) run --name $(containerProtoGenSwagger) -v "$(CURDIR)":/workspace --workdir /workspace $(containerProtoImage) \ sh ./scripts/protoc-swagger-gen.sh; fi proto-format: @echo "Formatting Protobuf files" - @$(DOCKER) run --rm -v $(CURDIR):/workspace \ + @$(DOCKER) run --rm -v "$(CURDIR)":/workspace \ --workdir /workspace tendermintdev/docker-build-proto \ find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; proto-lint: - @$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace cellink/clang-format-lint \ + @$(DOCKER) run --rm -v "$(CURDIR)":/workspace --workdir /workspace cellink/clang-format-lint \ --clang-format-executable /clang-format/clang-format9 -r --extensions proto --exclude ./third_party/* . proto-check-breaking: