Skip to content

Commit

Permalink
Fix-ci-release-branch (#254)
Browse files Browse the repository at this point in the history
* hardcoding CI branch for release cycle

* adding symbol to binary

* revert changes
  • Loading branch information
jt-dd authored Sep 6, 2024
1 parent 6d730b8 commit 8ef9212
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
20 changes: 11 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION}-alpine AS base
COPY --from=xx / /
RUN apk add --no-cache \
clang \
docker \
file \
findutils \
git \
make \
protoc \
protobuf-dev
clang \
docker \
file \
findutils \
git \
make \
protoc \
protobuf-dev
WORKDIR /src
ENV CGO_ENABLED=0

Expand All @@ -49,8 +49,10 @@ RUN --mount=type=bind,target=.,rw \

FROM build-base AS build
ARG BUILD_TAGS
ARG BUILD_BRANCH
ARG BUILD_FLAGS
ARG TARGETPLATFORM
ENV BUILD_BRANCH="${BUILD_BRANCH}"
RUN --mount=type=bind,target=. \
--mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/go/pkg/mod \
Expand Down Expand Up @@ -105,4 +107,4 @@ RUN --mount=from=binary \
cp kubehound* "/out/kubehound-${TARGETOS}-${TARGETARCH}${TARGETVARIANT}$(ls kubehound* | sed -e 's/^kubehound//')"

FROM scratch AS release
COPY --from=releaser /out/ /
COPY --from=releaser /out/ /
6 changes: 5 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ target "binary-cross" {
}

target "release" {
# Overrinding the branch as this target is only being used in the CI
args = {
BUILD_BRANCH = "main"
}
inherits = ["binary-cross"]
target = "release"
output = [outdir("./bin/release")]
Expand All @@ -68,4 +72,4 @@ target "release" {
target "image-cross" {
inherits = ["meta-helper", "binary"]
output = ["type=image"]
}
}

0 comments on commit 8ef9212

Please sign in to comment.