9368d77bc8
Implements the `latestSchema` query to fetch the latest schema updates for an organization. This change enhances the GraphQL API by allowing clients to retrieve the most recent schema version and its associated subgraphs. The resolver performs necessary access checks, logs relevant information, and generates the Cosmo router configuration from fetched subgraph SDLs, returning structured schema update details.
41 lines
1.3 KiB
Docker
41 lines
1.3 KiB
Docker
FROM amd64/golang:1.25.4@sha256:efe81fa41fdf81fb873ab7cd931b9bb29bd10aced6c252cbd91739c34e654f01 as modules
|
|
WORKDIR /build
|
|
ADD go.* /build
|
|
RUN go mod download
|
|
|
|
FROM modules as build
|
|
ARG CI_COMMIT
|
|
WORKDIR /build
|
|
ENV CGO_ENABLED=0
|
|
ADD . /build
|
|
RUN CGO_ENABLED=1 go test -mod=readonly -race -coverprofile=coverage.txt.tmp -covermode=atomic -coverpkg=$(go list ./... | tr '\n' , | sed 's/,$//') ./...
|
|
RUN ["/bin/bash", "-c", "cat coverage.txt.tmp | grep -v testing.go | grep -v -f <(find . -type f | xargs grep -l 'Code generated by github.com/99designs/gqlgen, DO NOT EDIT') > coverage.txt"]
|
|
RUN go tool cover -html=coverage.txt -o coverage.html
|
|
RUN go tool cover -func=coverage.txt
|
|
RUN rm coverage.txt.tmp
|
|
|
|
RUN GOOS=linux GOARCH=amd64 go build \
|
|
-a -installsuffix cgo \
|
|
-mod=readonly \
|
|
-o /release/service \
|
|
-ldflags "-w -s -X main.buildVersion=${CI_COMMIT}" \
|
|
./cmd/service/service.go
|
|
|
|
FROM scratch as export
|
|
COPY --from=build /build/coverage.txt /
|
|
|
|
FROM node:22-alpine
|
|
ENV TZ Europe/Stockholm
|
|
|
|
# Install wgc CLI globally for Cosmo Router composition
|
|
RUN npm install -g wgc@latest
|
|
|
|
# Copy timezone data and certificates
|
|
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
# Copy the service binary
|
|
COPY --from=build /release/service /
|
|
|
|
CMD ["/service"]
|