diff --git a/.github/actions/build_cli/action.yml b/.github/actions/build_cli/action.yml index 61a5957af..d567814a7 100644 --- a/.github/actions/build_cli/action.yml +++ b/.github/actions/build_cli/action.yml @@ -51,10 +51,9 @@ runs: - name: Build CLI run: | echo "::group::Build CLI" - GIT_TAG=$(git describe --tags --always --dirty --abbrev=0) mkdir -p build cd build - cmake -DCLI_BUILD_TAGS:STRING=gcp,enterprise -DCLI_VERSION:STRING=${GIT_TAG} .. + cmake -DCLI_BUILD_TAGS:STRING=enterprise .. GOOS=${{ inputs.targetOS }} GOARCH=${{ inputs.targetArch }} make -j`nproc` cli cp constellation constellation-${{ inputs.targetOS }}-${{ inputs.targetArch }} echo "$(pwd)" >> $GITHUB_PATH diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a1a7d6c7..798f2da35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.11) -project(constellation LANGUAGES C VERSION 0.1.0) - -set(CLI_VERSION "v0.1.0" CACHE STRING "Version of CLI binary.") -set(CLI_BUILD_TAGS "gcp" CACHE STRING "Tags passed to go build of Constellation CLI.") +project(constellation LANGUAGES C VERSION 2.0.0) +set(CLI_BUILD_TAGS "" CACHE STRING "Tags passed to go build of Constellation CLI.") enable_testing() @@ -10,7 +8,7 @@ enable_testing() # core-os disk-mapper # add_custom_target(disk-mapper ALL - DOCKER_BUILDKIT=1 docker build -o ${CMAKE_BINARY_DIR} -f Dockerfile.build --target disk-mapper . + DOCKER_BUILDKIT=1 docker build -o ${CMAKE_BINARY_DIR} --build-arg PROJECT_VERSION=${PROJECT_VERSION} -f Dockerfile.build --target disk-mapper . WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} BYPRODUCTS disk-mapper ) @@ -18,20 +16,17 @@ add_custom_target(disk-mapper ALL # # bootstrapper # - add_custom_target(bootstrapper ALL DOCKER_BUILDKIT=1 docker build -o ${CMAKE_BINARY_DIR} --build-arg PROJECT_VERSION=${PROJECT_VERSION} -f Dockerfile.build --target bootstrapper . WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} BYPRODUCTS bootstrapper ) - # # cli # - 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=${CLI_VERSION}" + 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}" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cli BYPRODUCTS constellation ) @@ -39,7 +34,6 @@ add_custom_target(cli ALL # # testing / debugging # - add_custom_target(debug_bootstrapper go build -o ${CMAKE_BINARY_DIR}/debug_bootstrapper -buildvcs=false -ldflags "-buildid='' -X main.version=${PROJECT_VERSION}" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bootstrapper/cmd/bootstrapper @@ -49,7 +43,6 @@ add_custom_target(debug_bootstrapper # # debugd # - add_custom_target(debugd ALL CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/debugd -buildvcs=false -ldflags "-buildid=''" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/debugd/cmd/debugd @@ -59,7 +52,6 @@ add_custom_target(debugd ALL # # cdbg # - add_custom_target(cdbg ALL CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/cdbg -buildvcs=false -ldflags "-buildid=''" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/debugd/cmd/cdbg diff --git a/Dockerfile.build b/Dockerfile.build index 28af96dd0..8bbebcd7e 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -33,12 +33,12 @@ FROM build AS build-bootstrapper WORKDIR /constellation/bootstrapper/ ARG PROJECT_VERSION -RUN go build -o bootstrapper -tags=gcp,disable_tpm_simulator -buildvcs=false -ldflags "-s -w -buildid='' -X main.version=${PROJECT_VERSION}" ./cmd/bootstrapper/ +RUN go build -o bootstrapper -tags=disable_tpm_simulator -buildvcs=false -ldflags "-s -w -buildid='' -X main.version=${PROJECT_VERSION}" ./cmd/bootstrapper/ FROM build AS build-disk-mapper WORKDIR /constellation/disk-mapper/ -RUN go build -o disk-mapper -ldflags "-s -w" ./cmd/ +RUN go build -o disk-mapper -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/internal/constants.VersionInfo=${PROJECT_VERSION}" ./cmd/ FROM scratch AS bootstrapper COPY --from=build-bootstrapper /constellation/bootstrapper/bootstrapper / diff --git a/joinservice/README.md b/joinservice/README.md index cc6e70e94..a43ef5770 100644 --- a/joinservice/README.md +++ b/joinservice/README.md @@ -44,6 +44,6 @@ Implements interaction with the Kubernetes API to create join tokens for new nod ## [Dockerfile](./Dockerfile) ```shell -export VERSION=1.0.0 +export VERSION=0.0.0 DOCKER_BUILDKIT=1 docker build --build-arg PROJECT_VERSION=${VERSION} -t ghcr.io/edgelesssys/constellation/join-service:v${VERSION} -f joinservice/Dockerfile . ```