Fix CLI version injection in cmake

This commit is contained in:
katexochen 2022-10-11 17:08:23 +02:00 committed by Paul Meyer
parent 57b8efd1ec
commit 39341e5f6b
5 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ add_custom_target(bootstrapper ALL
# cli # cli
# #
add_custom_target(cli ALL add_custom_target(cli ALL
CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/constellation -tags='${CLI_BUILD_TAGS}' -ldflags "-buildid='' -X github.com/edgelesssys/constellation/internal/constants.VersionInfo=${PROJECT_VERSION}" CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/constellation -tags='${CLI_BUILD_TAGS}' -ldflags "-buildid='' -X github.com/edgelesssys/constellation/v2/internal/constants.VersionInfo=${PROJECT_VERSION}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cli WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cli
BYPRODUCTS constellation BYPRODUCTS constellation
) )

View File

@ -30,7 +30,7 @@ RUN go build -o bootstrapper -tags=disable_tpm_simulator -buildvcs=false -ldflag
FROM build AS build-disk-mapper FROM build AS build-disk-mapper
WORKDIR /constellation/disk-mapper/ WORKDIR /constellation/disk-mapper/
RUN go build -o disk-mapper -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/internal/constants.VersionInfo=${PROJECT_VERSION}" ./cmd/ RUN go build -o disk-mapper -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/v2/internal/constants.VersionInfo=${PROJECT_VERSION}" ./cmd/
FROM scratch AS bootstrapper FROM scratch AS bootstrapper
COPY --from=build-bootstrapper /constellation/bootstrapper/bootstrapper / COPY --from=build-bootstrapper /constellation/bootstrapper/bootstrapper /

View File

@ -23,7 +23,7 @@ RUN rm -rf ./hack/
WORKDIR /constellation/joinservice WORKDIR /constellation/joinservice
ARG PROJECT_VERSION=0.0.0 ARG PROJECT_VERSION=0.0.0
RUN CGO_ENABLED=0 go build -o join-service -trimpath -buildvcs=false -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/internal/constants.VersionInfo=${PROJECT_VERSION}" ./cmd/ RUN CGO_ENABLED=0 go build -o join-service -trimpath -buildvcs=false -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/v2/internal/constants.VersionInfo=${PROJECT_VERSION}" ./cmd/
# Use gcr.io/distroless/static here since we need CA certificates to be installed for aTLS operations on GCP. # Use gcr.io/distroless/static here since we need CA certificates to be installed for aTLS operations on GCP.
FROM gcr.io/distroless/static@sha256:d673e44035b1435c88f63c4b7066501e21fe5c6b111cd9ada7d9301f780b2416 as release FROM gcr.io/distroless/static@sha256:d673e44035b1435c88f63c4b7066501e21fe5c6b111cd9ada7d9301f780b2416 as release

View File

@ -24,7 +24,7 @@ RUN rm -rf ./hack/
RUN mkdir -p /constellation/build RUN mkdir -p /constellation/build
WORKDIR /constellation/kms/cmd WORKDIR /constellation/kms/cmd
ARG PROJECT_VERSION=0.0.0 ARG PROJECT_VERSION=0.0.0
RUN CGO_ENABLED=0 go build -o /constellation/build/kmsserver -trimpath -buildvcs=false -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/internal/constants.VersionInfo=${PROJECT_VERSION}" RUN CGO_ENABLED=0 go build -o /constellation/build/kmsserver -trimpath -buildvcs=false -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/v2/internal/constants.VersionInfo=${PROJECT_VERSION}"
# Use gcr.io/distroless/static here since we need CA certificates to be installed for aTLS operations on GCP. # Use gcr.io/distroless/static here since we need CA certificates to be installed for aTLS operations on GCP.
FROM gcr.io/distroless/static@sha256:d673e44035b1435c88f63c4b7066501e21fe5c6b111cd9ada7d9301f780b2416 as release FROM gcr.io/distroless/static@sha256:d673e44035b1435c88f63c4b7066501e21fe5c6b111cd9ada7d9301f780b2416 as release

View File

@ -23,7 +23,7 @@ RUN rm -rf ./hack/
WORKDIR /constellation/verify WORKDIR /constellation/verify
ARG PROJECT_VERSION=0.0.0 ARG PROJECT_VERSION=0.0.0
RUN CGO_ENABLED=0 go build -o verify-service -trimpath -buildvcs=false -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/internal/constants.VersionInfo=${PROJECT_VERSION}" ./cmd/ RUN CGO_ENABLED=0 go build -o verify-service -trimpath -buildvcs=false -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/v2/internal/constants.VersionInfo=${PROJECT_VERSION}" ./cmd/
FROM scratch AS release FROM scratch AS release
COPY --from=build /constellation/verify/verify-service /verify COPY --from=build /constellation/verify/verify-service /verify