feat: Generate crds in Dockerfile
All checks were successful
Build and deploy / build (push) Successful in 11m29s
All checks were successful
Build and deploy / build (push) Successful in 11m29s
This commit is contained in:
@@ -9,8 +9,8 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: dreaded_x/workflows/.gitea/workflows/docker-kubernetes.yaml@ef78704b98c72e4a6b8340f9bff7b085a7bdd95c
|
||||
uses: dreaded_x/workflows/.gitea/workflows/docker-kubernetes.yaml@97983639818488b2d6d78043c16bd42721b191d5
|
||||
|
||||
secrets: inherit
|
||||
with:
|
||||
generate_crds: true
|
||||
webhook_url: ${{ secrets.WEBHOOK_URL }}
|
||||
|
||||
@@ -15,9 +15,11 @@ RUN cargo chef cook --release --recipe-path recipe.json
|
||||
COPY . .
|
||||
ARG RELEASE_VERSION
|
||||
ENV RELEASE_VERSION=${RELEASE_VERSION}
|
||||
RUN cargo auditable build --release
|
||||
RUN cargo auditable build --release && /app/target/release/crdgen > /crds.yaml
|
||||
|
||||
FROM scratch AS manifests
|
||||
COPY --from=builder /crds.yaml /
|
||||
|
||||
FROM gcr.io/distroless/cc-debian12:nonroot AS runtime
|
||||
COPY --from=builder /app/target/release/lldap-controller /lldap-controller
|
||||
COPY --from=builder /app/target/release/crdgen /crdgen
|
||||
CMD ["/lldap-controller"]
|
||||
|
||||
@@ -2,7 +2,7 @@ variable "TAG_BASE" {}
|
||||
variable "RELEASE_VERSION" {}
|
||||
|
||||
group "default" {
|
||||
targets = ["lldap-controller"]
|
||||
targets = ["lldap-controller", "manifests"]
|
||||
}
|
||||
|
||||
target "docker-metadata-action" {}
|
||||
@@ -12,4 +12,12 @@ target "lldap-controller" {
|
||||
context = "./"
|
||||
dockerfile = "Dockerfile"
|
||||
tags = [for tag in target.docker-metadata-action.tags : "${TAG_BASE}:${tag}"]
|
||||
target = "runtime"
|
||||
}
|
||||
|
||||
target "manifests" {
|
||||
context = "./"
|
||||
dockerfile = "Dockerfile"
|
||||
target = "manifests"
|
||||
output = [{ type = "cacheonly" }, "manifests"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user