From 33cdb7ed84e19a5a4878128b37e673c820b260ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frans=20F=C3=BCrst?= Date: Fri, 3 Jan 2025 12:55:21 +0100 Subject: [PATCH] back-ports depoloy-deliverables pipeline .. in order to keep release workflow synchronized Change-Id: I5ed166bb687e001a156348b26fe373c17712a43c --- buildscripts/scripts/deploy-to-website.groovy | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 buildscripts/scripts/deploy-to-website.groovy diff --git a/buildscripts/scripts/deploy-to-website.groovy b/buildscripts/scripts/deploy-to-website.groovy new file mode 100644 index 00000000000..367c4db0dd8 --- /dev/null +++ b/buildscripts/scripts/deploy-to-website.groovy @@ -0,0 +1,55 @@ +#!groovy + +/// file: deploy_to_website.groovy + +def main() { + check_job_parameters([ + ["VERSION", true], + ["CIPARAM_REMOVE_RC_CANDIDATES", true], + ]); + + check_environment_variables([ + "WEB_DEPLOY_PORT", + "WEB_DEPLOY_URL", + ]); + + def versioning = load("${checkout_dir}/buildscripts/scripts/utils/versioning.groovy"); + def artifacts_helper = load("${checkout_dir}/buildscripts/scripts/utils/upload_artifacts.groovy"); + + def cmk_version_rc_aware = versioning.get_cmk_version( + versioning.safe_branch_name(scm), + versioning.get_branch_version(checkout_dir), + params.VERSION + ); + + print( + """ + |===== CONFIGURATION =============================== + |VERSION:...................... │${params.VERSION}│ + |CIPARAM_REMOVE_RC_CANDIDATES:. │${params.CIPARAM_REMOVE_RC_CANDIDATES}│ + |cmk_version_rc_aware:......... │${cmk_version_rc_aware}│ + |WEB_DEPLOY_PORT:.............. │${env.WEB_DEPLOY_PORT}│ + |WEB_DEPLOY_URL:............... │${env.WEB_DEPLOY_URL}│ + |=================================================== + """.stripMargin()); + + inside_container(ulimit_nofile: 1024) { + smart_stage( + name: "Deploy to website", + ) { + artifacts_helper.deploy_to_website( + cmk_version_rc_aware + ); + } + smart_stage( + name: "Cleanup RC candicates", + condition: params.CIPARAM_REMOVE_RC_CANDIDATES, + ) { + artifacts_helper.cleanup_rc_candidates_of_version( + cmk_version_rc_aware + ); + } + } +} + +return this;