mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 08:27:26 +00:00
test
This commit is contained in:
parent
952da47c73
commit
0ba96c4ecc
@ -9,8 +9,10 @@ COPY docs/frameworks.json ../docs/frameworks.json
|
||||
FROM scratch AS generate
|
||||
COPY --from=base /app/src/app/proto/generated/ /console/src/app/proto/generated/
|
||||
|
||||
FROM base AS build
|
||||
FROM base AS builder
|
||||
RUN yarn build
|
||||
FROM scratch AS build
|
||||
COPY --from=builder /app/dist/console .
|
||||
|
||||
FROM base AS lint
|
||||
RUN yarn lint
|
||||
@ -20,6 +22,3 @@ RUN rm -rf /usr/share/nginx/html/*
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
FROM scratch AS output
|
||||
COPY --from=build /app/dist/console .
|
||||
|
@ -26,12 +26,37 @@ COPY --from=base /app/pkg/grpc/ /pkg/grpc/
|
||||
COPY --from=base /app/openapi/ /openapi/
|
||||
COPY --from=base /app/internal/api/assets/generator/ /internal/api/assets/generator/
|
||||
|
||||
FROM base AS build
|
||||
FROM base AS build-linux-amd64
|
||||
COPY --from=console ./ internal/api/ui/console/static
|
||||
COPY .goreleaser.yaml ./
|
||||
RUN goreleaser release --snapshot --clean
|
||||
# RUN CGO_ENABLED=0 go build -o zitadel -v -ldflags="-s -w -X 'github.com/zitadel/zitadel/cmd/build.commit=${COMMIT_SHA}' -X 'github.com/zitadel/zitadel/cmd/build.date=${now}' -X 'github.com/zitadel/zitadel/cmd/build.version=${VERSION}' " \
|
||||
# && chmod +x zitadel
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o zitadel -v -ldflags="-s -w -X 'github.com/zitadel/zitadel/cmd/build.commit=${COMMIT_SHA}' -X 'github.com/zitadel/zitadel/cmd/build.date=${now}' -X 'github.com/zitadel/zitadel/cmd/build.version=${VERSION}' " \
|
||||
&& chmod +x zitadel
|
||||
FROM base AS build-linux-arm64
|
||||
COPY --from=console ./ internal/api/ui/console/static
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o zitadel -v -ldflags="-s -w -X 'github.com/zitadel/zitadel/cmd/build.commit=${COMMIT_SHA}' -X 'github.com/zitadel/zitadel/cmd/build.date=${now}' -X 'github.com/zitadel/zitadel/cmd/build.version=${VERSION}' " \
|
||||
&& chmod +x zitadel
|
||||
FROM base AS build-darwin-amd64
|
||||
COPY --from=console ./ internal/api/ui/console/static
|
||||
RUN CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o zitadel -v -ldflags="-s -w -X 'github.com/zitadel/zitadel/cmd/build.commit=${COMMIT_SHA}' -X 'github.com/zitadel/zitadel/cmd/build.date=${now}' -X 'github.com/zitadel/zitadel/cmd/build.version=${VERSION}' " \
|
||||
&& chmod +x zitadel
|
||||
FROM base AS build-darwin-arm64
|
||||
COPY --from=console ./ internal/api/ui/console/static
|
||||
RUN CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o zitadel -v -ldflags="-s -w -X 'github.com/zitadel/zitadel/cmd/build.commit=${COMMIT_SHA}' -X 'github.com/zitadel/zitadel/cmd/build.date=${now}' -X 'github.com/zitadel/zitadel/cmd/build.version=${VERSION}' " \
|
||||
&& chmod +x zitadel
|
||||
FROM base AS build-windows-amd64
|
||||
COPY --from=console ./ internal/api/ui/console/static
|
||||
RUN CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o zitadel -v -ldflags="-s -w -X 'github.com/zitadel/zitadel/cmd/build.commit=${COMMIT_SHA}' -X 'github.com/zitadel/zitadel/cmd/build.date=${now}' -X 'github.com/zitadel/zitadel/cmd/build.version=${VERSION}' " \
|
||||
&& chmod +x zitadel
|
||||
FROM base AS build-windows-arm64
|
||||
COPY --from=console ./ internal/api/ui/console/static
|
||||
RUN CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o zitadel -v -ldflags="-s -w -X 'github.com/zitadel/zitadel/cmd/build.commit=${COMMIT_SHA}' -X 'github.com/zitadel/zitadel/cmd/build.date=${now}' -X 'github.com/zitadel/zitadel/cmd/build.version=${VERSION}' " \
|
||||
&& chmod +x zitadel
|
||||
FROM scratch AS build
|
||||
COPY --from=build-linux-amd64 /app/zitadel zitadel-linux-amd64
|
||||
COPY --from=build-linux-arm64 /app/zitadel zitadel-linux-arm64
|
||||
COPY --from=build-darwin-amd64 /app/zitadel zitadel-darwin-amd64
|
||||
COPY --from=build-darwin-arm64 /app/zitadel zitadel-darwin-arm64
|
||||
COPY --from=build-windows-amd64 /app/zitadel zitadel-windows-amd64
|
||||
COPY --from=build-windows-arm64 /app/zitadel zitadel-windows-arm64
|
||||
|
||||
FROM base AS lint
|
||||
COPY --from=console ./ internal/api/ui/console/static
|
||||
@ -39,13 +64,13 @@ COPY .golangci.yaml ./
|
||||
COPY .git/ ./.git/
|
||||
RUN make core_lint
|
||||
|
||||
FROM scratch AS output
|
||||
COPY --from=build /app/zitadel .
|
||||
|
||||
FROM base AS unit
|
||||
FROM base AS unit-test
|
||||
COPY --from=console ./ internal/api/ui/console/static
|
||||
RUN go test -race -coverprofile=profile.cov -coverpkg=./internal/... ./...
|
||||
|
||||
FROM scratch AS unit
|
||||
COPY --from=unit-test /app/profile.cov .
|
||||
|
||||
FROM debian:latest AS base-image
|
||||
ENV ZITADEL_ARGS=
|
||||
ARG TARGETPLATFORM
|
||||
|
@ -7,7 +7,7 @@ variable "REGISTRY" {
|
||||
}
|
||||
|
||||
group "all" {
|
||||
targets = ["build", "output", "lint", "image", "unit"]
|
||||
targets = ["build", "lint", "image", "unit"]
|
||||
}
|
||||
|
||||
group "build" {
|
||||
@ -18,10 +18,6 @@ group "generate" {
|
||||
targets = ["console-generate" , "core-generate"]
|
||||
}
|
||||
|
||||
group "output" {
|
||||
targets = ["console-output", "core-output"]
|
||||
}
|
||||
|
||||
group "lint" {
|
||||
targets = ["console-lint", "core-lint"]
|
||||
}
|
||||
@ -47,32 +43,28 @@ target "console" {
|
||||
name = "console-${tgt}"
|
||||
inherits = ["_console"]
|
||||
matrix = {
|
||||
tgt = ["build", "output", "lint", "image", "generate"]
|
||||
tgt = ["build", "lint", "image", "generate"]
|
||||
}
|
||||
output = {
|
||||
"build" = ["type=cacheonly"]
|
||||
"output" = ["type=local,dest=.build/console"]
|
||||
"build" = ["type=local,dest=.build/console"]
|
||||
"lint" = ["type=cacheonly"]
|
||||
"image" = ["type=docker"]
|
||||
"generate" = ["type=local,dest=./"]
|
||||
}[tgt]
|
||||
tags = {
|
||||
"build" = []
|
||||
"output" = []
|
||||
"lint" = []
|
||||
"image" = ["${REGISTRY}/console:${GITHUB_SHA}"]
|
||||
"generate" = []
|
||||
}[tgt]
|
||||
cache-to = {
|
||||
"build" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
|
||||
"output" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
|
||||
"lint" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
|
||||
"image" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
|
||||
"generate" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
|
||||
}[tgt]
|
||||
cache-from = {
|
||||
"build" = ["type=gha,scope=console-${tgt}"]
|
||||
"output" = ["type=gha,scope=console-${tgt}"]
|
||||
"lint" = ["type=gha,scope=console-${tgt}"]
|
||||
"image" = ["type=gha,scope=console-${tgt}"]
|
||||
"generate" = ["type=gha,scope=console-${tgt}"]
|
||||
@ -98,19 +90,17 @@ target "core" {
|
||||
name = "core-${tgt}"
|
||||
inherits = ["_core"]
|
||||
matrix = {
|
||||
tgt = ["build", "output", "lint", "image", "generate", "unit"]
|
||||
tgt = ["build", "lint", "image", "generate", "unit"]
|
||||
}
|
||||
output = {
|
||||
"build" = ["type=cacheonly"]
|
||||
"output" = ["type=local,dest=.build/core"]
|
||||
"build" = ["type=local,dest=.build/core"]
|
||||
"lint" = ["type=cacheonly"]
|
||||
"unit" = ["type=cacheonly"]
|
||||
"unit" = ["type=local,dest=./.build/core"]
|
||||
"image" = ["type=docker"]
|
||||
"generate" = ["type=local,dest=./"]
|
||||
}[tgt]
|
||||
tags = {
|
||||
"build" = []
|
||||
"output" = []
|
||||
"lint" = []
|
||||
"unit" = []
|
||||
"image" = ["${REGISTRY}/zitadel:${GITHUB_SHA}"]
|
||||
@ -118,7 +108,6 @@ target "core" {
|
||||
}[tgt]
|
||||
cache-to = {
|
||||
"build" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
|
||||
"output" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
|
||||
"lint" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
|
||||
"unit" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
|
||||
"image" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
|
||||
@ -126,7 +115,6 @@ target "core" {
|
||||
}[tgt]
|
||||
cache-from = {
|
||||
"build" = ["type=gha,scope=core-${tgt}"]
|
||||
"output" = ["type=gha,scope=core-${tgt}"]
|
||||
"lint" = ["type=gha,scope=core-${tgt}"]
|
||||
"unit" = ["type=gha,scope=core-${tgt}"]
|
||||
"image" = ["type=gha,scope=core-${tgt}"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user