Add stub repository structure

This commit is contained in:
2025-06-03 22:32:01 +02:00
commit 3ccb0fda2c
6 changed files with 45 additions and 0 deletions

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# My Swagger Service
Minimal repo to test Jenkins pipeline with buf + docker.

2
buf.yaml Normal file
View File

@@ -0,0 +1,2 @@
version: v1
name: buf.build/example/my-swagger-service

5
bug.gen.yaml Normal file
View File

@@ -0,0 +1,5 @@
version: v1
plugins:
- plugin: buf.build/grpc-ecosystem/openapiv2
out: deployments/docker
opt: logtostderr=true

View File

@@ -0,0 +1,3 @@
FROM nginx:alpine
COPY openapi.yaml /usr/share/nginx/html/openapi.yaml

15
protos/service.proto Normal file
View File

@@ -0,0 +1,15 @@
syntax = "proto3";
package example;
service HelloService {
rpc SayHello (HelloRequest) returns (HelloReply);
}
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}

View File

@@ -0,0 +1,17 @@
import shutil
import os
def main():
src = 'deployments/docker/openapiv2.json'
dst = 'deployments/docker/openapi.yaml'
print("Simulating OpenAPI v2 to v3 conversion...")
if os.path.exists(src):
shutil.copyfile(src, dst)
else:
with open(dst, 'w') as f:
f.write('# dummy OpenAPI v3 content\nopenapi: 3.0.0\ninfo:\n title: Example\n version: 1.0.0\n')
if __name__ == '__main__':
main()