diff --git a/buildscripts/scripts/build-cmk-image.groovy b/buildscripts/scripts/build-cmk-image.groovy index 23ac4f61970..4701bc74606 100644 --- a/buildscripts/scripts/build-cmk-image.groovy +++ b/buildscripts/scripts/build-cmk-image.groovy @@ -92,55 +92,49 @@ def main() { } smart_stage(name: 'Build Image', condition: build_image) { - on_dry_run_omit(LONG_RUNNING, "Download build sources") { - artifacts_helper.download_deb( - "${INTERNAL_DEPLOY_DEST}", - "${INTERNAL_DEPLOY_PORT}", + artifacts_helper.download_deb( + "${INTERNAL_DEPLOY_DEST}", + "${INTERNAL_DEPLOY_PORT}", + "${cmk_version_rc_aware}", + "${source_dir}", + "${EDITION}", + "jammy"); + artifacts_helper.download_source_tar( + "${INTERNAL_DEPLOY_DEST}", + "${INTERNAL_DEPLOY_PORT}", + "${cmk_version_rc_aware}", + "${source_dir}", + "${EDITION}"); + + /// TODO: fix this: + /// build-cmk-container does not support the downloads dir + /// to have an arbitrary location, so we have to provide + /// `download` inside the checkout_dir + sh(""" + scripts/run-uvenv python \ + buildscripts/scripts/build-cmk-container.py \ + --branch=${branch_name} \ + --edition=${EDITION} \ + --version=${cmk_version} \ + --source_path=${source_dir} \ + --set_latest_tag=${SET_LATEST_TAG} \ + --set_branch_latest_tag=${SET_BRANCH_LATEST_TAG} \ + --no_cache=${BUILD_IMAGE_WITHOUT_CACHE} \ + --image_cmk_base=${CUSTOM_CMK_BASE_IMAGE} \ + --action=build \ + -vvvv + """); + + def filename = versioning.get_docker_artifact_name(EDITION, cmk_version); + stage("Upload to internal registry") { + println("Uploading ${filename}"); + artifacts_helper.upload_via_rsync( + "${package_dir}", "${cmk_version_rc_aware}", - "${source_dir}", - "${EDITION}", - "jammy"); - artifacts_helper.download_source_tar( + "${filename}", "${INTERNAL_DEPLOY_DEST}", "${INTERNAL_DEPLOY_PORT}", - "${cmk_version_rc_aware}", - "${source_dir}", - "${EDITION}"); - } - - on_dry_run_omit(LONG_RUNNING, "Run build-cmk-container.sh") { - /// TODO: fix this: - /// build-cmk-container does not support the downloads dir - /// to have an arbitrary location, so we have to provide - /// `download` inside the checkout_dir - sh(""" - scripts/run-uvenv python \ - buildscripts/scripts/build-cmk-container.py \ - --branch=${branch_name} \ - --edition=${EDITION} \ - --version=${cmk_version} \ - --source_path=${source_dir} \ - --set_latest_tag=${SET_LATEST_TAG} \ - --set_branch_latest_tag=${SET_BRANCH_LATEST_TAG} \ - --no_cache=${BUILD_IMAGE_WITHOUT_CACHE} \ - --image_cmk_base=${CUSTOM_CMK_BASE_IMAGE} \ - --action=build \ - -vvvv - """); - } - - def filename = versioning.get_docker_artifact_name(EDITION, cmk_version); - on_dry_run_omit(LONG_RUNNING, "Upload to internal registry") { - stage("Upload to internal registry") { - println("Uploading ${filename}"); - artifacts_helper.upload_via_rsync( - "${package_dir}", - "${cmk_version_rc_aware}", - "${filename}", - "${INTERNAL_DEPLOY_DEST}", - "${INTERNAL_DEPLOY_PORT}", - ); - } + ); } def perform_public_upload = true; diff --git a/buildscripts/scripts/test-integration-docker.groovy b/buildscripts/scripts/test-integration-docker.groovy index e816e9da7eb..e4f99a2e5ee 100644 --- a/buildscripts/scripts/test-integration-docker.groovy +++ b/buildscripts/scripts/test-integration-docker.groovy @@ -53,33 +53,28 @@ def main() { } stage('Download') { - on_dry_run_omit(LONG_RUNNING, "Download package and source") { - artifacts_helper.download_deb( - INTERNAL_DEPLOY_DEST, - INTERNAL_DEPLOY_PORT, - cmk_version_rc_aware, - "${package_dir}/${cmk_version_rc_aware}", - EDITION, - "jammy", // TODO (CMK-11568): This must be kept in sync with e.g. docker/Dockerfile - ); + artifacts_helper.download_deb( + INTERNAL_DEPLOY_DEST, + INTERNAL_DEPLOY_PORT, + cmk_version_rc_aware, + "${package_dir}/${cmk_version_rc_aware}", + EDITION, + "jammy", // TODO (CMK-11568): This must be kept in sync with e.g. docker/Dockerfile + ); - artifacts_helper.download_source_tar( - INTERNAL_DEPLOY_DEST, - INTERNAL_DEPLOY_PORT, - cmk_version_rc_aware, - "${package_dir}/${cmk_version_rc_aware}", - EDITION, - ); - } + artifacts_helper.download_source_tar( + INTERNAL_DEPLOY_DEST, + INTERNAL_DEPLOY_PORT, + cmk_version_rc_aware, + "${package_dir}/${cmk_version_rc_aware}", + EDITION, + ); } // TODO: don't run make-test-docker but use docker.inside() instead stage('test cmk-docker integration') { dir("${checkout_dir}/tests") { - def cmd = "make test-docker-docker WORKSPACE='${checkout_dir}' BRANCH='$branch_name' EDITION='$EDITION' VERSION='$cmk_version_rc_aware'"; - on_dry_run_omit(LONG_RUNNING, "RUN ${cmd}") { - sh(cmd); - } + sh("make test-docker-docker WORKSPACE='${checkout_dir}' BRANCH='$branch_name' EDITION='$EDITION' VERSION='$cmk_version_rc_aware'"); } } } diff --git a/buildscripts/scripts/utils/common.groovy b/buildscripts/scripts/utils/common.groovy index 061df529f35..f9124778f73 100644 --- a/buildscripts/scripts/utils/common.groovy +++ b/buildscripts/scripts/utils/common.groovy @@ -16,35 +16,6 @@ cleanup_directory = { directory -> sh("mkdir -p '${directory}'"); } -/// Run a block based on a global "dry run level" -/// Global level = "0" (or unset) means "run everything" -/// Global level "1" means "avoid dangerous side effects" -/// Global level "2" means "avoid dangerous side effects and long running stuff (like builds)" -LONG_RUNNING = 1; -GLOBAL_IMPACT = 2; -on_dry_run_omit = { level, title, fn -> - if (("${global_dry_run_level}" == "0" && level <= 2) || - ("${global_dry_run_level}" == "1" && level <= 1) || - ("${global_dry_run_level}" == "2" && level <= 0)) { - /* - print( - """ - |========================================================================================== - | RUN (level=${level} DRY_RUN_LEVEL=${global_dry_run_level}): "${title}" - |========================================================================================== - """.stripMargin()); - // return; - */ - return fn(); - } - print( - """ - ||========================================================================================== - || OMIT(level=${level} DRY_RUN_LEVEL=${global_dry_run_level}): "${title}" - ||========================================================================================== - """.stripMargin()); -} - shout = { msg -> sh("figlet -w 150 ${msg}"); }