From 2a60dfb9ef3ed2e693b4156cb392262af5c41b92 Mon Sep 17 00:00:00 2001 From: sam-at-luther Date: Thu, 24 Jul 2025 08:24:22 -0700 Subject: [PATCH 1/5] Prep CI/CD deployment --- Dockerfile | 1 + Makefile | 1 - api/pb/v1/oracle.pb.go | 207 +++++++------------- api/srvpb/v1/oracle.pb.go | 125 ++++--------- api/srvpb/v1/oracle.pb.gw.go | 24 +-- api/srvpb/v1/oracle.proto | 8 +- api/srvpb/v1/oracle.swagger.json | 8 +- common.go.mk | 37 +++- common.mk | 2 + tests/e2e.postman_collection.json | 208 +++++++++++++++++++++ tests/example/claim.martin_collection.yaml | 6 +- tests/init.yaml | 48 ++--- 12 files changed, 402 insertions(+), 273 deletions(-) diff --git a/Dockerfile b/Dockerfile index e14d998..a162284 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,3 +33,4 @@ COPY --from=build /src/app /opt/app # Entrypoint: run the app using tini for proper signal handling ENTRYPOINT ["tini", "--", "/opt/app"] +CMD ["start"] diff --git a/Makefile b/Makefile index aa641c9..f86d4b2 100644 --- a/Makefile +++ b/Makefile @@ -197,7 +197,6 @@ explorer-watch: .PHONY: observability-up observability-down - .PHONY: observability-network observability-up observability-down observability-network: diff --git a/api/pb/v1/oracle.pb.go b/api/pb/v1/oracle.pb.go index e07f92e..e4cb1e4 100644 --- a/api/pb/v1/oracle.pb.go +++ b/api/pb/v1/oracle.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.6 // protoc (unknown) // source: pb/v1/oracle.proto @@ -833,142 +833,75 @@ func (*GetClaimResponse_Claim) isGetClaimResponse_Result() {} var File_pb_v1_oracle_proto protoreflect.FileDescriptor -var file_pb_v1_oracle_proto_rawDesc = string([]byte{ - 0x0a, 0x12, 0x70, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x03, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x69, 0x6d, - 0x61, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x6f, - 0x72, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x6f, 0x62, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x6f, 0x62, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x6f, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x6f, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, - 0x0a, 0x0c, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x75, 0x6c, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x31, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x65, 0x65, 0x74, - 0x31, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x6f, 0x73, - 0x74, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x73, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2a, 0x0a, 0x11, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x6f, 0x77, - 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x50, 0x6f, 0x73, 0x74, 0x54, 0x6f, 0x77, 0x6e, 0x12, 0x34, 0x0a, 0x0b, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, - 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, - 0x79, 0x52, 0x0b, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x86, - 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x66, - 0x5f, 0x61, 0x63, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0e, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x66, 0x41, 0x63, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x12, - 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x41, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x72, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x61, 0x69, - 0x6d, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x91, 0x02, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x69, - 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x62, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x61, - 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x61, 0x63, - 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x61, - 0x74, 0x65, 0x4f, 0x66, 0x41, 0x63, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0c, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x7b, 0x0a, 0x13, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x65, - 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, - 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x08, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x5c, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x43, - 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, - 0x0a, 0x08, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x08, 0x63, 0x6c, 0x61, - 0x69, 0x6d, 0x61, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x61, 0x6e, 0x74, 0x22, 0x7b, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, - 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x63, - 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, - 0x48, 0x00, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x22, 0x2c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x49, - 0x64, 0x22, 0x78, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, - 0x52, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x05, 0x63, - 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, - 0x6d, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2a, 0x7a, 0x0a, 0x0b, 0x4e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4e, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x47, 0x42, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4e, - 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x53, 0x10, 0x02, 0x12, - 0x12, 0x0a, 0x0e, 0x4e, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x46, - 0x52, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x4e, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x49, - 0x54, 0x59, 0x5f, 0x44, 0x45, 0x10, 0x04, 0x2a, 0x5b, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x01, 0x12, 0x13, - 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x43, 0x4c, 0x49, 0x4e, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, - 0x49, 0x44, 0x10, 0x03, 0x2a, 0xfa, 0x02, 0x0a, 0x0a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, - 0x4e, 0x45, 0x57, 0x10, 0x01, 0x12, 0x2a, 0x0a, 0x26, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x4f, 0x45, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x44, 0x45, - 0x54, 0x41, 0x49, 0x4c, 0x53, 0x5f, 0x43, 0x4f, 0x4c, 0x4c, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, - 0x02, 0x12, 0x24, 0x0a, 0x20, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, - 0x5f, 0x4c, 0x4f, 0x45, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x49, 0x44, 0x5f, 0x56, 0x45, 0x52, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x03, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4c, 0x41, 0x49, 0x4d, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x4f, 0x45, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, - 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x45, 0x44, 0x10, 0x04, 0x12, 0x22, 0x0a, 0x1e, 0x43, 0x4c, - 0x41, 0x49, 0x4d, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x4f, 0x45, 0x43, 0x4c, 0x41, - 0x49, 0x4d, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x05, 0x12, 0x25, - 0x0a, 0x21, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x4f, - 0x45, 0x46, 0x49, 0x4e, 0x5f, 0x49, 0x4e, 0x56, 0x4f, 0x49, 0x43, 0x45, 0x5f, 0x49, 0x53, 0x53, - 0x55, 0x45, 0x44, 0x10, 0x06, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x4f, 0x45, 0x46, 0x49, 0x4e, 0x5f, 0x49, 0x4e, 0x56, 0x4f, - 0x49, 0x43, 0x45, 0x5f, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x45, 0x44, 0x10, 0x07, 0x12, 0x27, - 0x0a, 0x23, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x4f, - 0x45, 0x46, 0x49, 0x4e, 0x5f, 0x49, 0x4e, 0x56, 0x4f, 0x49, 0x43, 0x45, 0x5f, 0x41, 0x50, 0x50, - 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x08, 0x12, 0x28, 0x0a, 0x24, 0x43, 0x4c, 0x41, 0x49, 0x4d, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x4f, 0x45, 0x50, 0x41, 0x59, 0x5f, 0x50, 0x41, - 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x45, 0x44, 0x10, - 0x09, 0x42, 0x79, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x42, 0x0b, - 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x75, 0x74, 0x68, 0x65, 0x72, - 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, - 0x02, 0x05, 0x50, 0x62, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x05, 0x50, 0x62, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x11, 0x50, 0x62, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x62, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -}) +const file_pb_v1_oracle_proto_rawDesc = "" + + "\n" + + "\x12pb/v1/oracle.proto\x12\x05pb.v1\x1a\x19common/v1/exception.proto\"\xa5\x03\n" + + "\bClaimant\x12%\n" + + "\x0eaccount_number\x18\x01 \x01(\tR\raccountNumber\x12*\n" + + "\x11account_sort_code\x18\x02 \x01(\tR\x0faccountSortCode\x12\x10\n" + + "\x03dob\x18\x03 \x01(\tR\x03dob\x12\x18\n" + + "\asurname\x18\x04 \x01(\tR\asurname\x12\x1a\n" + + "\bforename\x18\x05 \x01(\tR\bforename\x12!\n" + + "\ffull_address\x18\x06 \x01(\tR\vfullAddress\x12%\n" + + "\x0eaddress_number\x18\a \x01(\tR\raddressNumber\x12'\n" + + "\x0faddress_street1\x18\b \x01(\tR\x0eaddressStreet1\x12)\n" + + "\x10address_postcode\x18\t \x01(\tR\x0faddressPostcode\x12*\n" + + "\x11address_post_town\x18\n" + + " \x01(\tR\x0faddressPostTown\x124\n" + + "\vnationality\x18\v \x01(\x0e2\x12.pb.v1.NationalityR\vnationality\"\x86\x01\n" + + "\x12CreateClaimRequest\x12(\n" + + "\x10date_of_accident\x18\x01 \x01(\tR\x0edateOfAccident\x12#\n" + + "\rdamage_amount\x18\x02 \x01(\x03R\fdamageAmount\x12!\n" + + "\fclaim_reason\x18\x03 \x01(\tR\vclaimReason\"\x91\x02\n" + + "\x05Claim\x12\x19\n" + + "\bclaim_id\x18\x01 \x01(\tR\aclaimId\x12'\n" + + "\x05state\x18\x02 \x01(\x0e2\x11.pb.v1.ClaimStateR\x05state\x12+\n" + + "\bclaimant\x18\x03 \x01(\v2\x0f.pb.v1.ClaimantR\bclaimant\x12(\n" + + "\x10date_of_accident\x18\x04 \x01(\tR\x0edateOfAccident\x12#\n" + + "\rdamage_amount\x18\x05 \x01(\x03R\fdamageAmount\x12!\n" + + "\fclaim_reason\x18\x06 \x01(\tR\vclaimReason\x12%\n" + + "\x06status\x18\a \x01(\x0e2\r.pb.v1.StatusR\x06status\"{\n" + + "\x13CreateClaimResponse\x124\n" + + "\texception\x18\x01 \x01(\v2\x14.common.v1.ExceptionH\x00R\texception\x12$\n" + + "\x05claim\x18\x02 \x01(\v2\f.pb.v1.ClaimH\x00R\x05claimB\b\n" + + "\x06result\"\\\n" + + "\x12AddClaimantRequest\x12\x19\n" + + "\bclaim_id\x18\x01 \x01(\tR\aclaimId\x12+\n" + + "\bclaimant\x18\x02 \x01(\v2\x0f.pb.v1.ClaimantR\bclaimant\"{\n" + + "\x13AddClaimantResponse\x124\n" + + "\texception\x18\x01 \x01(\v2\x14.common.v1.ExceptionH\x00R\texception\x12$\n" + + "\x05claim\x18\x02 \x01(\v2\f.pb.v1.ClaimH\x00R\x05claimB\b\n" + + "\x06result\",\n" + + "\x0fGetClaimRequest\x12\x19\n" + + "\bclaim_id\x18\x01 \x01(\tR\aclaimId\"x\n" + + "\x10GetClaimResponse\x124\n" + + "\texception\x18\x01 \x01(\v2\x14.common.v1.ExceptionH\x00R\texception\x12$\n" + + "\x05claim\x18\x02 \x01(\v2\f.pb.v1.ClaimH\x00R\x05claimB\b\n" + + "\x06result*z\n" + + "\vNationality\x12\x1b\n" + + "\x17NATIONALITY_UNSPECIFIED\x10\x00\x12\x12\n" + + "\x0eNATIONALITY_GB\x10\x01\x12\x12\n" + + "\x0eNATIONALITY_US\x10\x02\x12\x12\n" + + "\x0eNATIONALITY_FR\x10\x03\x12\x12\n" + + "\x0eNATIONALITY_DE\x10\x04*[\n" + + "\x06Status\x12\x16\n" + + "\x12STATUS_UNSPECIFIED\x10\x00\x12\x13\n" + + "\x0fSTATUS_APPROVED\x10\x01\x12\x13\n" + + "\x0fSTATUS_DECLINED\x10\x02\x12\x0f\n" + + "\vSTATUS_PAID\x10\x03*\xfa\x02\n" + + "\n" + + "ClaimState\x12\x1b\n" + + "\x17CLAIM_STATE_UNSPECIFIED\x10\x00\x12\x13\n" + + "\x0fCLAIM_STATE_NEW\x10\x01\x12*\n" + + "&CLAIM_STATE_LOECLAIM_DETAILS_COLLECTED\x10\x02\x12$\n" + + " CLAIM_STATE_LOECLAIM_ID_VERIFIED\x10\x03\x12!\n" + + "\x1dCLAIM_STATE_OOECLAIM_REVIEWED\x10\x04\x12\"\n" + + "\x1eCLAIM_STATE_OOECLAIM_VALIDATED\x10\x05\x12%\n" + + "!CLAIM_STATE_LOEFIN_INVOICE_ISSUED\x10\x06\x12'\n" + + "#CLAIM_STATE_OOEFIN_INVOICE_REVIEWED\x10\a\x12'\n" + + "#CLAIM_STATE_OOEFIN_INVOICE_APPROVED\x10\b\x12(\n" + + "$CLAIM_STATE_OOEPAY_PAYMENT_TRIGGERED\x10\tBy\n" + + "\tcom.pb.v1B\vOracleProtoP\x01Z*github.com/luthersystems/sandbox/api/pb/v1\xa2\x02\x03PXX\xaa\x02\x05Pb.V1\xca\x02\x05Pb\\V1\xe2\x02\x11Pb\\V1\\GPBMetadata\xea\x02\x06Pb::V1b\x06proto3" var ( file_pb_v1_oracle_proto_rawDescOnce sync.Once diff --git a/api/srvpb/v1/oracle.pb.go b/api/srvpb/v1/oracle.pb.go index 4dc1820..465f471 100644 --- a/api/srvpb/v1/oracle.pb.go +++ b/api/srvpb/v1/oracle.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.6 // protoc (unknown) // source: srvpb/v1/oracle.proto @@ -30,92 +30,43 @@ const ( var File_srvpb_v1_oracle_proto protoreflect.FileDescriptor -var file_srvpb_v1_oracle_proto_rawDesc = string([]byte{ - 0x0a, 0x15, 0x73, 0x72, 0x76, 0x70, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x73, 0x72, 0x76, 0x70, 0x62, 0x2e, 0x76, - 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x20, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2f, 0x76, 0x31, 0x2f, - 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x12, 0x70, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, - 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xe1, 0x03, 0x0a, 0x0e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x85, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, - 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x25, 0x2e, 0x68, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x92, 0x41, 0x09, 0x0a, - 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, - 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x12, 0x64, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, - 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, - 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x92, 0x41, 0x09, 0x0a, 0x07, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x22, 0x0a, 0x2f, 0x76, 0x31, 0x2f, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x7a, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x61, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, - 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6c, 0x61, 0x69, - 0x6d, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x92, 0x41, - 0x09, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, - 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x7b, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x61, - 0x6e, 0x74, 0x12, 0x65, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x16, - 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x28, 0x92, 0x41, 0x09, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x7b, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xaa, 0x05, 0x92, 0x41, 0xa0, 0x04, - 0x12, 0x12, 0x0a, 0x0b, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x20, 0x41, 0x50, 0x49, 0x32, - 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x52, 0x53, 0x0a, 0x03, 0x34, - 0x30, 0x30, 0x12, 0x4c, 0x0a, 0x28, 0x42, 0x61, 0x64, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x20, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, - 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x20, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x12, 0x20, - 0x0a, 0x1e, 0x1a, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x52, 0x3f, 0x0a, 0x03, 0x34, 0x30, 0x31, 0x12, 0x38, 0x0a, 0x14, 0x41, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, - 0x20, 0x0a, 0x1e, 0x1a, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x52, 0x3c, 0x0a, 0x03, 0x34, 0x30, 0x33, 0x12, 0x35, 0x0a, 0x11, 0x50, 0x65, 0x72, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x6e, 0x69, 0x65, 0x64, 0x12, 0x20, 0x0a, - 0x1e, 0x1a, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, - 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x3b, 0x0a, 0x03, 0x34, 0x30, 0x34, 0x12, 0x34, 0x0a, 0x10, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, - 0x67, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x1e, 0x1a, 0x1c, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x63, 0x65, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x23, 0x0a, 0x03, - 0x34, 0x30, 0x35, 0x12, 0x1c, 0x0a, 0x12, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x6f, - 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x12, 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, - 0x07, 0x52, 0x4b, 0x0a, 0x03, 0x35, 0x30, 0x30, 0x12, 0x44, 0x0a, 0x20, 0x55, 0x6e, 0x65, 0x78, - 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x1e, - 0x1a, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x63, - 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x40, - 0x0a, 0x03, 0x35, 0x30, 0x33, 0x12, 0x39, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x20, - 0x0a, 0x1e, 0x1a, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x5a, 0x1e, 0x0a, 0x1c, 0x0a, 0x09, 0x58, 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, 0x45, 0x59, 0x12, - 0x0f, 0x08, 0x02, 0x1a, 0x09, 0x58, 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, 0x45, 0x59, 0x20, 0x02, - 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x72, 0x76, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x42, 0x0b, - 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x75, 0x74, 0x68, 0x65, 0x72, - 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x73, 0x72, 0x76, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x08, - 0x53, 0x72, 0x76, 0x70, 0x62, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x53, 0x72, 0x76, 0x70, 0x62, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x53, 0x72, 0x76, 0x70, 0x62, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x53, 0x72, 0x76, - 0x70, 0x62, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) +const file_srvpb_v1_oracle_proto_rawDesc = "" + + "\n" + + "\x15srvpb/v1/oracle.proto\x12\bsrvpb.v1\x1a\x1cgoogle/api/annotations.proto\x1a healthcheck/v1/healthcheck.proto\x1a\x12pb/v1/oracle.proto\x1a.protoc-gen-openapiv2/options/annotations.proto2\x82\x04\n" + + "\x0eSandboxService\x12\x8d\x01\n" + + "\x0eGetHealthCheck\x12%.healthcheck.v1.GetHealthCheckRequest\x1a&.healthcheck.v1.GetHealthCheckResponse\",\x92A\t\n" + + "\aService\x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/sandbox/health_check\x12l\n" + + "\vCreateClaim\x12\x19.pb.v1.CreateClaimRequest\x1a\x1a.pb.v1.CreateClaimResponse\"&\x92A\t\n" + + "\aService\x82\xd3\xe4\x93\x02\x14\"\x12/v1/sandbox/claims\x12\x82\x01\n" + + "\vAddClaimant\x12\x19.pb.v1.AddClaimantRequest\x1a\x1a.pb.v1.AddClaimantResponse\"<\x92A\t\n" + + "\aService\x82\xd3\xe4\x93\x02*:\x01*\"%/v1/sandbox/claim/{claim_id}/claimant\x12m\n" + + "\bGetClaim\x12\x16.pb.v1.GetClaimRequest\x1a\x17.pb.v1.GetClaimResponse\"0\x92A\t\n" + + "\aService\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/sandbox/claim/{claim_id}B\xaa\x05\x92A\xa0\x04\x12\x12\n" + + "\vSandbox API2\x031.0*\x01\x022\x10application/json:\x10application/jsonRS\n" + + "\x03400\x12L\n" + + "(Bad request determined by business logic\x12 \n" + + "\x1e\x1a\x1c.common.v1.ExceptionResponseR?\n" + + "\x03401\x128\n" + + "\x14Authorization failed\x12 \n" + + "\x1e\x1a\x1c.common.v1.ExceptionResponseR<\n" + + "\x03403\x125\n" + + "\x11Permission denied\x12 \n" + + "\x1e\x1a\x1c.common.v1.ExceptionResponseR;\n" + + "\x03404\x124\n" + + "\x10Missing resource\x12 \n" + + "\x1e\x1a\x1c.common.v1.ExceptionResponseR#\n" + + "\x03405\x12\x1c\n" + + "\x12Method not allowed\x12\x06\n" + + "\x04\x9a\x02\x01\aRK\n" + + "\x03500\x12D\n" + + " Unexpected internal server error\x12 \n" + + "\x1e\x1a\x1c.common.v1.ExceptionResponseR@\n" + + "\x03503\x129\n" + + "\x15Service not available\x12 \n" + + "\x1e\x1a\x1c.common.v1.ExceptionResponseZ\x1e\n" + + "\x1c\n" + + "\tX-API-KEY\x12\x0f\b\x02\x1a\tX-API-KEY \x02\n" + + "\fcom.srvpb.v1B\vOracleProtoP\x01Z(github.com/luthersystems/sandbox/api/srv\xa2\x02\x03SXX\xaa\x02\bSrvpb.V1\xca\x02\bSrvpb\\V1\xe2\x02\x14Srvpb\\V1\\GPBMetadata\xea\x02\tSrvpb::V1b\x06proto3" var file_srvpb_v1_oracle_proto_goTypes = []any{ (*v1.GetHealthCheckRequest)(nil), // 0: healthcheck.v1.GetHealthCheckRequest diff --git a/api/srvpb/v1/oracle.pb.gw.go b/api/srvpb/v1/oracle.pb.gw.go index 2deb2f4..ff82c74 100644 --- a/api/srvpb/v1/oracle.pb.gw.go +++ b/api/srvpb/v1/oracle.pb.gw.go @@ -231,7 +231,7 @@ func RegisterSandboxServiceHandlerServer(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/srvpb.v1.SandboxService/GetHealthCheck", runtime.WithHTTPPathPattern("/v1/health_check")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/srvpb.v1.SandboxService/GetHealthCheck", runtime.WithHTTPPathPattern("/v1/sandbox/health_check")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -256,7 +256,7 @@ func RegisterSandboxServiceHandlerServer(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/srvpb.v1.SandboxService/CreateClaim", runtime.WithHTTPPathPattern("/v1/claims")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/srvpb.v1.SandboxService/CreateClaim", runtime.WithHTTPPathPattern("/v1/sandbox/claims")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -281,7 +281,7 @@ func RegisterSandboxServiceHandlerServer(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/srvpb.v1.SandboxService/AddClaimant", runtime.WithHTTPPathPattern("/v1/claim/{claim_id}/claimant")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/srvpb.v1.SandboxService/AddClaimant", runtime.WithHTTPPathPattern("/v1/sandbox/claim/{claim_id}/claimant")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -306,7 +306,7 @@ func RegisterSandboxServiceHandlerServer(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/srvpb.v1.SandboxService/GetClaim", runtime.WithHTTPPathPattern("/v1/claim/{claim_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/srvpb.v1.SandboxService/GetClaim", runtime.WithHTTPPathPattern("/v1/sandbox/claim/{claim_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -370,7 +370,7 @@ func RegisterSandboxServiceHandlerClient(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/srvpb.v1.SandboxService/GetHealthCheck", runtime.WithHTTPPathPattern("/v1/health_check")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/srvpb.v1.SandboxService/GetHealthCheck", runtime.WithHTTPPathPattern("/v1/sandbox/health_check")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -392,7 +392,7 @@ func RegisterSandboxServiceHandlerClient(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/srvpb.v1.SandboxService/CreateClaim", runtime.WithHTTPPathPattern("/v1/claims")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/srvpb.v1.SandboxService/CreateClaim", runtime.WithHTTPPathPattern("/v1/sandbox/claims")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -414,7 +414,7 @@ func RegisterSandboxServiceHandlerClient(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/srvpb.v1.SandboxService/AddClaimant", runtime.WithHTTPPathPattern("/v1/claim/{claim_id}/claimant")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/srvpb.v1.SandboxService/AddClaimant", runtime.WithHTTPPathPattern("/v1/sandbox/claim/{claim_id}/claimant")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -436,7 +436,7 @@ func RegisterSandboxServiceHandlerClient(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/srvpb.v1.SandboxService/GetClaim", runtime.WithHTTPPathPattern("/v1/claim/{claim_id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/srvpb.v1.SandboxService/GetClaim", runtime.WithHTTPPathPattern("/v1/sandbox/claim/{claim_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -456,13 +456,13 @@ func RegisterSandboxServiceHandlerClient(ctx context.Context, mux *runtime.Serve } var ( - pattern_SandboxService_GetHealthCheck_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "health_check"}, "")) + pattern_SandboxService_GetHealthCheck_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "sandbox", "health_check"}, "")) - pattern_SandboxService_CreateClaim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "claims"}, "")) + pattern_SandboxService_CreateClaim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "sandbox", "claims"}, "")) - pattern_SandboxService_AddClaimant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "claim", "claim_id", "claimant"}, "")) + pattern_SandboxService_AddClaimant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "sandbox", "claim", "claim_id", "claimant"}, "")) - pattern_SandboxService_GetClaim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "claim", "claim_id"}, "")) + pattern_SandboxService_GetClaim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "sandbox", "claim", "claim_id"}, "")) ) var ( diff --git a/api/srvpb/v1/oracle.proto b/api/srvpb/v1/oracle.proto index 70a5521..af91e08 100644 --- a/api/srvpb/v1/oracle.proto +++ b/api/srvpb/v1/oracle.proto @@ -100,25 +100,25 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { service SandboxService { // Check the health of the service. This is used by load balancers to check service health. rpc GetHealthCheck(healthcheck.v1.GetHealthCheckRequest) returns (healthcheck.v1.GetHealthCheckResponse) { - option (google.api.http) = {get: "/v1/health_check"}; + option (google.api.http) = {get: "/v1/sandbox/health_check"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Service"}; } // Create claim initiates the creation of the claim. rpc CreateClaim(pb.v1.CreateClaimRequest) returns (pb.v1.CreateClaimResponse) { - option (google.api.http) = {post: "/v1/claims"}; + option (google.api.http) = {post: "/v1/sandbox/claims"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Service"}; } // Add claimant updates claim details. rpc AddClaimant(pb.v1.AddClaimantRequest) returns (pb.v1.AddClaimantResponse) { option (google.api.http) = { - post: "/v1/claim/{claim_id}/claimant" + post: "/v1/sandbox/claim/{claim_id}/claimant" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Service"}; } // Retrieve claim details. rpc GetClaim(pb.v1.GetClaimRequest) returns (pb.v1.GetClaimResponse) { - option (google.api.http) = {get: "/v1/claim/{claim_id}"}; + option (google.api.http) = {get: "/v1/sandbox/claim/{claim_id}"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Service"}; } } diff --git a/api/srvpb/v1/oracle.swagger.json b/api/srvpb/v1/oracle.swagger.json index 60963ce..97d300f 100644 --- a/api/srvpb/v1/oracle.swagger.json +++ b/api/srvpb/v1/oracle.swagger.json @@ -19,7 +19,7 @@ "application/json" ], "paths": { - "/v1/claim/{claimId}": { + "/v1/sandbox/claim/{claimId}": { "get": { "summary": "Retrieve claim details.", "operationId": "SandboxService_GetClaim", @@ -94,7 +94,7 @@ ] } }, - "/v1/claim/{claimId}/claimant": { + "/v1/sandbox/claim/{claimId}/claimant": { "post": { "summary": "Add claimant updates claim details.", "operationId": "SandboxService_AddClaimant", @@ -176,7 +176,7 @@ ] } }, - "/v1/claims": { + "/v1/sandbox/claims": { "post": { "summary": "Create claim initiates the creation of the claim.", "operationId": "SandboxService_CreateClaim", @@ -266,7 +266,7 @@ ] } }, - "/v1/health_check": { + "/v1/sandbox/health_check": { "get": { "summary": "Check the health of the service. This is used by load balancers to check service health.", "operationId": "SandboxService_GetHealthCheck", diff --git a/common.go.mk b/common.go.mk index c362ba4..32621de 100644 --- a/common.go.mk +++ b/common.go.mk @@ -16,9 +16,12 @@ BUILD_IMAGE_PROJECT_DIR=/go/src/${PROJECT_PATH} BUILD_WORKDIR=${BUILD_IMAGE_PROJECT_DIR}/${BUILD_IMAGE_SERVICE_DIR} DOCKER_IMAGE=${PROJECT}/${SERVICE} - DOCKER_IMAGE_DUMMY=$(call IMAGE_DUMMY,${DOCKER_IMAGE}/${VERSION}) +FQ_STATIC_IMAGE=$(call FQ_DOCKER_IMAGE,${DOCKER_IMAGE},${SERVICE}) +FQ_STATIC_IMAGE_DUMMY=$(call PUSH_DUMMY,${FQ_DOCKER_IMAGE}/${BUILD_VERSION}${TAG_SUFFIX}) +FQ_MANIFEST_DUMMY=$(call MANIFEST_DUMMY,${FQ_STATIC_IMAGE}/${BUILD_VERSION}${TAG_SUFFIX}) + GO_SOURCE_FILES=$(shell find ${PROJECT_REL_DIR} -name '*.go' | grep -v '/vendor/') GO_PKG_DUMMY=${PROJECT_REL_DIR}/$(call DUMMY_TARGET,pkg,${GO_PKG_VOLUME}) @@ -69,3 +72,35 @@ ${GO_PKG_DUMMY}: .PHONY: host-go-env host-go-env: @echo export "${HOST_GO_ENV}" + +.PHONY: push +push: ${FQ_STATIC_IMAGE_DUMMY} + @ + +# DOCKER_IMAGE exists with a tag VERSION and BUILD_VERSION but FQ_STATIC_IMAGE +# only has a BUILD_VERSION tag. Ideally perhaps DOCKER_IMAGE would only have a +# BUILD_VERSION tag but the git hash in the BUILD_VERSION will blow makefile +# dependency caching for DUMMY targets and cause additional unnecessary builds +# during development. +${FQ_STATIC_IMAGE_DUMMY}: ${DOCKER_IMAGE_DUMMY} + ${DOCKER} tag ${DOCKER_IMAGE}:${VERSION} ${DOCKER_IMAGE}:${BUILD_VERSION}${TAG_SUFFIX} + ${DOCKER} tag ${DOCKER_IMAGE}:${VERSION} ${FQ_STATIC_IMAGE}:${BUILD_VERSION}${TAG_SUFFIX} + ${DOCKER} push ${FQ_STATIC_IMAGE}:${BUILD_VERSION}${TAG_SUFFIX} + ${MKDIR_P} $(dir $@) + ${TOUCH} $@ + +.PHONY: push-manifests +push-manifests: ${FQ_MANIFEST_DUMMY} + @ + +${FQ_MANIFEST_DUMMY}: + ${DOCKER} buildx imagetools create \ + --tag ${FQ_STATIC_IMAGE}:latest \ + ${FQ_STATIC_IMAGE}:${BUILD_VERSION}-arm64 \ + ${FQ_STATIC_IMAGE}:${BUILD_VERSION}-amd64 + ${DOCKER} buildx imagetools create \ + --tag ${FQ_STATIC_IMAGE}:${BUILD_VERSION} \ + ${FQ_STATIC_IMAGE}:${BUILD_VERSION}-arm64 \ + ${FQ_STATIC_IMAGE}:${BUILD_VERSION}-amd64 + ${MKDIR_P} $(dir $@) + ${TOUCH} $@ diff --git a/common.mk b/common.mk index 7b80c59..dacff50 100644 --- a/common.mk +++ b/common.mk @@ -18,6 +18,8 @@ include ${PROJECT_REL_DIR}/common.config.mk PROJECT_PATH=$(shell awk '$$1 == "module" {print $$2};' ${PROJECT_REL_DIR}/go.mod) +FQ_DOCKER_IMAGE ?= luthersystems/$(2) + BUILD_ID=$(shell git rev-parse --short HEAD) BUILD_VERSION=${VERSION}$(if $(findstring SNAPSHOT,${VERSION}),-${BUILD_ID},) diff --git a/tests/e2e.postman_collection.json b/tests/e2e.postman_collection.json index e69de29..7e336c9 100644 --- a/tests/e2e.postman_collection.json +++ b/tests/e2e.postman_collection.json @@ -0,0 +1,208 @@ +{ + "info": { + "_postman_id": "e584a881-0b1f-4fcb-bf97-c59d135f75fe", + "name": "MartinTestSuite-AUTOGENERATED", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "event": [ + { + "id": "cdeb59fb-2a85-4530-9940-486a671246bf", + "listen": "test", + "script": { + "exec": [ + "// AUTO-GENERATED. DO NOT MODIFY!", + "(function() {", + " \"use strict\";", + " ", + " var id = pm.response.headers ? pm.response.headers.get(\"X-Request-ID\") : undefined;", + " console.log(\"X-Request-ID: \" + id);", + " ", + "})();", + "" + ], + "id": "d2da4a38-6368-4cd1-9ef5-be5210f3c15d", + "type": "text/javascript" + } + } + ], + "item": [ + { + "event": [ + { + "id": "7bc46e02-4452-49af-adcc-1a1858c9a127", + "listen": "test", + "script": { + "exec": [ + "// AUTO-GENERATED. DO NOT MODIFY!", + "(function() {", + " \"use strict\";", + " pm.test(\"ok\", () =\u003e {", + " let data = pm.response.json();", + " console.log(data);", + " pm.response.to.have.status(200);", + " pm.expect(data).to.not.have.property(\"exception\");", + " pm.expect(data).to.have.property(\"claim\");", + " pm.expect(data.claim).to.have.property(\"claim_id\");", + " pm.environment.set(\"CLAIM_ID\", data.claim.claim_id);", + " });", + " ", + "})();", + "" + ], + "id": "ea83810e-0ee6-4c40-ac8c-98521f802651", + "type": "text/javascript" + } + } + ], + "id": "a300b2dd-1c8d-485b-9fce-731d8b4a1df1", + "name": "Create claim", + "request": { + "body": { + "formdata": null, + "mode": "raw", + "raw": "{\n \"date_of_accident\": \"2024-01-15\",\n \"damage_amount\": 500000,\n \"claim_reason\": \"Car accident due to adverse weather conditions.\"\n}\n" + }, + "header": [ + { + "id": "a30cca74-4e37-4ac6-823a-8cb7c0121bac", + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{SERVER}}" + ], + "path": [ + "v1", + "sandbox", + "claims" + ], + "protocol": "{{SCHEME}}", + "raw": "{{SCHEME}}://{{SERVER}}/v1/sandbox/claims" + } + } + }, + { + "event": [ + { + "id": "59974ad9-9c5d-4963-9f60-bdc457f72677", + "listen": "test", + "script": { + "exec": [ + "// AUTO-GENERATED. DO NOT MODIFY!", + "(function() {", + " \"use strict\";", + " pm.test(\"ok\", () =\u003e {", + " let data = pm.response.json();", + " console.log(data);", + " pm.response.to.have.status(200);", + " pm.expect(data).to.not.have.property(\"exception\");", + " pm.expect(data).to.have.property(\"claim\");", + " pm.expect(data.claim).to.have.property(\"state\");", + " });", + " ", + "})();", + "" + ], + "id": "490e425f-298f-4505-8d99-c600a1457b1f", + "type": "text/javascript" + } + } + ], + "id": "2558f7e1-6f37-4116-81bc-728b8c8c69c4", + "name": "Get claim", + "request": { + "header": [ + { + "id": "c1ee0db8-25fe-44f0-a823-fcc4d5cd135e", + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "method": "GET", + "url": { + "host": [ + "{{SERVER}}" + ], + "path": [ + "v1", + "sandbox", + "claim", + "{{CLAIM_ID}}" + ], + "protocol": "{{SCHEME}}", + "raw": "{{SCHEME}}://{{SERVER}}/v1/sandbox/claim/{{CLAIM_ID}}" + } + } + }, + { + "event": [ + { + "id": "b3f39b2d-8c28-4c9e-87e0-832cb412a98e", + "listen": "test", + "script": { + "exec": [ + "// AUTO-GENERATED. DO NOT MODIFY!", + "(function() {", + " \"use strict\";", + " pm.test(\"ok\", () =\u003e {", + " let data = pm.response.json();", + " console.log(data);", + " pm.response.to.have.status(200);", + " pm.expect(data).to.not.have.property(\"exception\");", + " pm.expect(data).to.have.property(\"claim\");", + " pm.expect(data.claim).to.have.property(\"state\");", + " });", + " ", + "})();", + "" + ], + "id": "b6ee3e19-f1bb-462a-861f-f9912d2db4ed", + "type": "text/javascript" + } + } + ], + "id": "5898b17c-8fb6-49a6-8dad-69fd8a337ce2", + "name": "Add claimant", + "request": { + "body": { + "formdata": null, + "mode": "raw", + "raw": "{\n \"claim_id\": \"{{CLAIM_ID}}\",\n \"claimant\": {\n \"account_number\": \"\",\n \"account_sort_code\": \"\",\n \"dob\": \"1945-11-01\",\n \"surname\": \"Smith\",\n \"forename\": \"Raymond\",\n \"full_address\": \"3 High Street\",\n \"address_number\": \"3\",\n \"address_street1\": \"High Street\",\n \"address_postcode\": \"BA13 3BN\",\n \"address_post_town\": \"Westbury\",\n \"nationality\": \"NATIONALITY_GB\"\n }\n}\n" + }, + "header": [ + { + "id": "a3c60882-24dd-4ec5-91d5-0e3f4eac6d67", + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "method": "POST", + "url": { + "host": [ + "{{SERVER}}" + ], + "path": [ + "v1", + "sandbox", + "claim", + "{{CLAIM_ID}}", + "claimant" + ], + "protocol": "{{SCHEME}}", + "raw": "{{SCHEME}}://{{SERVER}}/v1/sandbox/claim/{{CLAIM_ID}}/claimant" + } + } + } + ], + "name": "Sandbox Example: Claim Management" + } + ] +} \ No newline at end of file diff --git a/tests/example/claim.martin_collection.yaml b/tests/example/claim.martin_collection.yaml index 221ef16..2182fcf 100644 --- a/tests/example/claim.martin_collection.yaml +++ b/tests/example/claim.martin_collection.yaml @@ -5,7 +5,7 @@ headers: tests: - name: "Create claim" method: POST - path: "v1/claims" + path: "v1/sandbox/claims" body: | { "date_of_accident": "2024-01-15", @@ -24,7 +24,7 @@ tests: }); - name: "Get claim" method: GET - path: "v1/claim/{{CLAIM_ID}}" + path: "v1/sandbox/claim/{{CLAIM_ID}}" test_script: | pm.test("ok", () => { let data = pm.response.json(); @@ -36,7 +36,7 @@ tests: }); - name: "Add claimant" method: POST - path: "v1/claim/{{CLAIM_ID}}/claimant" + path: "v1/sandbox/claim/{{CLAIM_ID}}/claimant" body: | { "claim_id": "{{CLAIM_ID}}", diff --git a/tests/init.yaml b/tests/init.yaml index 525c5e1..ae82149 100644 --- a/tests/init.yaml +++ b/tests/init.yaml @@ -1,28 +1,28 @@ # collection to execute before each test run name: "initialization" headers: - - key: Content-Type - value: application/json + - key: Content-Type + value: application/json tests: - - name: "INIT: Health check" - method: GET - path: "v1/health_check" - test_script: | - pm.test("ok", () => { - console.log(pm.response.text()); - let data = pm.response.json(); - console.log(data); - pm.response.to.have.status(200); - pm.expect(data).to.not.have.property("exception"); - }); - - name: "INIT: swagger.json" - method: GET - path: "swagger.json" - test_script: | - pm.test("ok", () => { - console.log(pm.response.text()); - let data = pm.response.json(); - console.log(data); - pm.response.to.have.status(200); - pm.expect(data).to.not.have.property("exception"); - }); + - name: "INIT: Health check" + method: GET + path: "v1/sandbox/health_check" + test_script: | + pm.test("ok", () => { + console.log(pm.response.text()); + let data = pm.response.json(); + console.log(data); + pm.response.to.have.status(200); + pm.expect(data).to.not.have.property("exception"); + }); + - name: "INIT: swagger.json" + method: GET + path: "swagger.json" + test_script: | + pm.test("ok", () => { + console.log(pm.response.text()); + let data = pm.response.json(); + console.log(data); + pm.response.to.have.status(200); + pm.expect(data).to.not.have.property("exception"); + }); From b8b070e5bee151511da0d00d90e6240ca7c20ea3 Mon Sep 17 00:00:00 2001 From: sam-at-luther Date: Thu, 24 Jul 2025 15:35:30 -0700 Subject: [PATCH 2/5] Fix version --- portal/version.go | 6 +----- portal/version/version.go | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/portal/version.go b/portal/version.go index 36dde4a..a819c39 100644 --- a/portal/version.go +++ b/portal/version.go @@ -12,10 +12,6 @@ type versionCmd struct { } func (r *versionCmd) Run() error { - ver := version.Version - if ver == "" { - ver = "SNAPSHOT" - } - fmt.Println(ver) + fmt.Println(version.Version) return nil } diff --git a/portal/version/version.go b/portal/version/version.go index ed61233..4452aa3 100644 --- a/portal/version/version.go +++ b/portal/version/version.go @@ -2,5 +2,4 @@ package version -// Version is the project version. It is overridden as part of the build. -var Version string +var Version = "v0.0.1" // overridden at build time with -ldflags From 7f3f81cc8eb0193ec7747194c8ea6b9617ab7ae6 Mon Sep 17 00:00:00 2001 From: sam-at-luther Date: Thu, 24 Jul 2025 15:52:32 -0700 Subject: [PATCH 3/5] Regen artifacts --- Makefile | 100 ++-- common.mk | 3 + fabric/scripts/luther_utils.sh | 879 ++++++++++++++++----------------- 3 files changed, 504 insertions(+), 478 deletions(-) diff --git a/Makefile b/Makefile index f86d4b2..45af783 100644 --- a/Makefile +++ b/Makefile @@ -36,48 +36,58 @@ plugin-darwin: ${SUBSTRATE_PLUGIN_DARWIN} all: tests-api .PHONY: tests-api -tests-api: - cd tests && $(MAKE) +tests-api: make-C/tests/default + @ .PHONY: tests-api-clean -tests-api-clean: - cd tests && $(MAKE) clean +tests-api-clean: make-C/tests/clean + @ all: api .PHONY: api -api: - cd api && $(MAKE) +api: make-C/api/default + @ all: phylum .PHONY: phylum -phylum: - cd phylum && $(MAKE) +phylum: make-C/phylum/default + @ test: phylumtest .PHONY: phylumtest -phylumtest: - cd phylum && $(MAKE) test +phylumtest: make-C/phylum/test + @ clean: phylumclean .PHONY: phylumclean -phylumclean: - cd phylum && $(MAKE) clean +phylumclean: make-C/phylum/clean + @ all: portal .PHONY: portal -portal: plugin - cd ${SERVICE_DIR} && $(MAKE) +portal: plugin make-C/portal/default + @ + clean: portalclean .PHONY: portalclean -portalclean: - cd ${SERVICE_DIR} && $(MAKE) clean +portalclean: make-C/portal/clean + @ + +docker-push: portal-push +.PHONY: portal-push +portal-push: make-C/portal/push + @ + +docker-push-manifests: portal-push-manifests +.PHONY: portal-push-manifests +portal-push-manifests: make-C/portal/push-manifests + @ .PHONY: fabric all: fabric -fabric: - cd fabric && $(MAKE) +fabric: make-C/fabric/default + @ .PHONY: fabricclean clean: fabricclean -fabricclean: - cd fabric && $(MAKE) clean - +fabricclean: make-C/fabric/clean + @ .PHONY: storage-up storage-up: cd fabric && $(MAKE) up install init @@ -146,12 +156,12 @@ integrationcitest: $(MAKE) down .PHONY: integration -integration: - cd tests && $(MAKE) test-docker +integration: make-C/tests/test-docker + @ .PHONY: repl -repl: - cd phylum && $(MAKE) repl +repl: make-C/phylum/repl + @ # this target is called by git-hooks/pre-push. It's separated into its own target # to allow us to update the git-hooks without having to reinstall the hook @@ -163,6 +173,7 @@ pre-push: .PHONY: download: plugin + @ ${STATIC_PLUGINS_DUMMY}: ${MKDIR_P} $(dir $@) @@ -174,26 +185,27 @@ ${SUBSTRATE_PLUGIN}: ${STATIC_PLUGINS_DUMMY} .PHONY: explorer explorer: explorer-up-clean + @ .PHONY: explorer-up -explorer-up: - cd ${PROJECT_REL_DIR}/explorer && make up +explorer-up: make-C/explorer/up + @ .PHONY: explorer-up-clean -explorer-up-clean: - cd ${PROJECT_REL_DIR}/explorer && make up-clean +explorer-up-clean: make-C/explorer/up-clean + @ .PHONY: explorer-down -explorer-down: - cd ${PROJECT_REL_DIR}/explorer && make down +explorer-down: make-C/explorer/down + @ .PHONY: explorer-clean -explorer-clean: - cd ${PROJECT_REL_DIR}/explorer && make down-clean +explorer-clean: make-C/explorer/down-clean + @ .PHONY: explorer-watch -explorer-watch: - cd ${PROJECT_REL_DIR}/explorer && make watch +explorer-watch: make-C/explorer/watch + @ .PHONY: observability-up observability-down @@ -213,6 +225,22 @@ init-docs: git submodule update --init --recursive --remote docs .PHONY: setup - setup: init-docs download @echo "Running project setup..." + +.PHONY: publish-docker +publish-docker: docker-push + @ + +.PHONY: publish-docker-manifests +publish-docker-manifests: docker-push-manifests + @ + +.PHONY: publish +publish: publish-docker + @ + +.PHONY: +docker-push: all + @ + diff --git a/common.mk b/common.mk index dacff50..600a743 100644 --- a/common.mk +++ b/common.mk @@ -119,3 +119,6 @@ echo\:%: docker-pull/%: id=$(shell docker image inspect -f "{{.Id}}" $* 2>/dev/null) docker-pull/%: @[ -n "${id}" ] || { echo "retrieving $*" && docker pull $*; } + +make-C/%: + @cd $(dir $*) && $(MAKE) $(notdir $*) diff --git a/fabric/scripts/luther_utils.sh b/fabric/scripts/luther_utils.sh index cccef73..11fd5be 100755 --- a/fabric/scripts/luther_utils.sh +++ b/fabric/scripts/luther_utils.sh @@ -12,174 +12,172 @@ ORDERER_CA="/crypto-config/ordererOrganizations/${DOMAIN_NAME}/orderers/orderer0 # verify the result of the end-to-end test verifyResult() { - if [ $1 -ne 0 ] ; then - echo "!!!!!!!!!!!!!!! "$2" !!!!!!!!!!!!!!!!" >&2 - echo "========= ERROR !!! FAILED to execute End-2-End Scenario ===========" >&2 - echo >&2 - exit 1 - fi + if [ $1 -ne 0 ]; then + echo "!!!!!!!!!!!!!!! "$2" !!!!!!!!!!!!!!!!" >&2 + echo "========= ERROR !!! FAILED to execute End-2-End Scenario ===========" >&2 + echo >&2 + exit 1 + fi } firstPeer() { - echo "${PEER_INDICES[0]}" + echo "${PEER_INDICES[0]}" } firstOrg() { - echo "${ORG_INDICES[0]}" + echo "${ORG_INDICES[0]}" } peerAddress() { - PEER=$1 - ORG=$2 - echo "peer${PEER}.org${ORG}.${DOMAIN_NAME}:7051" + PEER=$1 + ORG=$2 + echo "peer${PEER}.org${ORG}.${DOMAIN_NAME}:7051" } peerRootCert() { - PEER=$1 - ORG=$2 - echo "/crypto-config/peerOrganizations/org${ORG}.${DOMAIN_NAME}/peers/peer${PEER}.org${ORG}.${DOMAIN_NAME}/tls/ca.crt" + PEER=$1 + ORG=$2 + echo "/crypto-config/peerOrganizations/org${ORG}.${DOMAIN_NAME}/peers/peer${PEER}.org${ORG}.${DOMAIN_NAME}/tls/ca.crt" } peerArgs() { - PEER=$1 - ORG=$2 - echo "--peerAddresses $(peerAddress "$PEER" "$ORG") --tlsRootCertFiles $(peerRootCert "$PEER" "$ORG")" + PEER=$1 + ORG=$2 + echo "--peerAddresses $(peerAddress "$PEER" "$ORG") --tlsRootCertFiles $(peerRootCert "$PEER" "$ORG")" } peerArgsEachOrg() { - { set +x; } 2>/dev/null - local peer_args="" - local first_peer="$(firstPeer)" - for orgIdx in "${ORG_INDICES[@]}"; do - peer_args="${peer_args} $(peerArgs "$first_peer" "$orgIdx")" - done - echo "$peer_args" + { set +x; } 2>/dev/null + local peer_args="" + local first_peer="$(firstPeer)" + for orgIdx in "${ORG_INDICES[@]}"; do + peer_args="${peer_args} $(peerArgs "$first_peer" "$orgIdx")" + done + echo "$peer_args" } setGlobals() { - PEER=$1 - ORG=$2 - - export CORE_PEER_LOCALMSPID="Org${ORG}MSP" - export CORE_PEER_MSPCONFIGPATH="/crypto-config/peerOrganizations/org${ORG}.${DOMAIN_NAME}/users/Admin@org${ORG}.${DOMAIN_NAME}/msp" - export CORE_PEER_TLS_CERT_FILE="/crypto-config/peerOrganizations/org${ORG}.${DOMAIN_NAME}/peers/peer${PEER}.org${ORG}.${DOMAIN_NAME}/tls/server.crt" - export CORE_PEER_TLS_KEY_FILE="/crypto-config/peerOrganizations/org${ORG}.${DOMAIN_NAME}/peers/peer${PEER}.org${ORG}.${DOMAIN_NAME}/tls/server.key" - export CORE_PEER_ADDRESS="$(peerAddress "$PEER" "$ORG")" - export CORE_PEER_TLS_ROOTCERT_FILE="$(peerRootCert "$PEER" "$ORG")" - export CORE_PEER_TLS_CLIENTCERT_FILE="${CORE_PEER_TLS_CERT_FILE}" - export CORE_PEER_TLS_CLIENTKEY_FILE="${CORE_PEER_TLS_KEY_FILE}" - export CORE_PEER_TLS_CLIENTAUTHREQUIRED=true - - env |grep CORE >&2 + PEER=$1 + ORG=$2 + + export CORE_PEER_LOCALMSPID="Org${ORG}MSP" + export CORE_PEER_MSPCONFIGPATH="/crypto-config/peerOrganizations/org${ORG}.${DOMAIN_NAME}/users/Admin@org${ORG}.${DOMAIN_NAME}/msp" + export CORE_PEER_TLS_CERT_FILE="/crypto-config/peerOrganizations/org${ORG}.${DOMAIN_NAME}/peers/peer${PEER}.org${ORG}.${DOMAIN_NAME}/tls/server.crt" + export CORE_PEER_TLS_KEY_FILE="/crypto-config/peerOrganizations/org${ORG}.${DOMAIN_NAME}/peers/peer${PEER}.org${ORG}.${DOMAIN_NAME}/tls/server.key" + export CORE_PEER_ADDRESS="$(peerAddress "$PEER" "$ORG")" + export CORE_PEER_TLS_ROOTCERT_FILE="$(peerRootCert "$PEER" "$ORG")" + export CORE_PEER_TLS_CLIENTCERT_FILE="${CORE_PEER_TLS_CERT_FILE}" + export CORE_PEER_TLS_CLIENTKEY_FILE="${CORE_PEER_TLS_KEY_FILE}" + export CORE_PEER_TLS_CLIENTAUTHREQUIRED=true + + env | grep CORE >&2 } updateAnchorPeers() { - PEER=$1 - ORG=$2 - setGlobals $PEER $ORG - - if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then - set -x - peer channel update -o orderer0."$DOMAIN_NAME":7050 -c $CHANNEL_NAME -f /channel-artifacts/${CORE_PEER_LOCALMSPID}anchors.tx >&log.txt - res=$? - set +x - else - set -x - peer channel update -o orderer0."$DOMAIN_NAME":7050 -c $CHANNEL_NAME -f /channel-artifacts/${CORE_PEER_LOCALMSPID}anchors.tx --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --clientauth --certfile $CORE_PEER_TLS_CERT_FILE --keyfile $CORE_PEER_TLS_KEY_FILE >&log.txt - res=$? - set +x - fi - cat log.txt - verifyResult $res "Anchor peer update failed" - echo "===================== Anchor peers for org \"$CORE_PEER_LOCALMSPID\" on \"$CHANNEL_NAME\" is updated successfully ===================== " - sleep $DELAY - echo + PEER=$1 + ORG=$2 + setGlobals $PEER $ORG + + if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then + set -x + peer channel update -o orderer0."$DOMAIN_NAME":7050 -c $CHANNEL_NAME -f /channel-artifacts/${CORE_PEER_LOCALMSPID}anchors.tx >&log.txt + res=$? + set +x + else + set -x + peer channel update -o orderer0."$DOMAIN_NAME":7050 -c $CHANNEL_NAME -f /channel-artifacts/${CORE_PEER_LOCALMSPID}anchors.tx --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --clientauth --certfile $CORE_PEER_TLS_CERT_FILE --keyfile $CORE_PEER_TLS_KEY_FILE >&log.txt + res=$? + set +x + fi + cat log.txt + verifyResult $res "Anchor peer update failed" + echo "===================== Anchor peers for org \"$CORE_PEER_LOCALMSPID\" on \"$CHANNEL_NAME\" is updated successfully ===================== " + sleep $DELAY + echo } createChannel() { - CHANNEL_NAME=$1 - DELAY=3 - setGlobals 0 1 - - sleep $DELAY - if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then - set -x - peer channel create -o orderer0."$DOMAIN_NAME":7050 -c $CHANNEL_NAME -f /channel-artifacts/channel.tx >&log.txt - res=$? - set +x - else - set -x - peer channel create -o orderer0."$DOMAIN_NAME":7050 -c $CHANNEL_NAME -f /channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --clientauth --certfile $CORE_PEER_TLS_CERT_FILE --keyfile $CORE_PEER_TLS_KEY_FILE >&log.txt - res=$? - set +x - fi - cat log.txt - verifyResult $res "Channel creation failed" - echo "===================== Channel \"$CHANNEL_NAME\" is created successfully ===================== " - echo + CHANNEL_NAME=$1 + DELAY=3 + setGlobals 0 1 + + sleep $DELAY + if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then + set -x + peer channel create -o orderer0."$DOMAIN_NAME":7050 -c $CHANNEL_NAME -f /channel-artifacts/channel.tx >&log.txt + res=$? + set +x + else + set -x + peer channel create -o orderer0."$DOMAIN_NAME":7050 -c $CHANNEL_NAME -f /channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --clientauth --certfile $CORE_PEER_TLS_CERT_FILE --keyfile $CORE_PEER_TLS_KEY_FILE >&log.txt + res=$? + set +x + fi + cat log.txt + verifyResult $res "Channel creation failed" + echo "===================== Channel \"$CHANNEL_NAME\" is created successfully ===================== " + echo } joinChannel() { - CHANNEL_NAME=$1 - DELAY=3 - - for i in "${ORG_INDICES[@]}" - do - for j in "${PEER_INDICES[@]}" - do - joinChannelWithRetry "$j" "$i" $CHANNEL_NAME $DELAY 1 5 - echo "===================== peer${j}.org${i} joined on the channel \"$CHANNEL_NAME\" ===================== " - sleep $DELAY - echo - done - done + CHANNEL_NAME=$1 + DELAY=3 + + for i in "${ORG_INDICES[@]}"; do + for j in "${PEER_INDICES[@]}"; do + joinChannelWithRetry "$j" "$i" $CHANNEL_NAME $DELAY 1 5 + echo "===================== peer${j}.org${i} joined on the channel \"$CHANNEL_NAME\" ===================== " + sleep $DELAY + echo + done + done } ## Sometimes Join takes time hence RETRY so this recursive function takes an ## iteration counter and a maximum number of iterations as its 5th and 6th ## arguments. joinChannelWithRetry() { - PEER=$1 - ORG=$2 - CHANNEL_NAME=$3 - DELAY=$4 - COUNTER=$5 - MAX_RETRY=$6 - setGlobals $PEER $ORG - - set -x - peer channel join -b $CHANNEL_NAME.block >&log.txt - res=$? - set +x - - cat log.txt - if [ $res -ne 0 -a $COUNTER -lt $MAX_RETRY ]; then - COUNTER=` expr $COUNTER + 1` - echo "peer${PEER}.org${ORG} failed to join the channel, Retry after $DELAY seconds" - sleep $DELAY - joinChannelWithRetry $PEER $ORG $CHANNEL_NAME $DELAY $COUNTER $MAX_RETRY - else - verifyResult $res "After $MAX_RETRY attempts, peer${PEER}.org${ORG} has failed to Join the Channel" - fi + PEER=$1 + ORG=$2 + CHANNEL_NAME=$3 + DELAY=$4 + COUNTER=$5 + MAX_RETRY=$6 + setGlobals $PEER $ORG + + set -x + peer channel join -b $CHANNEL_NAME.block >&log.txt + res=$? + set +x + + cat log.txt + if [ $res -ne 0 -a $COUNTER -lt $MAX_RETRY ]; then + COUNTER=$(expr $COUNTER + 1) + echo "peer${PEER}.org${ORG} failed to join the channel, Retry after $DELAY seconds" + sleep $DELAY + joinChannelWithRetry $PEER $ORG $CHANNEL_NAME $DELAY $COUNTER $MAX_RETRY + else + verifyResult $res "After $MAX_RETRY attempts, peer${PEER}.org${ORG} has failed to Join the Channel" + fi } generateChaincode() { - echo "generateChaincode: ""$*" + echo "generateChaincode: ""$*" - CC_SRC_PATH=$1 - CC_NAME=$2 - CC_VERSION=$3 - IS_EXTERNAL=$4 + CC_SRC_PATH=$1 + CC_NAME=$2 + CC_VERSION=$3 + IS_EXTERNAL=$4 - TIMESTAMP="2016-01-01T00:00:00Z" - CC_LABEL=${CC_NAME}-${CC_VERSION} - CC_TYPE="golang" + TIMESTAMP="2016-01-01T00:00:00Z" + CC_LABEL=${CC_NAME}-${CC_VERSION} + CC_TYPE="golang" - CC_SRC_DIR=$(dirname ${CC_SRC_PATH}) - CC_PATH=${CC_SRC_DIR}/${CC_LABEL}.tar.gz + CC_SRC_DIR=$(dirname ${CC_SRC_PATH}) + CC_PATH=${CC_SRC_DIR}/${CC_LABEL}.tar.gz - if [ "$IS_EXTERNAL" == "True" ]; then - cat >/tmp/connection.json </tmp/connection.json </tmp/metadata.json + echo '{"path":"main","type":"'"${CC_TYPE}"'","label":"'"${CC_LABEL}"'"}' >/tmp/metadata.json - tar -zcf ${CC_PATH} -C /tmp --mtime=$TIMESTAMP metadata.json code.tar.gz - md5sum ${CC_PATH} - peer lifecycle chaincode calculatepackageid ${CC_PATH} | tee ${CC_SRC_DIR}/${CC_LABEL}.id + tar -zcf ${CC_PATH} -C /tmp --mtime=$TIMESTAMP metadata.json code.tar.gz + md5sum ${CC_PATH} + peer lifecycle chaincode calculatepackageid ${CC_PATH} | tee ${CC_SRC_DIR}/${CC_LABEL}.id } installChaincode() { - echo "installChaincode: ""$*" - - PEER=$1 - ORG=$2 - CC_SRC_PATH=$3 - CC_NAME=$4 - CC_VERSION=$5 - - queryChaincodePackage "$PEER" "$ORG" "$CC_NAME" "$CC_VERSION" - if [ $? -eq 0 ]; then - echo "===================== Chaincode ${CC_NAME}:${CC_VERSION} already installed on peer${PEER}.org${ORG} ===================== " - echo - return - fi - - - echo "Installing chaincode ${CC_NAME}:${CC_VERSION} on peer${PEER}.org${ORG}..." - echo - setGlobals $PEER $ORG - set -x - CC_SRC_DIR=$(dirname ${CC_SRC_PATH}) - CC_PATH=${CC_SRC_DIR}/${CC_NAME}-${CC_VERSION}.tar.gz - - peer lifecycle chaincode install ${CC_PATH} >&log.txt - res=$? - - set +x - cat log.txt - verifyResult $res "Chaincode installation on peer${PEER}.org${ORG} has Failed" - peer lifecycle chaincode queryinstalled -O json - echo "===================== Chaincode is installed on peer${PEER}.org${ORG} ===================== " - echo + echo "installChaincode: ""$*" + + PEER=$1 + ORG=$2 + CC_SRC_PATH=$3 + CC_NAME=$4 + CC_VERSION=$5 + + queryChaincodePackage "$PEER" "$ORG" "$CC_NAME" "$CC_VERSION" + if [ $? -eq 0 ]; then + echo "===================== Chaincode ${CC_NAME}:${CC_VERSION} already installed on peer${PEER}.org${ORG} ===================== " + echo + return + fi + + echo "Installing chaincode ${CC_NAME}:${CC_VERSION} on peer${PEER}.org${ORG}..." + echo + setGlobals $PEER $ORG + set -x + CC_SRC_DIR=$(dirname ${CC_SRC_PATH}) + CC_PATH=${CC_SRC_DIR}/${CC_NAME}-${CC_VERSION}.tar.gz + + peer lifecycle chaincode install ${CC_PATH} >&log.txt + res=$? + + set +x + cat log.txt + verifyResult $res "Chaincode installation on peer${PEER}.org${ORG} has Failed" + peer lifecycle chaincode queryinstalled -O json + echo "===================== Chaincode is installed on peer${PEER}.org${ORG} ===================== " + echo } queryChaincodePackage() { - PEER=$1 - ORG=$2 - CC_NAME=$3 - CC_VERSION=$4 - - CC_LABEL=${CC_NAME}-${CC_VERSION} - - echo "Querying installed chaincodes on peer${PEER}.org${ORG}..." >&2 - echo >&2 - setGlobals $PEER $ORG &>/dev/null - set -x - peer lifecycle chaincode queryinstalled -O json >chaincodes.json - res=$? - set +x - if [ $res -ne 0 ]; then - return 1 - fi - query=$(cat <&2 + echo >&2 + setGlobals $PEER $ORG &>/dev/null + set -x + peer lifecycle chaincode queryinstalled -O json >chaincodes.json + res=$? + set +x + if [ $res -ne 0 ]; then + return 1 + fi + query=$( + cat <&2 - res=$? - set +x - if [ $res -eq 0 ]; then - return 1 - fi - set -x - jq -er "$query" chaincodes.json - res=$? - set +x - return $res + ) + set -x + jq -er '. == {}' chaincodes.json >&2 + res=$? + set +x + if [ $res -eq 0 ]; then + return 1 + fi + set -x + jq -er "$query" chaincodes.json + res=$? + set +x + return $res } approveChaincode() { - PEER=$1 - ORG=$2 - CHANNEL_NAME=$3 - CC_NAME=$4 - CC_VERSION=$5 - SEQ_NO=$6 - shift 6 - - package_id="$(queryChaincodePackage "$PEER" "$ORG" "$CC_NAME" "$CC_VERSION")" - verifyResult $? "queryChaincodePackage on peer${PEER}.org${ORG} has Failed" - echo package_id="$package_id" - echo - - if chaincodeApprovedForOrg \ - "$PEER" "$ORG" \ - "$CHANNEL_NAME" \ - "$CC_NAME" "$CC_VERSION" \ - "$SEQ_NO" "$@"; then - echo "===================== Chaincode already approved on peer${PEER}.org${ORG} ===================== " - echo - return - fi - - echo - echo "Approving chaincode on peer${PEER}.org${ORG}..." - echo - setGlobals $PEER $ORG - set -x - peer lifecycle chaincode approveformyorg \ - --channelID "$CHANNEL_NAME" --tls --cafile "$ORDERER_CA" \ - --orderer orderer0."$DOMAIN_NAME":7050 \ - --name "$CC_NAME" --version "$CC_VERSION" \ - --collections-config /collections.json \ - --signature-policy "$ENDORSEMENT_POLICY" \ - --sequence "$SEQ_NO" \ - --cafile $ORDERER_CA --clientauth --certfile $CORE_PEER_TLS_CERT_FILE --keyfile $CORE_PEER_TLS_KEY_FILE \ - --package-id "$package_id" "$@" >&log.txt - res=$? - set +x - cat log.txt - verifyResult $res "Approving chaincode on peer${PEER}.org${ORG} has Failed" - echo "===================== Chaincode is approved on peer${PEER}.org${ORG} ===================== " - echo + PEER=$1 + ORG=$2 + CHANNEL_NAME=$3 + CC_NAME=$4 + CC_VERSION=$5 + SEQ_NO=$6 + shift 6 + + package_id="$(queryChaincodePackage "$PEER" "$ORG" "$CC_NAME" "$CC_VERSION")" + verifyResult $? "queryChaincodePackage on peer${PEER}.org${ORG} has Failed" + echo package_id="$package_id" + echo + + if chaincodeApprovedForOrg \ + "$PEER" "$ORG" \ + "$CHANNEL_NAME" \ + "$CC_NAME" "$CC_VERSION" \ + "$SEQ_NO" "$@"; then + echo "===================== Chaincode already approved on peer${PEER}.org${ORG} ===================== " + echo + return + fi + + echo + echo "Approving chaincode on peer${PEER}.org${ORG}..." + echo + setGlobals $PEER $ORG + set -x + peer lifecycle chaincode approveformyorg \ + --channelID "$CHANNEL_NAME" --tls --cafile "$ORDERER_CA" \ + --orderer orderer0."$DOMAIN_NAME":7050 \ + --name "$CC_NAME" --version "$CC_VERSION" \ + --collections-config /collections.json \ + --signature-policy "$ENDORSEMENT_POLICY" \ + --sequence "$SEQ_NO" \ + --cafile $ORDERER_CA --clientauth --certfile $CORE_PEER_TLS_CERT_FILE --keyfile $CORE_PEER_TLS_KEY_FILE \ + --package-id "$package_id" "$@" >&log.txt + res=$? + set +x + cat log.txt + verifyResult $res "Approving chaincode on peer${PEER}.org${ORG} has Failed" + echo "===================== Chaincode is approved on peer${PEER}.org${ORG} ===================== " + echo } chaincodeApprovedForOrg() { - PEER=$1 - ORG=$2 - CHANNEL_NAME=$3 - CC_NAME=$4 - CC_VERSION=$5 - SEQ_NO=$6 - shift 6 - - setGlobals $PEER $ORG &>/dev/null - msp="$CORE_PEER_LOCALMSPID" - - echo "Checking chaincode approval for $MSP..." - echo - checkChaincodeCommitReadiness \ - "$PEER" "$ORG" \ - "$CHANNEL_NAME" \ - "$CC_NAME" "$CC_VERSION" \ - "$SEQ_NO" "$@" > status.json - res=$? - if [ $res -ne 0 ]; then - return 1 - fi - - set -x - jq -er ".approvals.${msp} == true" status.json - res=$? - set +x - return $res + PEER=$1 + ORG=$2 + CHANNEL_NAME=$3 + CC_NAME=$4 + CC_VERSION=$5 + SEQ_NO=$6 + shift 6 + + setGlobals $PEER $ORG &>/dev/null + msp="$CORE_PEER_LOCALMSPID" + + echo "Checking chaincode approval for $MSP..." + echo + checkChaincodeCommitReadiness \ + "$PEER" "$ORG" \ + "$CHANNEL_NAME" \ + "$CC_NAME" "$CC_VERSION" \ + "$SEQ_NO" "$@" >status.json + res=$? + if [ $res -ne 0 ]; then + return 1 + fi + + set -x + jq -er ".approvals.${msp} == true" status.json + res=$? + set +x + return $res } waitForChaincodeCommitReadiness() { - PEER=$1 - ORG=$2 - CHANNEL_NAME=$3 - CC_NAME=$4 - CC_VERSION=$5 - SEQ_NO=$6 - shift 6 - - DELAY=3 - MAX_RETRY=5 - - echo "Waiting for chaincode commit readiness on peer${PEER}.org${ORG}..." - echo - setGlobals $PEER $ORG &>/dev/null - counter=0 - while [ $counter -lt $MAX_RETRY ] ; do - counter=$(expr $counter + 1) - sleep $DELAY - set -x - checkChaincodeCommitReadiness \ - "$PEER" "$ORG" \ - "$CHANNEL_NAME" \ - "$CC_NAME" "$CC_VERSION" \ - "$SEQ_NO" "$@" > status.json - res=$? - set +x - if [ $res -ne 0 ]; then - continue - fi - set -x - cat status.json | jq - jq -e '.approvals | all' status.json - res=$? - set +x - if [ $res -eq 0 ]; then - echo "===================== Chaincode commit readiness confirmed on peer${PEER}.org${ORG} ===================== " - echo - return - fi - done - verifyResult 1 "Chaincode commit readiness confirmation on peer${PEER}.org${ORG} has Failed" + PEER=$1 + ORG=$2 + CHANNEL_NAME=$3 + CC_NAME=$4 + CC_VERSION=$5 + SEQ_NO=$6 + shift 6 + + DELAY=3 + MAX_RETRY=5 + + echo "Waiting for chaincode commit readiness on peer${PEER}.org${ORG}..." + echo + setGlobals $PEER $ORG &>/dev/null + counter=0 + while [ $counter -lt $MAX_RETRY ]; do + counter=$(expr $counter + 1) + sleep $DELAY + set -x + checkChaincodeCommitReadiness \ + "$PEER" "$ORG" \ + "$CHANNEL_NAME" \ + "$CC_NAME" "$CC_VERSION" \ + "$SEQ_NO" "$@" >status.json + res=$? + set +x + if [ $res -ne 0 ]; then + continue + fi + set -x + cat status.json | jq + jq -e '.approvals | all' status.json + res=$? + set +x + if [ $res -eq 0 ]; then + echo "===================== Chaincode commit readiness confirmed on peer${PEER}.org${ORG} ===================== " + echo + return + fi + done + verifyResult 1 "Chaincode commit readiness confirmation on peer${PEER}.org${ORG} has Failed" } checkChaincodeCommitReadiness() { - PEER=$1 - ORG=$2 - CHANNEL_NAME=$3 - CC_NAME=$4 - CC_VERSION=$5 - SEQ_NO=$6 - shift 6 - - setGlobals $PEER $ORG &>/dev/null - set -x - peer lifecycle chaincode checkcommitreadiness \ - --channelID "$CHANNEL_NAME" \ - --name "$CC_NAME" --version "$CC_VERSION" \ - --collections-config /collections.json \ - --signature-policy "$ENDORSEMENT_POLICY" \ - --sequence "$SEQ_NO" \ - --output json "$@" - res=$? - set +x - if [ $res -ne 0 ]; then - return 1 - fi + PEER=$1 + ORG=$2 + CHANNEL_NAME=$3 + CC_NAME=$4 + CC_VERSION=$5 + SEQ_NO=$6 + shift 6 + + setGlobals $PEER $ORG &>/dev/null + set -x + peer lifecycle chaincode checkcommitreadiness \ + --channelID "$CHANNEL_NAME" \ + --name "$CC_NAME" --version "$CC_VERSION" \ + --collections-config /collections.json \ + --signature-policy "$ENDORSEMENT_POLICY" \ + --sequence "$SEQ_NO" \ + --output json "$@" + res=$? + set +x + if [ $res -ne 0 ]; then + return 1 + fi } commitChaincode() { - CHANNEL_NAME=$1 - CC_NAME=$2 - CC_VERSION=$3 - SEQ_NO=$4 - shift 4 - - echo "Committing chaincode definition..." - echo - set -x - peer lifecycle chaincode commit \ - $(peerArgsEachOrg) \ - --channelID "$CHANNEL_NAME" --tls --cafile "$ORDERER_CA" \ - --orderer orderer0."$DOMAIN_NAME":7050 \ - --collections-config /collections.json \ - --signature-policy "$ENDORSEMENT_POLICY" \ - --sequence "$SEQ_NO" \ - --name "$CC_NAME" --version "$CC_VERSION" \ - --cafile $ORDERER_CA --clientauth --certfile $CORE_PEER_TLS_CERT_FILE --keyfile $CORE_PEER_TLS_KEY_FILE \ - "$@" >&log.txt - res=$? - set +x - cat log.txt - verifyResult $res "Committing chaincode definition failed" - echo "===================== Chaincode definition committed ===================== " - echo + CHANNEL_NAME=$1 + CC_NAME=$2 + CC_VERSION=$3 + SEQ_NO=$4 + shift 4 + + echo "Committing chaincode definition..." + echo + set -x + peer lifecycle chaincode commit \ + $(peerArgsEachOrg) \ + --channelID "$CHANNEL_NAME" --tls --cafile "$ORDERER_CA" \ + --orderer orderer0."$DOMAIN_NAME":7050 \ + --collections-config /collections.json \ + --signature-policy "$ENDORSEMENT_POLICY" \ + --sequence "$SEQ_NO" \ + --name "$CC_NAME" --version "$CC_VERSION" \ + --cafile $ORDERER_CA --clientauth --certfile $CORE_PEER_TLS_CERT_FILE --keyfile $CORE_PEER_TLS_KEY_FILE \ + "$@" >&log.txt + res=$? + set +x + cat log.txt + verifyResult $res "Committing chaincode definition failed" + echo "===================== Chaincode definition committed ===================== " + echo } waitForCommittedVersion() { - PEER=$1 - ORG=$2 - CHANNEL_NAME=$3 - CC_NAME=$4 - CC_VERSION=$5 - - DELAY=3 - MAX_RETRY=5 - - echo "Waiting for chaincode version $CC_VERSION (for $CC_NAME) to be committed on peer${PEER}.org${ORG}..." >&2 - echo >&2 - counter=0 - while [ $counter -lt $MAX_RETRY ] ; do - counter=$(expr $counter + 1) - sleep $DELAY - queryCommitted "$PEER" "$ORG" "$CHANNEL_NAME" "$CC_NAME" "$CC_VERSION" > committed.json - res=$? - if [ $res -ne 0 ]; then - continue - fi - set -x - installed_ver="$(jq -er '.version' committed.json)" - res=$? - set +x - if [ $res -ne 0 ]; then - continue - fi - if [ "$installed_ver" == "$CC_VERSION" ]; then - echo "===================== Query chaincode definition successful on peer${PEER}.org${ORG} ===================== " >&2 - echo >&2 - return - fi - done - verifyResult 1 "Query chaincode definition failed on peer${PEER}.org${ORG} has Failed" + PEER=$1 + ORG=$2 + CHANNEL_NAME=$3 + CC_NAME=$4 + CC_VERSION=$5 + + DELAY=3 + MAX_RETRY=5 + + echo "Waiting for chaincode version $CC_VERSION (for $CC_NAME) to be committed on peer${PEER}.org${ORG}..." >&2 + echo >&2 + counter=0 + while [ $counter -lt $MAX_RETRY ]; do + counter=$(expr $counter + 1) + sleep $DELAY + queryCommitted "$PEER" "$ORG" "$CHANNEL_NAME" "$CC_NAME" "$CC_VERSION" >committed.json + res=$? + if [ $res -ne 0 ]; then + continue + fi + set -x + installed_ver="$(jq -er '.version' committed.json)" + res=$? + set +x + if [ $res -ne 0 ]; then + continue + fi + if [ "$installed_ver" == "$CC_VERSION" ]; then + echo "===================== Query chaincode definition successful on peer${PEER}.org${ORG} ===================== " >&2 + echo >&2 + return + fi + done + verifyResult 1 "Query chaincode definition failed on peer${PEER}.org${ORG} has Failed" } nextSequenceNumber() { - CHANNEL_NAME=$1 - CC_NAME=$2 - CC_VERSION=$3 - - PEER="$(firstPeer)" - ORG="$(firstOrg)" - - queryCommitted "$PEER" "$ORG" "$CHANNEL_NAME" "$CC_NAME" "$CC_VERSION" > committed.json - res=$? - if [ $res -ne 0 ]; then - echo 1 - return - fi - set -x - seq_num="$(jq -er 'select(.version = "$CC_VERSION") | .sequence' committed.json)" - res=$? - set +x - if [ $res -ne 0 ]; then - echo 1 - return - fi - - echo $(($seq_num + 1)) + CHANNEL_NAME=$1 + CC_NAME=$2 + CC_VERSION=$3 + + PEER="$(firstPeer)" + ORG="$(firstOrg)" + + queryCommitted "$PEER" "$ORG" "$CHANNEL_NAME" "$CC_NAME" "$CC_VERSION" >committed.json + res=$? + if [ $res -ne 0 ]; then + echo 1 + return + fi + set -x + seq_num="$(jq -er 'select(.version = "$CC_VERSION") | .sequence' committed.json)" + res=$? + set +x + if [ $res -ne 0 ]; then + echo 1 + return + fi + + echo $(($seq_num + 1)) } queryCommitted() { - PEER=$1 - ORG=$2 - CHANNEL_NAME=$3 - CC_NAME=$4 - CC_VERSION=$5 - - echo "Querying chaincode ${CC_NAME}:${CC_VERSION} committed status on peer${PEER}.org${ORG}..." >&2 - echo >&2 - setGlobals $PEER $ORG &>/dev/null - set -x - peer lifecycle chaincode querycommitted \ - --channelID "$CHANNEL_NAME" \ - --name "$CC_NAME" \ - --output json + PEER=$1 + ORG=$2 + CHANNEL_NAME=$3 + CC_NAME=$4 + CC_VERSION=$5 + + echo "Querying chaincode ${CC_NAME}:${CC_VERSION} committed status on peer${PEER}.org${ORG}..." >&2 + echo >&2 + setGlobals $PEER $ORG &>/dev/null + set -x + peer lifecycle chaincode querycommitted \ + --channelID "$CHANNEL_NAME" \ + --name "$CC_NAME" \ + --output json } forEachOrg() { - local command=$1 - shift - for orgIdx in "${ORG_INDICES[@]}" - do - "${command}" "$(firstPeer)" "${orgIdx}" "$@" - done + local command=$1 + shift + for orgIdx in "${ORG_INDICES[@]}"; do + "${command}" "$(firstPeer)" "${orgIdx}" "$@" + done } forEachPeer() { - local command=$1 - shift - for orgIdx in "${ORG_INDICES[@]}" - do - for peerIdx in "${PEER_INDICES[@]}" - do - "${command}" "${peerIdx}" "${orgIdx}" "$@" - done - done + local command=$1 + shift + for orgIdx in "${ORG_INDICES[@]}"; do + for peerIdx in "${PEER_INDICES[@]}"; do + "${command}" "${peerIdx}" "${orgIdx}" "$@" + done + done } From 38becc90ec5e8f909e48882df3b145a2bd3b1fbf Mon Sep 17 00:00:00 2001 From: sam-at-luther Date: Thu, 24 Jul 2025 15:57:58 -0700 Subject: [PATCH 4/5] Add oracle release script --- .../actions/configure-dockerhub/action.yml | 11 +++++ .github/workflows/release.yml | 49 +++++++++++++++++++ common.mk | 1 + 3 files changed, 61 insertions(+) create mode 100644 .github/actions/configure-dockerhub/action.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/actions/configure-dockerhub/action.yml b/.github/actions/configure-dockerhub/action.yml new file mode 100644 index 0000000..3805a26 --- /dev/null +++ b/.github/actions/configure-dockerhub/action.yml @@ -0,0 +1,11 @@ +name: configure-dockerhub +description: Login to dockerhub +runs: + using: composite + steps: + - name: Configure Docker Hub + run: |- + [ -z "$DOCKERHUB_USERNAME" ] && exit 0 + [ -z "$DOCKERHUB_TOKEN" ] && exit 0 + echo "${DOCKERHUB_TOKEN}" | docker login --username $DOCKERHUB_USERNAME --password-stdin + shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c02d33e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Build, Push, and Release +on: + push: + tags: + - "*" +jobs: + build-push-docker: + name: ${{ matrix.arch }} - docker build + runs-on: ${{ fromJSON('{"arm64":"2vcpu-ubuntu-2204-arm","amd64":"ubuntu-22.04"}')[matrix.arch] }} + permissions: + id-token: write # Required for OIDC authentication + contents: read # This is required for actions/checkout@v4 + strategy: + matrix: + arch: + - amd64 + - arm64 + steps: + - uses: actions/checkout@v4 + with: + lfs: true + fetch-depth: 0 # include tags for VERSION detection + - name: Configure DockerHub + uses: ./.github/actions/configure-dockerhub + env: + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }} + - name: Set up Go 1.24 + uses: actions/setup-go@v5 + with: + go-version: "1.24" + - name: Publish Docker + run: make publish VERSION=$GITHUB_REF_NAME TAG_SUFFIX=-${{ matrix.arch }} + push-docker-manifests: + runs-on: ubuntu-22.04 + needs: + - build-push-docker + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Configure DockerHub + uses: ./.github/actions/configure-dockerhub + env: + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Publish + run: make publish-docker-manifests VERSION=$GITHUB_REF_NAME diff --git a/common.mk b/common.mk index 600a743..4518af5 100644 --- a/common.mk +++ b/common.mk @@ -88,6 +88,7 @@ TAR=tar DUMMY_TARGET=build/$(1)/$(2)/.dummy IMAGE_DUMMY=$(call DUMMY_TARGET,image,$(1)) PUSH_DUMMY=$(call DUMMY_TARGET,push,$(1)) +MANIFEST_DUMMY=$(call DUMMY_TARGET,manifest,$(1)) PLUGIN_DUMMY=$(call DUMMY_TARGET,plugin,$(1)) STATIC_PLUGINS_DUMMY=$(call PLUGIN_DUMMY,${SUBSTRATE_VERSION}) From f9bb5bdd1246d0500a43e44c51d200cd61429d6a Mon Sep 17 00:00:00 2001 From: sam-at-luther Date: Thu, 24 Jul 2025 16:45:31 -0700 Subject: [PATCH 5/5] Use buildjet for arm --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c02d33e..e637bf8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: jobs: build-push-docker: name: ${{ matrix.arch }} - docker build - runs-on: ${{ fromJSON('{"arm64":"2vcpu-ubuntu-2204-arm","amd64":"ubuntu-22.04"}')[matrix.arch] }} + runs-on: ${{ fromJSON('{"arm64":"buildjet-2vcpu-ubuntu-2204-arm","amd64":"ubuntu-22.04"}')[matrix.arch] }} permissions: id-token: write # Required for OIDC authentication contents: read # This is required for actions/checkout@v4