-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Or 1101 titond backend add swagger and ci for checking if the swagger doc is updated #10
Or 1101 titond backend add swagger and ci for checking if the swagger doc is updated #10
Conversation
Dockerfile
Outdated
@@ -7,6 +7,7 @@ WORKDIR /app | |||
COPY . . | |||
|
|||
ARG TARGETOS TARGETARCH | |||
RUN go install github.com/swaggo/swag@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't have to add this. we are not using swag command in docker container!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
In actual, i also was not sure about that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much Brave! I think the command need to use swag
command!
Instead of this, we have to add copy of api directory to /root/api
!
@ohbyeongmin
And I'm sorry my missing about the directory of deployments. I gave fault path of it to you before. The path is /root/deployments
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nguyenzung
Oh, we are using the swag command in Dockerfile,,, I know it now. But we have to add files for swagger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FROM --platform=$BUILDPLATFORM golang:1.20-alpine AS builder
RUN apk add --no-cache make gcc musl-dev linux-headers git
WORKDIR /app
COPY . .
RUN go install github.com/swaggo/swag/cmd/swag@latest
ARG TARGETOS TARGETARCH
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make titond
FROM alpine
RUN apk add --no-cache ca-certificates jq curl
COPY --from=builder /app/api /root/api
COPY --from=builder /app/deployments /root/deployments
COPY --from=builder /app/build/bin/titond /usr/local/bin/
WORKDIR /root
ENTRYPOINT ["titond"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your support
I updated and also update the base image due this issue: aws/aws-cli#4971
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
But I think we don't have to get aws-cli in our container! If you agree, let me change it later!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thank you,
I added aws-cli because I couldnot run in my laptop
c403cc5
to
4707570
Compare
cmd/titond/main.go
Outdated
@@ -10,6 +10,7 @@ import ( | |||
"github.com/tokamak-network/tokamak-titond-backend/pkg/http" | |||
"github.com/tokamak-network/tokamak-titond-backend/pkg/kubernetes" | |||
"github.com/tokamak-network/tokamak-titond-backend/pkg/services" | |||
apptest "github.com/tokamak-network/tokamak-titond-backend/test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use test
as a package name now. It is small thing. Thank you! 😍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated
cmd/titond/main.go
Outdated
@@ -107,6 +107,7 @@ func checkSwagger(ctx *cli.Context) error { | |||
fmt.Printf("%-6s %-25s %s\n", route.Method, route.Path, route.Handler) | |||
} | |||
fmt.Println("Total APIs: ", numAPIs) | |||
fmt.Println("Total APIs excluding swagger api: ", (numAPIs - 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So kind! 😍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much, Brave! ❤️❤️
COPY --from=builder /app/deployments /root/deployments | ||
COPY --from=builder /app/build/bin/titond /usr/local/bin/ | ||
|
||
WORKDIR /usr/local/bin/ | ||
WORKDIR /root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ohbyeongmin We can use the ./deployments path in container env now!
Thank you!