vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 1 | package com.mirantis.mk |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 2 | |
azvyagintsev | c17d14b | 2022-06-06 19:06:33 +0300 | [diff] [blame] | 3 | import static groovy.json.JsonOutput.toJson |
| 4 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 5 | /** |
| 6 | * |
| 7 | * KaaS Component Testing Utilities |
| 8 | * |
| 9 | */ |
| 10 | |
Владислав Наумов | e534581 | 2020-08-12 16:30:20 +0200 | [diff] [blame] | 11 | /** |
| 12 | * Check KaaS Core CICD feature flags |
| 13 | * such triggers can be used in case of switching between pipelines, |
| 14 | * conditions inside pipelines to reduce dependency on jenkins job builder and jenkins job templates itself |
| 15 | * |
| 16 | * @return (map)[ |
| 17 | * ffNameEnabled: (bool) True/False |
| 18 | * ] |
| 19 | */ |
| 20 | def checkCoreCIFeatureFlags() { |
| 21 | def common = new com.mirantis.mk.Common() |
| 22 | def ff = [ |
| 23 | build_artifacts_upgrade: false, |
| 24 | ] |
| 25 | |
| 26 | def commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
| 27 | if (commitMsg ==~ /(?s).*\[ci-build-artifacts-upgrade\].*/) { |
| 28 | ff['build_artifacts_upgrade'] = true |
| 29 | } |
| 30 | |
| 31 | common.infoMsg("Core ci feature flags status: ${ff}") |
| 32 | return ff |
| 33 | } |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 34 | |
| 35 | /** |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 36 | * Determine scope of test suite against per-commit KaaS deployment based on keywords |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 37 | * Keyword list: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 38 | * |
| 39 | * Used for components team to combine test-suites and forward desired parameters to kaas/core deployment jobs |
| 40 | * Example scheme: |
Владислав Наумов | e534581 | 2020-08-12 16:30:20 +0200 | [diff] [blame] | 41 | * New CR pushed in kubernetes/lcm-ansible -> parsing it'cs commit body and combine test-suite -> trigger deployment jobs from kaas/core |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 42 | * manage test-suite through Jenkins Job Parameters |
| 43 | * |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 44 | * @return (map)[ |
| 45 | * deployChildEnabled: (bool) True if need to deploy child cluster during demo-run |
| 46 | * runUie2eEnabled: (bool) True if need to run ui-e2e cluster during demo-run |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 47 | * ] |
| 48 | */ |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 49 | def checkDeploymentTestSuite() { |
vnaumov | bdb9022 | 2020-05-04 18:25:50 +0200 | [diff] [blame] | 50 | def common = new com.mirantis.mk.Common() |
| 51 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 52 | // Available triggers and its sane defaults |
Владислав Наумов | 44c64b7 | 2020-12-04 20:22:53 +0100 | [diff] [blame] | 53 | def seedMacOs = env.SEED_MACOS ? env.SEED_MACOS.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 54 | def deployChild = env.DEPLOY_CHILD_CLUSTER ? env.DEPLOY_CHILD_CLUSTER.toBoolean() : false |
| 55 | def upgradeChild = env.UPGRADE_CHILD_CLUSTER ? env.UPGRADE_CHILD_CLUSTER.toBoolean() : false |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 56 | def fullUpgradeChild = env.FULL_UPGRADE_CHILD_CLUSTER ? env.FULL_UPGRADE_CHILD_CLUSTER.toBoolean() : false |
Mikhail Ivanov | 38ee438 | 2022-01-27 16:21:51 +0400 | [diff] [blame] | 57 | def mosDeployChild = env.DEPLOY_MOS_CHILD_CLUSTER ? env.DEPLOY_MOS_CHILD_CLUSTER.toBoolean() : false |
| 58 | def mosUpgradeChild = env.UPGRADE_MOS_CHILD_CLUSTER ? env.UPGRADE_MOS_CHILD_CLUSTER.toBoolean() : false |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 59 | def customChildRelease = env.KAAS_CHILD_CLUSTER_RELEASE_NAME ? env.KAAS_CHILD_CLUSTER_RELEASE_NAME : '' |
slalov | 021171f | 2022-03-04 14:48:38 +0400 | [diff] [blame] | 60 | def mosTfDeploy = env.MOS_TF_DEPLOY ? env.MOS_TF_DEPLOY.toBoolean() : false |
Владислав Наумов | 0dc9925 | 2020-11-13 13:30:48 +0100 | [diff] [blame] | 61 | def attachBYO = env.ATTACH_BYO ? env.ATTACH_BYO.toBoolean() : false |
Владислав Наумов | cdbd84e | 2020-12-01 16:51:09 +0100 | [diff] [blame] | 62 | def upgradeBYO = env.UPGRADE_BYO ? env.UPGRADE_BYO.toBoolean() : false |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 63 | def runBYOMatrix = env.RUN_BYO_MATRIX ? env.RUN_BYO_MATRIX.toBoolean() : false |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 64 | def defaultBYOOs = env.DEFAULT_BYO_OS ? env.DEFAULT_BYO_OS.toString() : 'ubuntu' |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 65 | def upgradeMgmt = env.UPGRADE_MGMT_CLUSTER ? env.UPGRADE_MGMT_CLUSTER.toBoolean() : false |
slalov | 1202bba | 2022-04-20 22:31:07 +0400 | [diff] [blame] | 66 | def autoUpgradeMgmt = env.AUTO_UPGRADE_MCC ? env.AUTO_UPGRADE_MCC.toBoolean() : false |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 67 | def enableLMALogging = env.ENABLE_LMA_LOGGING ? env.ENABLE_LMA_LOGGING.toBoolean(): false |
Sergey Lalov | b2f6037 | 2022-09-20 23:58:47 +0400 | [diff] [blame] | 68 | def deployOsOnMos = env.DEPLOY_OS_ON_MOS? env.DEPLOY_OS_ON_MOS.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 69 | def runUie2e = env.RUN_UI_E2E ? env.RUN_UI_E2E.toBoolean() : false |
Mikhail Ivanov | f5e20af | 2022-03-24 15:38:06 +0400 | [diff] [blame] | 70 | def runUie2eNew = env.RUN_UI_E2E_NEW ? env.RUN_UI_E2E_NEW.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 71 | def runMgmtConformance = env.RUN_MGMT_CFM ? env.RUN_MGMT_CFM.toBoolean() : false |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 72 | def runMgmtConformanceNetworkPolicy = env.RUN_MGMT_CFM_NETWORK_POLICY ? env.RUN_MGMT_CFM_NETWORK_POLICY.toBoolean() : false |
Владислав Наумов | 9cec55d | 2021-08-03 15:00:59 +0200 | [diff] [blame] | 73 | def runLMATest = env.RUN_LMA_TEST ? env.RUN_LMA_TEST.toBoolean() : false |
Vladyslav Drok | c4f9c1b | 2021-07-22 15:34:24 +0200 | [diff] [blame] | 74 | def runMgmtUserControllerTest = env.RUN_MGMT_USER_CONTROLLER_TEST ? env.RUN_MGMT_USER_CONTROLLER_TEST.toBoolean() : false |
Mikhail Ivanov | 2907e4d | 2022-04-25 16:41:21 +0400 | [diff] [blame] | 75 | def runProxyChildTest = env.RUN_PROXY_CHILD_TEST ? env.RUN_PROXY_CHILD_TEST.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 76 | def runChildConformance = env.RUN_CHILD_CFM ? env.RUN_CHILD_CFM.toBoolean() : false |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame^] | 77 | def runChildStacklightHa = env.RUN_STACKLIGHT_CHILD_HA ? env.RUN_STACKLIGHT_CHILD_HA.toBoolean() : false |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 78 | def runChildConformanceNetworkPolicy = env.RUN_CHILD_CFM_NETWORK_POLICY ? env.RUN_CHILD_CFM_NETWORK_POLICY.toBoolean() : false |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 79 | def runChildHPA = env.RUN_CHILD_HPA ? env.RUN_CHILD_HPA.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 80 | def fetchServiceBinaries = env.FETCH_BINARIES_FROM_UPSTREAM ? env.FETCH_BINARIES_FROM_UPSTREAM.toBoolean() : false |
Vladislav Naumov | 42b71dc | 2021-11-22 13:09:42 +0100 | [diff] [blame] | 81 | def equinixMetalV2ChildDiffMetro = env.EQUINIXMETALV2_CHILD_DIFF_METRO ? env.EQUINIXMETALV2_CHILD_DIFF_METRO.toBoolean() : false |
slalov | 13e579c | 2022-01-31 21:37:02 +0400 | [diff] [blame] | 82 | def runMaintenanceTest = env.RUN_MAINTENANCE_TEST ? env.RUN_MAINTENANCE_TEST.toBoolean() : false |
slalov | 0a4947a | 2022-06-09 15:44:35 +0400 | [diff] [blame] | 83 | def runContainerregistryTest = env.RUN_CONTAINER_REGISTRY_TEST ? env.RUN_CONTAINER_REGISTRY_TEST.toBoolean() : false |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 84 | def runMgmtDeleteMasterTest = env.RUN_MGMT_DELETE_MASTER_TEST ? env.RUN_MGMT_DELETE_MASTER_TEST.toBoolean() : false |
| 85 | def runRgnlDeleteMasterTest = env.RUN_RGNL_DELETE_MASTER_TEST ? env.RUN_RGNL_DELETE_MASTER_TEST.toBoolean() : false |
| 86 | def runChildDeleteMasterTest = env.RUN_CHILD_DELETE_MASTER_TEST ? env.RUN_CHILD_DELETE_MASTER_TEST.toBoolean() : false |
Mikhail Nikolaenko | 7e632cd | 2022-10-24 16:20:31 +0300 | [diff] [blame] | 87 | def runGracefulRebootTest = env.RUN_GRACEFUL_REBOOT_TEST ? env.RUN_GRACEFUL_REBOOT_TEST.toBoolean() : false |
Sergey Lalov | bc68d75 | 2022-11-08 13:40:53 +0400 | [diff] [blame] | 88 | def pauseForDebug = env.PAUSE_FOR_DEBUG ? env.PAUSE_FOR_DEBUG.toBoolean() : false |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 89 | def runChildMachineDeletionPolicyTest = env.RUN_CHILD_MACHINE_DELETION_POLICY_TEST ? env.RUN_CHILD_MACHINE_DELETION_POLICY_TEST.toBoolean() : false |
Sergey Lalov | d3e030e | 2023-03-16 14:32:47 +0400 | [diff] [blame] | 90 | def runChildCustomCertTest = env.RUN_CHILD_CUSTOM_CERT_TEST ? env.RUN_CHILD_CUSTOM_CERT_TEST.toBoolean() : false |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 91 | def runByoChildCustomCertTest = env.RUN_BYO_CHILD_CUSTOM_CERT_TEST ? env.RUN_BYO_CHILD_CUSTOM_CERT_TEST.toBoolean() : false |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 92 | def runMgmtCustomCacheCertTest = env.RUN_MGMT_CUSTOM_CACHE_CERT_TEST ? env.RUN_MGMT_CUSTOM_CACHE_CERT_TEST.toBoolean() : false |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 93 | def runMkeCustomCertTest = env.RUN_MKE_CUSTOM_CERT_TEST ? env.RUN_MKE_CUSTOM_CERT_TEST.toBoolean() : false |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 94 | def runCustomHostnames = env.RUN_CUSTOM_HOSTNAMES ? env.RUN_CUSTOM_HOSTNAMES.toBoolean() : false |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 95 | def slLatest = env.SL_LATEST ? env.SL_LATEST.toBoolean() : false |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 96 | // multiregion configuration from env variable: comma-separated string in form $mgmt_provider,$regional_provider |
| 97 | def multiregionalMappings = env.MULTIREGION_SETUP ? multiregionWorkflowParser(env.MULTIREGION_SETUP) : [ |
| 98 | enabled: false, |
| 99 | managementLocation: '', |
| 100 | regionLocation: '', |
| 101 | ] |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 102 | |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 103 | // proxy customization |
| 104 | def proxyConfig = [ |
Владислав Наумов | f8f23fa | 2021-04-01 16:57:52 +0200 | [diff] [blame] | 105 | mgmtOffline: env.OFFLINE_MGMT_CLUSTER ? env.OFFLINE_MGMT_CLUSTER.toBoolean() : false, |
| 106 | childOffline: env.OFFLINE_CHILD_CLUSTER ? env.OFFLINE_CHILD_CLUSTER.toBoolean() : false, |
Владислав Наумов | 257ea13 | 2021-04-14 14:44:13 +0200 | [diff] [blame] | 107 | childProxy: env.PROXY_CHILD_CLUSTER ? env.PROXY_CHILD_CLUSTER.toBoolean() : false, |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 108 | ] |
| 109 | |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 110 | // optional demo deployment customization |
Владислав Наумов | 905dd36 | 2020-06-08 16:37:01 +0200 | [diff] [blame] | 111 | def awsOnDemandDemo = env.ALLOW_AWS_ON_DEMAND ? env.ALLOW_AWS_ON_DEMAND.toBoolean() : false |
Владислав Наумов | e021b02 | 2021-05-06 11:26:38 +0200 | [diff] [blame] | 112 | def equinixOnDemandDemo = env.ALLOW_EQUINIX_ON_DEMAND ? env.ALLOW_EQUINIX_ON_DEMAND.toBoolean() : false |
Владислав Наумов | 82305e9 | 2021-10-14 20:45:20 +0200 | [diff] [blame] | 113 | def equinixMetalV2OnDemandDemo = env.ALLOW_EQUINIXMETALV2_ON_DEMAND ? env.ALLOW_EQUINIXMETALV2_ON_DEMAND.toBoolean() : false |
Владислав Наумов | f371580 | 2021-05-03 18:06:45 +0200 | [diff] [blame] | 114 | def equinixOnAwsDemo = env.EQUINIX_ON_AWS_DEMO ? env.EQUINIX_ON_AWS_DEMO.toBoolean() : false |
Владислав Наумов | 2d3db33 | 2021-06-15 15:19:19 +0200 | [diff] [blame] | 115 | def azureOnAwsDemo = env.AZURE_ON_AWS_DEMO ? env.AZURE_ON_AWS_DEMO.toBoolean() : false |
Владислав Наумов | c52dd9d | 2021-06-28 16:27:29 +0200 | [diff] [blame] | 116 | def azureOnDemandDemo = env.ALLOW_AZURE_ON_DEMAND ? env.ALLOW_AZURE_ON_DEMAND.toBoolean() : false |
Ivan Berezovskiy | f9bcfd6 | 2021-03-18 18:41:38 +0400 | [diff] [blame] | 117 | def enableVsphereDemo = true |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 118 | def enableOSDemo = true |
azvyagintsev | 1761bdc | 2020-09-04 17:24:12 +0300 | [diff] [blame] | 119 | def enableBMDemo = true |
Mikhail Ivanov | bd1a9fd | 2022-03-29 21:36:21 +0400 | [diff] [blame] | 120 | def enableArtifactsBuild = true |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 121 | def openstackIMC = env.OPENSTACK_CLOUD_LOCATION ? env.OPENSTACK_CLOUD_LOCATION : 'us' |
Alexandr Lovtsov | 36473f3 | 2022-04-28 15:46:09 +0300 | [diff] [blame] | 122 | def enableVsphereUbuntu = env.VSPHERE_DEPLOY_UBUNTU ? env.VSPHERE_DEPLOY_UBUNTU.toBoolean() : false |
Ivan Berezovskiy | 30c4b12 | 2023-11-06 18:03:18 +0500 | [diff] [blame] | 123 | def enableVsphereRHEL = env.VSPHERE_DEPLOY_RHEL ? env.VSPHERE_DEPLOY_RHEL.toBoolean() : false |
Sergey Zhemerdeev | e67fb26 | 2022-06-21 00:49:34 +0300 | [diff] [blame] | 124 | def childOsBootFromVolume = env.OPENSTACK_BOOT_FROM_VOLUME ? env.OPENSTACK_BOOT_FROM_VOLUME.toBoolean() : false |
Ivan Berezovskiy | 29e72b7 | 2022-07-12 21:03:24 +0400 | [diff] [blame] | 125 | def bootstrapV2Scenario = env.BOOTSTRAP_V2_ENABLED ? env.BOOTSTRAP_V2_ENABLED.toBoolean() : false |
Sergey Lalov | acec3c1 | 2022-07-20 16:00:14 +0400 | [diff] [blame] | 126 | def equinixMetalV2Metro = env.EQUINIX_MGMT_METRO ? env.EQUINIX_MGMT_METRO : '' |
Mikhail Ivanov | 3088d3d | 2022-10-24 14:05:46 +0400 | [diff] [blame] | 127 | def enableFips = env.ENABLE_FIPS ? env.ENABLE_FIPS.toBoolean() : false |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 128 | def enableMkeDebug = env.ENABLE_MKE_DEBUG ? env.ENABLE_MKE_DEBUG.toBoolean() : false |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 129 | def aioCluster = env.AIO_CLUSTER ? env.AIO_CLUSTER.toBoolean() : false |
Mikhail Morgoev | 58855c1 | 2023-02-10 14:57:31 +0100 | [diff] [blame] | 130 | def useVsphereVvmtObjects = env.VSPHERE_USE_VVMT_OBJECTS ? env.VSPHERE_USE_VVMT_OBJECTS.toBoolean() : false |
vryzhenkin | 4fd3f24 | 2023-03-29 15:13:46 +0400 | [diff] [blame] | 131 | def enableBv2Smoke = true |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 132 | def runCacheWarmup = env.CACHE_WARMUP_ENABLED ? env.CACHE_WARMUP_ENABLED.toBoolean() : false |
vryzhenkin | 211a4e8 | 2023-11-23 12:48:27 +0400 | [diff] [blame] | 133 | def cveScan = false |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 134 | |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 135 | def commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 136 | if (commitMsg ==~ /(?s).*\[mgmt-proxy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-proxy.*/) { |
| 137 | proxyConfig['mgmtOffline'] = true |
Владислав Наумов | 70c0242 | 2021-04-19 14:29:41 +0200 | [diff] [blame] | 138 | common.warningMsg('Forced running offline mgmt deployment, some provider CDN regions for mgmt deployment may be set to *public-ci* to verify proxy configuration') |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 139 | } |
Sergey Kolekonov | 5995dfd | 2023-07-06 16:09:43 +0600 | [diff] [blame] | 140 | if (commitMsg ==~ /(?s).*\[mgmt-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-upgrade.*/) { |
| 141 | upgradeMgmt = true |
| 142 | } |
| 143 | if (commitMsg ==~ /(?s).*\[auto-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*auto-upgrade.*/) { |
| 144 | autoUpgradeMgmt = true |
| 145 | } |
Владислав Наумов | 44c64b7 | 2020-12-04 20:22:53 +0100 | [diff] [blame] | 146 | if (commitMsg ==~ /(?s).*\[seed-macos\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*seed-macos.*/) { |
| 147 | seedMacOs = true |
| 148 | } |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 149 | if (commitMsg ==~ /(?s).*\[child-deploy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-deploy.*/ || |
| 150 | upgradeChild || runChildConformance || runProxyChildTest || runChildHPA || runChildConformanceNetworkPolicy) { |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 151 | deployChild = true |
| 152 | } |
| 153 | if (commitMsg ==~ /(?s).*\[child-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-upgrade.*/) { |
| 154 | deployChild = true |
| 155 | upgradeChild = true |
| 156 | } |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 157 | if (commitMsg ==~ /(?s).*\[child-upgrade-full\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-upgrade-full.*/) { |
| 158 | deployChild = true |
| 159 | upgradeChild = true |
Sergey Lalov | a048df9 | 2023-06-19 19:36:41 +0400 | [diff] [blame] | 160 | common.warningMsg("2-step child updates are not testing (PRODX-33510)") |
| 161 | //TODO: revert after start testing the two-step upgrade again (PRODX-33510) |
| 162 | //fullUpgradeChild = true |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 163 | } |
Sergey Kolekonov | 5995dfd | 2023-07-06 16:09:43 +0600 | [diff] [blame] | 164 | if ((upgradeMgmt || autoUpgradeMgmt) && deployChild) { |
| 165 | upgradeChild = true |
| 166 | common.warningMsg('child upgrade is automatically enabled as mgmt upgrade and child deploy are enabled') |
| 167 | } |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 168 | def childDeployMatches = (commitMsg =~ /(\[child-deploy\s*(\w|\-)+?\])/) |
| 169 | if (childDeployMatches.size() > 0) { |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 170 | // override child version when it set explicitly |
| 171 | deployChild = true |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 172 | customChildRelease = childDeployMatches[0][0].split('child-deploy')[1].replaceAll('[\\[\\]]', '').trim() |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 173 | common.warningMsg("Forced child deployment using custom release version ${customChildRelease}") |
| 174 | } |
Mikhail Ivanov | 38ee438 | 2022-01-27 16:21:51 +0400 | [diff] [blame] | 175 | if (commitMsg ==~ /(?s).*\[mos-child-deploy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mos-child-deploy.*/) { |
| 176 | mosDeployChild = true |
| 177 | } |
| 178 | if (commitMsg ==~ /(?s).*\[mos-child-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mos-child-upgrade.*/) { |
| 179 | mosDeployChild = true |
| 180 | mosUpgradeChild = true |
| 181 | } |
Sergey Kolekonov | 5995dfd | 2023-07-06 16:09:43 +0600 | [diff] [blame] | 182 | if ((upgradeMgmt || autoUpgradeMgmt) && mosDeployChild) { |
| 183 | mosUpgradeChild = true |
| 184 | common.warningMsg('MOSK child upgrade is automatically enabled as mgmt upgrade and MOSK child deploy are enabled') |
| 185 | } |
Владислав Наумов | 0dc9925 | 2020-11-13 13:30:48 +0100 | [diff] [blame] | 186 | if (commitMsg ==~ /(?s).*\[byo-attach\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*byo-attach.*/) { |
| 187 | attachBYO = true |
| 188 | } |
Владислав Наумов | cdbd84e | 2020-12-01 16:51:09 +0100 | [diff] [blame] | 189 | if (commitMsg ==~ /(?s).*\[byo-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*byo-upgrade.*/) { |
| 190 | attachBYO = true |
| 191 | upgradeBYO = true |
| 192 | } |
Sergey Lalov | acec3c1 | 2022-07-20 16:00:14 +0400 | [diff] [blame] | 193 | if (commitMsg ==~ /(?s).*\[ui-test-on-all-providers\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*ui-test-on-all-providers.*/) { |
| 194 | enableVsphereDemo = true |
| 195 | enableOSDemo = true |
| 196 | awsOnDemandDemo = true |
| 197 | azureOnDemandDemo = true |
| 198 | equinixOnDemandDemo = true |
| 199 | equinixMetalV2OnDemandDemo = true |
| 200 | runUie2e = true |
Sergey Lalov | acec3c1 | 2022-07-20 16:00:14 +0400 | [diff] [blame] | 201 | // Edit after fix PRODX-3961 |
| 202 | enableBMDemo = false |
| 203 | } |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 204 | def byoDeployMatches = (commitMsg =~ /(\[run-byo-matrix\s*(ubuntu|centos)\])/) |
| 205 | if (commitMsg ==~ /(?s).*\[run-byo-matrix\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*run-byo-matrix\.*/ || byoDeployMatches.size() > 0) { |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 206 | runBYOMatrix = true |
| 207 | |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 208 | if (byoDeployMatches.size() > 0) { |
| 209 | defaultBYOOs = byoDeployMatches[0][2] |
| 210 | common.warningMsg("Custom BYO OS detected, using ${defaultBYOOs}") |
| 211 | } |
| 212 | |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 213 | common.warningMsg('Forced byo matrix test via run-byo-matrix, all other byo triggers will be skipped') |
| 214 | attachBYO = false |
| 215 | upgradeBYO = false |
| 216 | } |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 217 | if (commitMsg ==~ /(?s).*\[lma-logging\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*lma-logging.*/) { |
| 218 | enableLMALogging = true |
| 219 | } |
Sergey Lalov | b2f6037 | 2022-09-20 23:58:47 +0400 | [diff] [blame] | 220 | if (commitMsg ==~ /(?s).*\[deploy-os-on-mos\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*deploy-os-on-mos.*/) { |
| 221 | deployOsOnMos = true |
| 222 | mosDeployChild = true |
| 223 | openstackIMC = 'eu2' |
| 224 | } |
Sergey Lalov | 9504060 | 2023-03-07 16:42:16 +0400 | [diff] [blame] | 225 | if (commitMsg ==~ /(?s).*\[ui-e2e-nw\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*ui-e2e-nw.*/) { |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 226 | runUie2e = true |
| 227 | } |
Sergey Lalov | 9504060 | 2023-03-07 16:42:16 +0400 | [diff] [blame] | 228 | if (commitMsg ==~ /(?s).*\[ui-e2e-pw\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*ui-e2e-pw.*/) { |
Mikhail Ivanov | f5e20af | 2022-03-24 15:38:06 +0400 | [diff] [blame] | 229 | runUie2eNew = true |
| 230 | } |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 231 | if (commitMsg ==~ /(?s).*\[mgmt-cfm\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-cfm.*/) { |
| 232 | runMgmtConformance = true |
| 233 | } |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 234 | if (commitMsg ==~ /(?s).*\[mgmt-cfm-netpolicy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-cfm-netpolicy.*/) { |
| 235 | runMgmtConformanceNetworkPolicy = true |
| 236 | } |
Vladyslav Drok | c4f9c1b | 2021-07-22 15:34:24 +0200 | [diff] [blame] | 237 | if (commitMsg ==~ /(?s).*\[test-user-controller\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*test-user-controller.*/) { |
| 238 | runMgmtUserControllerTest = true |
| 239 | } |
slalov | 574123e | 2022-04-06 17:24:19 +0400 | [diff] [blame] | 240 | if (commitMsg ==~ /(?s).*\[test-proxy-child\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*test-proxy-child.*/) { |
| 241 | runProxyChildTest = true |
| 242 | deployChild = true |
| 243 | common.infoMsg('Child cluster deployment will be enabled since proxy child test suite will be executed') |
| 244 | } |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 245 | if (commitMsg ==~ /(?s).*\[child-cfm\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-cfm.*/) { |
| 246 | runChildConformance = true |
| 247 | deployChild = true |
| 248 | } |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 249 | if (commitMsg ==~ /(?s).*\[child-cfm-netpolicy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-cfm-netpolicy.*/) { |
| 250 | runChildConformanceNetworkPolicy = true |
| 251 | deployChild = true |
| 252 | } |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 253 | if (commitMsg ==~ /(?s).*\[child-hpa\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-hpa.*/) { |
| 254 | runChildHPA = true |
| 255 | deployChild = true |
| 256 | } |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame^] | 257 | if (commitMsg ==~ /(?s).*\[child-sl-ha\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-sl-ha.*/) { |
| 258 | runChildStacklightHa = true |
| 259 | deployChild = true |
| 260 | } |
Владислав Наумов | 9cec55d | 2021-08-03 15:00:59 +0200 | [diff] [blame] | 261 | if (commitMsg ==~ /(?s).*\[lma-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*lma-test.*/) { |
| 262 | runLMATest = true |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 263 | enableLMALogging = true |
| 264 | common.infoMsg('LMA logging will be enabled since LMA test suite will be executed') |
Victor Ryzhenkin | 1520659 | 2021-06-21 17:38:23 +0400 | [diff] [blame] | 265 | } |
slalov | 13e579c | 2022-01-31 21:37:02 +0400 | [diff] [blame] | 266 | if (commitMsg ==~ /(?s).*\[maintenance-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*maintenance-test.*/) { |
| 267 | runMaintenanceTest = true |
| 268 | } |
slalov | 0a4947a | 2022-06-09 15:44:35 +0400 | [diff] [blame] | 269 | if (commitMsg ==~ /(?s).*\[container-registry-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*container-registry-test.*/) { |
| 270 | runContainerregistryTest = true |
| 271 | } |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 272 | if (commitMsg ==~ /(?s).*\[mgmt-delete-master-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-delete-master-test.*/) { |
| 273 | runMgmtDeleteMasterTest = true |
| 274 | } |
| 275 | if (commitMsg ==~ /(?s).*\[rgnl-delete-master-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*rgnl-delete-master-test.*/) { |
| 276 | runRgnlDeleteMasterTest = true |
| 277 | } |
| 278 | if (commitMsg ==~ /(?s).*\[child-delete-master-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-delete-master-test.*/) { |
Sergey Lalov | 47e2159 | 2023-07-18 23:36:32 +0400 | [diff] [blame] | 279 | if (!mosDeployChild) { |
| 280 | deployChild = true |
| 281 | } |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 282 | runChildDeleteMasterTest = true |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 283 | common.infoMsg('Child cluster deployment will be enabled since delete child master node test suite will be executed') |
| 284 | } |
| 285 | if (commitMsg ==~ /(?s).*\[child-machine-deletion-policy-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-machine-deletion-policy-test.*/) { |
| 286 | runChildMachineDeletionPolicyTest = true |
| 287 | deployChild = true |
| 288 | common.infoMsg('Child cluster deployment will be enabled since machine deletion child policy test suite will be executed') |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 289 | } |
Mikhail Nikolaenko | 7e632cd | 2022-10-24 16:20:31 +0300 | [diff] [blame] | 290 | if (commitMsg ==~ /(?s).*\[graceful-reboot-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*graceful-reboot-test.*/) { |
| 291 | runGracefulRebootTest = true |
| 292 | } |
Sergey Lalov | bc68d75 | 2022-11-08 13:40:53 +0400 | [diff] [blame] | 293 | if (commitMsg ==~ /(?s).*\[pause-for-debug\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*pause-for-debug.*/) { |
| 294 | pauseForDebug = true |
| 295 | } |
Владислав Наумов | f8f23fa | 2021-04-01 16:57:52 +0200 | [diff] [blame] | 296 | if (commitMsg ==~ /(?s).*\[child-offline\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-offline.*/) { |
| 297 | proxyConfig['childOffline'] = true |
| 298 | deployChild = true |
| 299 | } |
Владислав Наумов | 257ea13 | 2021-04-14 14:44:13 +0200 | [diff] [blame] | 300 | if (commitMsg ==~ /(?s).*\[child-proxy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-proxy.*/) { |
| 301 | proxyConfig['childOffline'] = true |
| 302 | proxyConfig['childProxy'] = true |
| 303 | deployChild = true |
| 304 | } |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 305 | if (commitMsg ==~ /(?s).*\[fetch.*binaries\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*fetch.*binaries.*/) { |
| 306 | fetchServiceBinaries = true |
| 307 | } |
Владислав Наумов | f1665b5 | 2021-05-13 10:51:17 +0200 | [diff] [blame] | 308 | if (commitMsg ==~ /(?s).*\[equinix-on-aws\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*equinix-on-aws.*/) { |
eromanova | df247c3 | 2020-12-25 15:44:13 +0400 | [diff] [blame] | 309 | equinixOnAwsDemo = true |
Владислав Наумов | f1665b5 | 2021-05-13 10:51:17 +0200 | [diff] [blame] | 310 | common.warningMsg('Forced running child cluster deployment on EQUINIX METAL provider based on AWS management cluster, triggered on patchset using custom keyword: \'[equinix-on-aws]\' ') |
eromanova | df247c3 | 2020-12-25 15:44:13 +0400 | [diff] [blame] | 311 | } |
Владислав Наумов | 2d3db33 | 2021-06-15 15:19:19 +0200 | [diff] [blame] | 312 | if (commitMsg ==~ /(?s).*\[azure-on-aws\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*azure-on-aws.*/) { |
| 313 | azureOnAwsDemo = true |
| 314 | common.warningMsg('Forced running child cluster deployment on Azure provider based on AWS management cluster, triggered on patchset using custom keyword: \'[azure-on-aws]\' ') |
| 315 | } |
| 316 | if (commitMsg ==~ /(?s).*\[aws-demo\].*/ || |
| 317 | env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*aws-demo.*/ || |
| 318 | attachBYO || |
| 319 | upgradeBYO || |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 320 | runBYOMatrix || |
Владислав Наумов | 2d3db33 | 2021-06-15 15:19:19 +0200 | [diff] [blame] | 321 | seedMacOs || |
| 322 | equinixOnAwsDemo || |
| 323 | azureOnAwsDemo) { |
| 324 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 325 | awsOnDemandDemo = true |
Владислав Наумов | 2d3db33 | 2021-06-15 15:19:19 +0200 | [diff] [blame] | 326 | common.warningMsg('Running additional kaas deployment with AWS provider, may be forced due applied trigger cross dependencies, follow docs to clarify info') |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 327 | } |
Владислав Наумов | f1665b5 | 2021-05-13 10:51:17 +0200 | [diff] [blame] | 328 | if (commitMsg ==~ /(?s).*\[equinix-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*equinix-demo\.*/) { |
Владислав Наумов | e021b02 | 2021-05-06 11:26:38 +0200 | [diff] [blame] | 329 | equinixOnDemandDemo = true |
| 330 | } |
Владислав Наумов | 82305e9 | 2021-10-14 20:45:20 +0200 | [diff] [blame] | 331 | if (commitMsg ==~ /(?s).*\[equinixmetalv2-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*equinixmetalv2-demo\.*/) { |
Владислав Наумов | 144956f | 2021-10-14 17:49:19 +0200 | [diff] [blame] | 332 | equinixMetalV2OnDemandDemo = true |
| 333 | } |
Vladislav Naumov | 42b71dc | 2021-11-22 13:09:42 +0100 | [diff] [blame] | 334 | if (commitMsg ==~ /(?s).*\[equinixmetalv2-child-diff-metro\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*equinixmetalv2-child-diff-metro\.*/) { |
| 335 | equinixMetalV2OnDemandDemo = true |
| 336 | equinixMetalV2ChildDiffMetro = true |
| 337 | } |
Владислав Наумов | c52dd9d | 2021-06-28 16:27:29 +0200 | [diff] [blame] | 338 | if (commitMsg ==~ /(?s).*\[azure-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*azure-demo\.*/) { |
| 339 | azureOnDemandDemo = true |
| 340 | } |
Sergey Lalov | 10cb350 | 2023-03-27 22:13:49 +0400 | [diff] [blame] | 341 | if (commitMsg ==~ /(?s).*\[disable-all-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-all-demo\.*/) { |
| 342 | enableVsphereDemo = false |
| 343 | enableOSDemo = false |
| 344 | enableBMDemo = false |
Sergey Lalov | 781fccc | 2023-10-12 21:55:17 +0400 | [diff] [blame] | 345 | enableBv2Smoke = false |
| 346 | common.errorMsg('vSphere, BM, Openstack, demo deployments and Bootstrap v2 smoke checks will be aborted, VF -1 will be set') |
Sergey Lalov | 10cb350 | 2023-03-27 22:13:49 +0400 | [diff] [blame] | 347 | } |
| 348 | |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 349 | if (commitMsg ==~ /(?s).*\[disable-os-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-os-demo\.*/) { |
| 350 | enableOSDemo = false |
| 351 | common.errorMsg('Openstack demo deployment will be aborted, VF -1 will be set') |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 352 | } |
| 353 | |
azvyagintsev | 1761bdc | 2020-09-04 17:24:12 +0300 | [diff] [blame] | 354 | if (commitMsg ==~ /(?s).*\[disable-bm-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-bm-demo\.*/) { |
| 355 | enableBMDemo = false |
| 356 | common.errorMsg('BM demo deployment will be aborted, VF -1 will be set') |
| 357 | } |
| 358 | |
Ivan Berezovskiy | f9bcfd6 | 2021-03-18 18:41:38 +0400 | [diff] [blame] | 359 | if (commitMsg ==~ /(?s).*\[disable-vsphere-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-vsphere-demo\.*/) { |
| 360 | enableVsphereDemo = false |
| 361 | common.errorMsg('vSphere demo deployment will be aborted, VF -1 will be set') |
| 362 | } |
Alexandr Lovtsov | 36473f3 | 2022-04-28 15:46:09 +0300 | [diff] [blame] | 363 | if (commitMsg ==~ /(?s).*\[vsphere-ubuntu\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*vsphere-ubuntu\.*/) { |
| 364 | enableVsphereUbuntu = true |
| 365 | common.warningMsg('Ubuntu will be used to deploy vsphere machines') |
| 366 | } |
Ivan Berezovskiy | 30c4b12 | 2023-11-06 18:03:18 +0500 | [diff] [blame] | 367 | if (commitMsg ==~ /(?s).*\[vsphere-rhel\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*vsphere-rhel\.*/) { |
| 368 | enableVsphereRHEL = true |
| 369 | common.warningMsg('RHEL will be used to deploy vsphere machines') |
| 370 | } |
vryzhenkin | 4fd3f24 | 2023-03-29 15:13:46 +0400 | [diff] [blame] | 371 | if (commitMsg ==~ /(?s).*\[disable-bv2-smoke\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-bv2-smoke\.*/) { |
| 372 | enableBv2Smoke = false |
| 373 | common.errorMsg('Bootstrap v2 smoke checks will be aborted, WF -1 will be set') |
| 374 | } |
Ivan Berezovskiy | f9bcfd6 | 2021-03-18 18:41:38 +0400 | [diff] [blame] | 375 | |
vryzhenkin | 211a4e8 | 2023-11-23 12:48:27 +0400 | [diff] [blame] | 376 | if (commitMsg ==~ /(?s).*\[cve-scan\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*cve-scan\.*/) { |
| 377 | cveScan = true |
| 378 | common.errorMsg('CVE Scan job enabled') |
| 379 | } |
| 380 | |
Mikhail Ivanov | bd1a9fd | 2022-03-29 21:36:21 +0400 | [diff] [blame] | 381 | if (commitMsg ==~ /(?s).*\[disable-artifacts-build\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-artifacts-build\.*/) { |
| 382 | enableArtifactsBuild = false |
| 383 | common.errorMsg('artifacts build will be aborted, VF -1 will be set') |
| 384 | } |
| 385 | |
Sergey Zhemerdeev | e67fb26 | 2022-06-21 00:49:34 +0300 | [diff] [blame] | 386 | if (commitMsg ==~ /(?s).*\[child-os-boot-from-volume\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-os-boot-from-volume\.*/) { |
| 387 | childOsBootFromVolume = true |
| 388 | common.warningMsg('OS will be booted from Ceph volumes') |
| 389 | } |
| 390 | |
Sergey Lalov | d5efcd5 | 2023-03-01 22:42:17 +0400 | [diff] [blame] | 391 | if (commitMsg ==~ /(?s).*\[child-custom-cert-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-custom-cert-test\.*/) { |
| 392 | runChildCustomCertTest = true |
| 393 | deployChild = true |
| 394 | common.warningMsg('Child cluster deployment will be enabled since custom cert child test suite will be executed') |
| 395 | } |
| 396 | |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 397 | if (commitMsg ==~ /(?s).*\[mgmt-custom-cache-cert-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-custom-cache-cert-test\.*/) { |
| 398 | runMgmtCustomCacheCertTest = true |
| 399 | deployChild = true |
| 400 | common.warningMsg('Child cluster deployment will be enabled as the test replaces the mgmt and cluster childcertificates') |
| 401 | } |
| 402 | |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 403 | if (commitMsg ==~ /(?s).*\[mke-custom-cert-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mke-custom-cert-test\.*/) { |
| 404 | runMkeCustomCertTest = true |
| 405 | } |
| 406 | |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 407 | if (commitMsg ==~ /(?s).*\[custom-hostnames\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*custom-hostnames\.*/) { |
| 408 | runCustomHostnames = true |
| 409 | common.warningMsg('All clusters will be deployed with Custom Hostnames') |
| 410 | } |
| 411 | |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 412 | if (commitMsg ==~ /(?s).*\[sl-latest\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*sl-latest\.*/) { |
| 413 | slLatest = true |
| 414 | common.warningMsg('All clusters will be deployed with Stacklight version from artifact-metadata') |
| 415 | } |
| 416 | |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 417 | if (commitMsg ==~ /(?s).*\[byo-child-custom-cert-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*byo-child-custom-cert-test\.*/) { |
| 418 | runByoChildCustomCertTest = true |
| 419 | attachBYO = true |
| 420 | common.warningMsg('Byo child cluster deployment will be enabled since custom cert child test suite will be executed') |
| 421 | } |
| 422 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 423 | // TODO (vnaumov) remove below condition after moving all releases to UCP |
| 424 | def ucpChildMatches = (commitMsg =~ /(\[child-ucp\s*ucp-.*?\])/) |
| 425 | if (ucpChildMatches.size() > 0) { |
| 426 | deployChild = true |
| 427 | common.warningMsg('Forced UCP based child deployment triggered on patchset using custom keyword: \'[child-ucp ucp-5-1-0-3-3-0-example]\' ') |
| 428 | |
| 429 | // TODO(vnaumov) delete after ucp upgrades support |
| 430 | common.errorMsg('Child upgrade test will be skipped, UCP upgrades temporally disabled') |
| 431 | upgradeChild = false |
| 432 | } |
| 433 | |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 434 | if (commitMsg ==~ /(?s).*\[aio-cluster\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*aio-cluster.*/) { |
| 435 | aioCluster = true |
| 436 | } |
| 437 | |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 438 | if (commitMsg ==~ /(?s).*\[cache-warmup\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*cache-warmup.*/) { |
| 439 | runCacheWarmup = true |
| 440 | } |
| 441 | |
| 442 | if (runCacheWarmup && (!deployChild && !mosDeployChild)) { |
| 443 | runCacheWarmup = false |
| 444 | common.errorMsg('Child cluster deployment is not enabled, skipping Cache Warmup') |
| 445 | } |
| 446 | |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 447 | // multiregional tests |
| 448 | def multiRegionalMatches = (commitMsg =~ /(\[multiregion\s*.*?\])/) |
| 449 | if (multiRegionalMatches.size() > 0) { |
| 450 | multiregionalMappings = multiregionWorkflowParser(multiRegionalMatches) |
| 451 | } |
| 452 | switch (multiregionalMappings['managementLocation']) { |
| 453 | case 'aws': |
Владислав Наумов | 53b07e5 | 2021-01-07 15:08:27 +0100 | [diff] [blame] | 454 | common.warningMsg('Forced running additional kaas deployment with AWS provider according multiregional demo request') |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 455 | awsOnDemandDemo = true |
Владислав Наумов | 53b07e5 | 2021-01-07 15:08:27 +0100 | [diff] [blame] | 456 | |
| 457 | if (multiregionalMappings['regionLocation'] != 'aws' && seedMacOs) { // macstadium seed node has access only to *public* providers |
| 458 | error('incompatible triggers: [seed-macos] and multiregional deployment based on *private* regional provider cannot be applied simultaneously') |
| 459 | } |
Владислав Наумов | 3e4b5a3 | 2020-09-11 17:05:34 +0200 | [diff] [blame] | 460 | break |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 461 | case 'os': |
| 462 | if (enableOSDemo == false) { |
| 463 | error('incompatible triggers: [disable-os-demo] and multiregional deployment based on OSt management region cannot be applied simultaneously') |
| 464 | } |
Владислав Наумов | 3e4b5a3 | 2020-09-11 17:05:34 +0200 | [diff] [blame] | 465 | break |
Владислав Наумов | 865ba6c | 2021-05-13 13:05:45 +0200 | [diff] [blame] | 466 | case 'vsphere': |
| 467 | if (enableVsphereDemo == false) { |
| 468 | error('incompatible triggers: [disable-vsphere-demo] and multiregional deployment based on Vsphere management region cannot be applied simultaneously') |
| 469 | } |
| 470 | break |
Владислав Наумов | 5be0294 | 2021-05-13 12:34:37 +0200 | [diff] [blame] | 471 | case 'equinix': |
| 472 | common.warningMsg('Forced running additional kaas deployment with Equinix provider according multiregional demo request') |
| 473 | equinixOnDemandDemo = true |
eromanova | 3535916 | 2021-12-30 14:13:13 +0400 | [diff] [blame] | 474 | break |
eromanova | 8c702ae | 2021-12-24 17:43:12 +0400 | [diff] [blame] | 475 | case 'equinixmetalv2': |
| 476 | common.warningMsg('Forced running additional kaas deployment with Equinix Metal V2 provider according multiregional demo request') |
| 477 | equinixMetalV2OnDemandDemo = true |
eromanova | 3535916 | 2021-12-30 14:13:13 +0400 | [diff] [blame] | 478 | break |
slalov | fd0b7e6 | 2021-07-28 18:05:16 +0400 | [diff] [blame] | 479 | case 'azure': |
| 480 | common.warningMsg('Forced running additional kaas deployment with Azure provider according multiregional demo request') |
| 481 | azureOnDemandDemo = true |
| 482 | break |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 483 | } |
| 484 | |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 485 | // CDN configuration |
| 486 | def cdnConfig = [ |
| 487 | mgmt: [ |
Sergey Lalov | de909ea | 2023-05-31 20:21:02 +0400 | [diff] [blame] | 488 | openstack: 'internal-ci', |
Владислав Наумов | 70c0242 | 2021-04-19 14:29:41 +0200 | [diff] [blame] | 489 | vsphere: 'internal-ci', |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 490 | aws: 'public-ci', |
Владислав Наумов | e021b02 | 2021-05-06 11:26:38 +0200 | [diff] [blame] | 491 | equinix: 'public-ci', |
Владислав Наумов | c52dd9d | 2021-06-28 16:27:29 +0200 | [diff] [blame] | 492 | azure: 'public-ci', |
Владислав Наумов | f8f23fa | 2021-04-01 16:57:52 +0200 | [diff] [blame] | 493 | ], |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 494 | ] |
| 495 | |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 496 | if (commitMsg ==~ /(?s).*\[eu-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*eu-demo.*/) { |
| 497 | openstackIMC = 'eu' |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 498 | } |
slalov | 021171f | 2022-03-04 14:48:38 +0400 | [diff] [blame] | 499 | if (commitMsg ==~ /(?s).*\[mos-tf-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mos-tf-demo.*/) { |
| 500 | openstackIMC = 'eu2' |
Mikhail Ivanov | f05b825 | 2022-04-27 18:14:03 +0400 | [diff] [blame] | 501 | } |
| 502 | if (openstackIMC == 'eu' || openstackIMC == 'eu2') { |
slalov | 021171f | 2022-03-04 14:48:38 +0400 | [diff] [blame] | 503 | // use internal-eu because on internal-ci with eu cloud image pull takes much time |
Sergey Lalov | de909ea | 2023-05-31 20:21:02 +0400 | [diff] [blame] | 504 | def cdnRegion = 'internal-eu' |
slalov | 021171f | 2022-03-04 14:48:38 +0400 | [diff] [blame] | 505 | common.infoMsg("eu2-demo was triggered, force switching CDN region to ${cdnRegion}") |
| 506 | cdnConfig['mgmt']['openstack'] = cdnRegion |
| 507 | } |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 508 | |
Владислав Наумов | 74e2d6e | 2020-12-30 17:05:40 +0100 | [diff] [blame] | 509 | // calculate weight of current demo run to manage lockable resources |
Sergey Lalov | 46deb44 | 2022-08-18 12:11:03 +0400 | [diff] [blame] | 510 | def demoWeight = deployChild ? 2 : 1 // management = 1, child += 1 |
Sergey Lalov | 9504060 | 2023-03-07 16:42:16 +0400 | [diff] [blame] | 511 | if (runUie2e || runUie2eNew) { |
Sergey Lalov | 46deb44 | 2022-08-18 12:11:03 +0400 | [diff] [blame] | 512 | demoWeight += 1 |
| 513 | } |
Владислав Наумов | 74e2d6e | 2020-12-30 17:05:40 +0100 | [diff] [blame] | 514 | |
Sergey Lalov | eb611b2 | 2023-09-22 16:59:09 +0400 | [diff] [blame] | 515 | if (commitMsg ==~ /(?s).*\[bootstrapv1-scenario\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*bootstrapv1-scenario\.*/) { |
| 516 | bootstrapV2Scenario = false |
| 517 | } |
| 518 | |
Ivan Berezovskiy | 29e72b7 | 2022-07-12 21:03:24 +0400 | [diff] [blame] | 519 | if (commitMsg ==~ /(?s).*\[bootstrapv2-scenario\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*bootstrapv2-scenario\.*/) { |
| 520 | bootstrapV2Scenario = true |
| 521 | } |
| 522 | |
Mikhail Ivanov | 3088d3d | 2022-10-24 14:05:46 +0400 | [diff] [blame] | 523 | if (commitMsg ==~ /(?s).*\[enable-fips\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*enable-fips\.*/) { |
| 524 | enableFips = true |
| 525 | } |
| 526 | |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 527 | if (commitMsg ==~ /(?s).*\[enable-mke-debug\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*enable-mke-debug\.*/) { |
| 528 | enableMkeDebug = true |
| 529 | } |
| 530 | |
Mikhail Morgoev | 58855c1 | 2023-02-10 14:57:31 +0100 | [diff] [blame] | 531 | if (commitMsg ==~ /(?s).*\[vsphere-vvmt-obj\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*vsphere-vvmt-obj\.*/) { |
| 532 | useVsphereVvmtObjects = true |
| 533 | } |
| 534 | |
Sergey Zhemerdeev | dd31ce9 | 2022-07-19 14:15:22 +0300 | [diff] [blame] | 535 | // parse equinixmetalv2-metro trigger |
Sergey Zhemerdeev | dd31ce9 | 2022-07-19 14:15:22 +0300 | [diff] [blame] | 536 | def equinixMetalV2MetroMatcher = (commitMsg =~ /\[equinixmetalv2-metro(\s+.*)?\]/) |
| 537 | if (equinixMetalV2OnDemandDemo && equinixMetalV2MetroMatcher.size() > 0) { |
Sergey Zhemerdeev | cc785e4 | 2022-07-22 17:15:47 +0300 | [diff] [blame] | 538 | equinixMetalV2Metro = equinixMetalV2MetroMatcher[0][1].trim().toLowerCase() |
Sergey Zhemerdeev | dd31ce9 | 2022-07-19 14:15:22 +0300 | [diff] [blame] | 539 | common.infoMsg("Forced Equnix mgmt deployment using custom metro ${equinixMetalV2Metro}") |
| 540 | } |
| 541 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 542 | common.infoMsg(""" |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 543 | OpenStack Cloud location: ${openstackIMC} |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 544 | CDN deployment configuration: ${cdnConfig} |
| 545 | MCC offline deployment configuration: ${proxyConfig} |
Владислав Наумов | 44c64b7 | 2020-12-04 20:22:53 +0100 | [diff] [blame] | 546 | Use MacOS node as seed: ${seedMacOs} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 547 | Child cluster deployment scheduled: ${deployChild} |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 548 | Custom child cluster release: ${customChildRelease} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 549 | Child cluster release upgrade scheduled: ${upgradeChild} |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 550 | Full Child cluster release upgrade scheduled: ${fullUpgradeChild} |
Mikhail Ivanov | 38ee438 | 2022-01-27 16:21:51 +0400 | [diff] [blame] | 551 | MOS child deploy scheduled: ${mosDeployChild} |
| 552 | MOS child upgrade scheduled: ${mosUpgradeChild} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 553 | Child conformance testing scheduled: ${runChildConformance} |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 554 | Child conformance network policy testing scheduled: ${runChildConformanceNetworkPolicy} |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 555 | Child HPA testing scheduled: ${runChildHPA} |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame^] | 556 | Child Stacklight HA: ${runChildStacklightHa} |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 557 | Single BYO cluster attachment scheduled: ${attachBYO} |
| 558 | Single Attached BYO cluster upgrade test scheduled: ${upgradeBYO} |
| 559 | BYO test matrix whole suite scheduled: ${runBYOMatrix} |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 560 | Default BYO OS: ${defaultBYOOs} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 561 | Mgmt cluster release upgrade scheduled: ${upgradeMgmt} |
slalov | 1202bba | 2022-04-20 22:31:07 +0400 | [diff] [blame] | 562 | Mgmt cluster release auto upgrade scheduled: ${autoUpgradeMgmt} |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 563 | Mgmt LMA logging enabled: ${enableLMALogging} |
Sergey Lalov | b2f6037 | 2022-09-20 23:58:47 +0400 | [diff] [blame] | 564 | Deploy Os on child with mos release ${deployOsOnMos} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 565 | Mgmt conformance testing scheduled: ${runMgmtConformance} |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 566 | Mgmt conformance network policy testing scheduled: ${runMgmtConformanceNetworkPolicy} |
Владислав Наумов | 9cec55d | 2021-08-03 15:00:59 +0200 | [diff] [blame] | 567 | LMA testing scheduled: ${runLMATest} |
Vladyslav Drok | c4f9c1b | 2021-07-22 15:34:24 +0200 | [diff] [blame] | 568 | Mgmt user controller testing scheduled: ${runMgmtUserControllerTest} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 569 | Mgmt UI e2e testing scheduled: ${runUie2e} |
Mikhail Ivanov | f5e20af | 2022-03-24 15:38:06 +0400 | [diff] [blame] | 570 | Mgmt UI e2e playwrite testing scheduled: ${runUie2eNew} |
slalov | 13e579c | 2022-01-31 21:37:02 +0400 | [diff] [blame] | 571 | Maintenance test: ${runMaintenanceTest} |
slalov | 0a4947a | 2022-06-09 15:44:35 +0400 | [diff] [blame] | 572 | Container Registry test: ${runContainerregistryTest} |
slalov | 574123e | 2022-04-06 17:24:19 +0400 | [diff] [blame] | 573 | Child proxy test: ${runProxyChildTest} |
Mikhail Nikolaenko | 7e632cd | 2022-10-24 16:20:31 +0300 | [diff] [blame] | 574 | Graceful reboot test: ${runGracefulRebootTest} |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 575 | Delete mgmt master node test: ${runMgmtDeleteMasterTest} |
| 576 | Delete rgnl master node test: ${runRgnlDeleteMasterTest} |
| 577 | Delete child master node test: ${runChildDeleteMasterTest} |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 578 | Child machine deletion policy test: ${runChildMachineDeletionPolicyTest} |
Sergey Lalov | d5efcd5 | 2023-03-01 22:42:17 +0400 | [diff] [blame] | 579 | Custom cert test for child clusters: ${runChildCustomCertTest} |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 580 | Custom cert test for Byo child clusters: ${runByoChildCustomCertTest} |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 581 | Custom cache cert test for mgmt and child clusters: ${runMgmtCustomCacheCertTest} |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 582 | MKE custom cert test for mgmt/region: ${runMkeCustomCertTest} |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 583 | Custom hostnames for all clisuers: ${runCustomHostnames} |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 584 | Stacklight templates enchanced with latest version from artifact-metadata: ${slLatest} |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 585 | AWS provider deployment scheduled: ${awsOnDemandDemo} |
Владислав Наумов | e021b02 | 2021-05-06 11:26:38 +0200 | [diff] [blame] | 586 | Equinix provider deployment scheduled: ${equinixOnDemandDemo} |
Владислав Наумов | 144956f | 2021-10-14 17:49:19 +0200 | [diff] [blame] | 587 | EquinixmetalV2 provider deployment scheduled: ${equinixMetalV2OnDemandDemo} |
Vladislav Naumov | 42b71dc | 2021-11-22 13:09:42 +0100 | [diff] [blame] | 588 | EquinixmetalV2 child deploy in a separate metro scheduled: ${equinixMetalV2ChildDiffMetro} |
Sergey Zhemerdeev | 019c45a | 2022-08-13 00:09:07 +0300 | [diff] [blame] | 589 | EquinixmetalV2 mgmt will be deployed on the metro: ${equinixMetalV2Metro?:'auto'} |
Владислав Наумов | f1665b5 | 2021-05-13 10:51:17 +0200 | [diff] [blame] | 590 | Equinix@AWS child cluster deployment scheduled: ${equinixOnAwsDemo} |
Владислав Наумов | c52dd9d | 2021-06-28 16:27:29 +0200 | [diff] [blame] | 591 | Azure provider deployment scheduled: ${azureOnDemandDemo} |
Владислав Наумов | 2d3db33 | 2021-06-15 15:19:19 +0200 | [diff] [blame] | 592 | Azure@AWS child cluster deployment scheduled: ${azureOnAwsDemo} |
Ivan Berezovskiy | f9bcfd6 | 2021-03-18 18:41:38 +0400 | [diff] [blame] | 593 | VSPHERE provider deployment scheduled: ${enableVsphereDemo} |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 594 | OS provider deployment scheduled: ${enableOSDemo} |
azvyagintsev | 1761bdc | 2020-09-04 17:24:12 +0300 | [diff] [blame] | 595 | BM provider deployment scheduled: ${enableBMDemo} |
Alexandr Lovtsov | 36473f3 | 2022-04-28 15:46:09 +0300 | [diff] [blame] | 596 | Ubuntu on vSphere scheduled: ${enableVsphereUbuntu} |
Ivan Berezovskiy | 30c4b12 | 2023-11-06 18:03:18 +0500 | [diff] [blame] | 597 | RHEL on vSphere scheduled: ${enableVsphereRHEL} |
Mikhail Ivanov | bd1a9fd | 2022-03-29 21:36:21 +0400 | [diff] [blame] | 598 | Artifacts build scheduled: ${enableArtifactsBuild} |
Sergey Zhemerdeev | e67fb26 | 2022-06-21 00:49:34 +0300 | [diff] [blame] | 599 | Boot OS child from Ceph volumes: ${childOsBootFromVolume} |
Владислав Наумов | f793fe3 | 2020-09-11 15:19:19 +0200 | [diff] [blame] | 600 | Multiregional configuration: ${multiregionalMappings} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 601 | Service binaries fetching scheduled: ${fetchServiceBinaries} |
Владислав Наумов | 74e2d6e | 2020-12-30 17:05:40 +0100 | [diff] [blame] | 602 | Current weight of the demo run: ${demoWeight} (Used to manage lockable resources) |
Ivan Berezovskiy | 29e72b7 | 2022-07-12 21:03:24 +0400 | [diff] [blame] | 603 | Bootstrap v2 scenario enabled: ${bootstrapV2Scenario} |
Mikhail Ivanov | 3088d3d | 2022-10-24 14:05:46 +0400 | [diff] [blame] | 604 | FIPS enabled: ${enableFips} |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 605 | MKE DEBUG enabled: ${enableMkeDebug} |
Sergey Lalov | bc68d75 | 2022-11-08 13:40:53 +0400 | [diff] [blame] | 606 | Pause for debug enabled: ${pauseForDebug} |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 607 | AIO cluster: ${aioCluster} |
Mikhail Morgoev | 58855c1 | 2023-02-10 14:57:31 +0100 | [diff] [blame] | 608 | Use Vsphere VVMT Objects: ${useVsphereVvmtObjects} |
vryzhenkin | 4fd3f24 | 2023-03-29 15:13:46 +0400 | [diff] [blame] | 609 | Bootsrap v2 smoke checks enabled: ${enableBv2Smoke} |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 610 | Run Cache warmup for child clusters: ${runCacheWarmup} |
vryzhenkin | 211a4e8 | 2023-11-23 12:48:27 +0400 | [diff] [blame] | 611 | CVE Scan enabled: ${cveScan} |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 612 | Triggers: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md""") |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 613 | return [ |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 614 | osCloudLocation : openstackIMC, |
| 615 | cdnConfig : cdnConfig, |
| 616 | proxyConfig : proxyConfig, |
| 617 | useMacOsSeedNode : seedMacOs, |
| 618 | deployChildEnabled : deployChild, |
| 619 | childDeployCustomRelease : customChildRelease, |
| 620 | upgradeChildEnabled : upgradeChild, |
| 621 | fullUpgradeChildEnabled : fullUpgradeChild, |
| 622 | mosDeployChildEnabled : mosDeployChild, |
| 623 | mosUpgradeChildEnabled : mosUpgradeChild, |
| 624 | runChildConformanceEnabled : runChildConformance, |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 625 | runChildConformanceNetworkPolicyEnabled : runChildConformanceNetworkPolicy, |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 626 | runChildHPAEnabled : runChildHPA, |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame^] | 627 | runChildStacklightHaEnabled : runChildStacklightHa, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 628 | attachBYOEnabled : attachBYO, |
| 629 | upgradeBYOEnabled : upgradeBYO, |
| 630 | runBYOMatrixEnabled : runBYOMatrix, |
| 631 | defaultBYOOs : defaultBYOOs, |
| 632 | upgradeMgmtEnabled : upgradeMgmt, |
| 633 | autoUpgradeMgmtEnabled : autoUpgradeMgmt, |
| 634 | enableLMALoggingEnabled : enableLMALogging, |
| 635 | deployOsOnMosEnabled : deployOsOnMos, |
| 636 | runUie2eEnabled : runUie2e, |
| 637 | runUie2eNewEnabled : runUie2eNew, |
| 638 | runMgmtConformanceEnabled : runMgmtConformance, |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 639 | runMgmtConformanceNetworkPolicyEnabled : runMgmtConformanceNetworkPolicy, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 640 | runMaintenanceTestEnabled : runMaintenanceTest, |
| 641 | runContainerregistryTestEnabled : runContainerregistryTest, |
| 642 | runGracefulRebootTestEnabled : runGracefulRebootTest, |
| 643 | pauseForDebugEnabled : pauseForDebug, |
| 644 | runMgmtDeleteMasterTestEnabled : runMgmtDeleteMasterTest, |
| 645 | runRgnlDeleteMasterTestEnabled : runRgnlDeleteMasterTest, |
| 646 | runChildDeleteMasterTestEnabled : runChildDeleteMasterTest, |
Sergey Lalov | d5efcd5 | 2023-03-01 22:42:17 +0400 | [diff] [blame] | 647 | runChildCustomCertTestEnabled : runChildCustomCertTest, |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 648 | runMgmtCustomCacheCertTestEnabled : runMgmtCustomCacheCertTest, |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 649 | runMkeCustomCertTestEnabled : runMkeCustomCertTest, |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 650 | runCustomHostnamesEnabled : runCustomHostnames, |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 651 | slLatestEnabled : slLatest, |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 652 | runByoChildCustomCertTestEnabled : runByoChildCustomCertTest, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 653 | runChildMachineDeletionPolicyTestEnabled : runChildMachineDeletionPolicyTest, |
| 654 | runLMATestEnabled : runLMATest, |
| 655 | runMgmtUserControllerTestEnabled : runMgmtUserControllerTest, |
| 656 | runProxyChildTestEnabled : runProxyChildTest, |
| 657 | fetchServiceBinariesEnabled : fetchServiceBinaries, |
| 658 | awsOnDemandDemoEnabled : awsOnDemandDemo, |
| 659 | equinixOnDemandDemoEnabled : equinixOnDemandDemo, |
| 660 | equinixMetalV2OnDemandDemoEnabled : equinixMetalV2OnDemandDemo, |
| 661 | equinixMetalV2ChildDiffMetroEnabled : equinixMetalV2ChildDiffMetro, |
| 662 | equinixOnAwsDemoEnabled : equinixOnAwsDemo, |
| 663 | azureOnDemandDemoEnabled : azureOnDemandDemo, |
| 664 | azureOnAwsDemoEnabled : azureOnAwsDemo, |
| 665 | vsphereDemoEnabled : enableVsphereDemo, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 666 | bmDemoEnabled : enableBMDemo, |
| 667 | osDemoEnabled : enableOSDemo, |
| 668 | vsphereUbuntuEnabled : enableVsphereUbuntu, |
Ivan Berezovskiy | 30c4b12 | 2023-11-06 18:03:18 +0500 | [diff] [blame] | 669 | vsphereRHELEnabled : enableVsphereRHEL, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 670 | artifactsBuildEnabled : enableArtifactsBuild, |
| 671 | childOsBootFromVolume : childOsBootFromVolume, |
| 672 | multiregionalConfiguration : multiregionalMappings, |
| 673 | demoWeight : demoWeight, |
| 674 | bootstrapV2Scenario : bootstrapV2Scenario, |
| 675 | equinixMetalV2Metro : equinixMetalV2Metro, |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 676 | enableFips : enableFips, |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 677 | enableMkeDebugEnabled : enableMkeDebug, |
Mikhail Morgoev | 58855c1 | 2023-02-10 14:57:31 +0100 | [diff] [blame] | 678 | aioCluster : aioCluster, |
vryzhenkin | 4fd3f24 | 2023-03-29 15:13:46 +0400 | [diff] [blame] | 679 | useVsphereVvmtObjects : useVsphereVvmtObjects, |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 680 | bv2SmokeEnabled : enableBv2Smoke, |
| 681 | runCacheWarmup : runCacheWarmup, |
vryzhenkin | 211a4e8 | 2023-11-23 12:48:27 +0400 | [diff] [blame] | 682 | cveScanEnabled : cveScan, |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 683 | ] |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 684 | } |
| 685 | |
| 686 | /** |
| 687 | * Determine management and regional setup for demo workflow scenario |
| 688 | * |
| 689 | * |
Sergey Zhemerdeev | dd31ce9 | 2022-07-19 14:15:22 +0300 | [diff] [blame] | 690 | * @param: keyword (string) string , represents keyword trigger, specified in gerrit commit body, like `[multiregion aws,os]` |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 691 | or Jenkins environment string variable in form like 'aws,os' |
| 692 | * @return (map)[ |
| 693 | enabled: (bool), |
| 694 | * managementLocation: (string), //aws,os |
| 695 | * regionLocation: (string), //aws,os |
| 696 | * ] |
| 697 | */ |
| 698 | def multiregionWorkflowParser(keyword) { |
Владислав Наумов | 8c0c39d | 2020-09-11 14:46:48 +0200 | [diff] [blame] | 699 | def common = new com.mirantis.mk.Common() |
eromanova | 8c702ae | 2021-12-24 17:43:12 +0400 | [diff] [blame] | 700 | def supportedManagementProviders = ['os', 'aws', 'vsphere', 'equinix', 'equinixmetalv2', 'azure'] |
| 701 | def supportedRegionalProviders = ['os', 'vsphere', 'equinix', 'equinixmetalv2', 'bm', 'azure', 'aws'] |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 702 | |
| 703 | def clusterTypes = '' |
Владислав Наумов | 38ed7bf | 2020-09-11 14:43:39 +0200 | [diff] [blame] | 704 | if (keyword.toString().contains('multiregion')) { |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 705 | common.infoMsg('Multiregion definition configured via gerrit keyword trigger') |
| 706 | clusterTypes = keyword[0][0].split('multiregion')[1].replaceAll('[\\[\\]]', '').trim().split(',') |
| 707 | } else { |
| 708 | common.infoMsg('Multiregion definition configured via environment variable') |
| 709 | clusterTypes = keyword.trim().split(',') |
| 710 | } |
| 711 | |
| 712 | if (clusterTypes.size() != 2) { |
Владислав Наумов | 482fb50 | 2020-10-30 17:59:27 +0100 | [diff] [blame] | 713 | error("Incorrect regions definiton, valid scheme: [multiregion ${management}, ${region}], got: ${clusterTypes}") |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 714 | } |
| 715 | |
Владислав Наумов | f793fe3 | 2020-09-11 15:19:19 +0200 | [diff] [blame] | 716 | def desiredManagementProvider = clusterTypes[0].trim() |
| 717 | def desiredRegionalProvider = clusterTypes[1].trim() |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 718 | if (! supportedManagementProviders.contains(desiredManagementProvider) || ! supportedRegionalProviders.contains(desiredRegionalProvider)) { |
| 719 | error("""unsupported management <-> regional bundle, available options: |
Владислав Наумов | f793fe3 | 2020-09-11 15:19:19 +0200 | [diff] [blame] | 720 | management providers list - ${supportedManagementProviders} |
| 721 | regional providers list - ${supportedRegionalProviders}""") |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | return [ |
| 725 | enabled: true, |
| 726 | managementLocation: desiredManagementProvider, |
| 727 | regionLocation: desiredRegionalProvider, |
| 728 | ] |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 729 | } |
| 730 | |
| 731 | /** |
| 732 | * Determine if custom si tests/pipelines refspec forwarded from gerrit change request |
| 733 | |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 734 | * Keyword list: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 735 | * Used for components team to test component changes w/ custom SI refspecs using kaas/core deployment jobs |
| 736 | * Example scheme: |
| 737 | * New CR pushed in kubernetes/lcm-ansible -> parsing it's commit body and get custom test refspecs -> trigger deployment jobs from kaas/core |
| 738 | * manage refspecs through Jenkins Job Parameters |
| 739 | * |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 740 | * @return (map)[* siTests: (string) final refspec for si-tests |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 741 | * siPipelines: (string) final refspec for si-pipelines |
| 742 | * ] |
| 743 | */ |
| 744 | def checkCustomSIRefspec() { |
vnaumov | bdb9022 | 2020-05-04 18:25:50 +0200 | [diff] [blame] | 745 | def common = new com.mirantis.mk.Common() |
| 746 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 747 | // Available triggers and its sane defaults |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 748 | def siTestsRefspec = env.SI_TESTS_REFSPEC ?: 'master' |
| 749 | def siPipelinesRefspec = env.SI_PIPELINES_REFSPEC ?: 'master' |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 750 | def siTestsDockerImage = env.SI_TESTS_DOCKER_IMAGE ?: 'docker-dev-kaas-local.docker.mirantis.net/mirantis/kaas/si-test' |
| 751 | def siTestsDockerImageTag = env.SI_TESTS_DOCKER_IMAGE_TAG ?: 'master' |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 752 | def commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 753 | |
| 754 | def siTestMatches = (commitMsg =~ /(\[si-tests-ref\s*refs\/changes\/.*?\])/) |
| 755 | def siPipelinesMatches = (commitMsg =~ /(\[si-pipelines-ref\s*refs\/changes\/.*?\])/) |
| 756 | |
| 757 | if (siTestMatches.size() > 0) { |
| 758 | siTestsRefspec = siTestMatches[0][0].split('si-tests-ref')[1].replaceAll('[\\[\\]]', '').trim() |
Владислав Наумов | 7f6c088 | 2021-03-23 19:10:57 +0400 | [diff] [blame] | 759 | siTestsDockerImage = "docker-review-local.docker.mirantis.net/review/kaas-si-test-${siTestsRefspec.split('/')[-2]}" |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 760 | siTestsDockerImageTag = siTestsRefspec.split('/')[-1] |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 761 | } |
| 762 | if (siPipelinesMatches.size() > 0) { |
| 763 | siPipelinesRefspec = siPipelinesMatches[0][0].split('si-pipelines-ref')[1].replaceAll('[\\[\\]]', '').trim() |
| 764 | } |
| 765 | |
| 766 | common.infoMsg(""" |
| 767 | kaas/si-pipelines will be fetched from: ${siPipelinesRefspec} |
| 768 | kaas/si-tests will be fetched from: ${siTestsRefspec} |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 769 | kaas/si-tests as dockerImage will be fetched from: ${siTestsDockerImage}:${siTestsDockerImageTag} |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 770 | Keywords: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md""") |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 771 | return [siTests: siTestsRefspec, siPipelines: siPipelinesRefspec, siTestsDockerImage: siTestsDockerImage, siTestsDockerImageTag: siTestsDockerImageTag] |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 772 | } |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 773 | |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 774 | /** |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 775 | * Parse additional configuration for kaas component CICD repo |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 776 | * @param configurationFile (str) path to configuration file in yaml format |
| 777 | * |
| 778 | * @return (map)[ siTestsFeatureFlags (string) dedicated feature flags that will be used in SI tests, |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 779 | * siTestsFeatureFlagsStable (string) dedicated feature flags that will be used in SI tests for deploying stable release |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 780 | * ] |
| 781 | */ |
| 782 | def parseKaaSComponentCIParameters(configurationFile){ |
| 783 | def common = new com.mirantis.mk.Common() |
| 784 | def ciConfig = readYaml file: configurationFile |
| 785 | def ciSpec = [ |
| 786 | siTestsFeatureFlags: env.SI_TESTS_FEATURE_FLAGS ?: '', |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 787 | siTestsFeatureFlagsStable: env.SI_TESTS_FEATURE_FLAGS_STABLE ?: '', |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 788 | ] |
| 789 | |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 790 | // If exists and not empty |
| 791 | if (ciConfig.getOrDefault('si-tests-feature-flags', [])) { |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 792 | common.infoMsg("""SI tests feature flags customization detected, |
| 793 | results will be merged with existing flags: [${ciSpec['siTestsFeatureFlags']}] identification...""") |
| 794 | |
| 795 | def ffMeta = ciSpec['siTestsFeatureFlags'].tokenize(',').collect { it.trim() } |
| 796 | ffMeta.addAll(ciConfig['si-tests-feature-flags']) |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 797 | |
Владислав Наумов | cb5ffca | 2020-07-14 15:28:36 +0200 | [diff] [blame] | 798 | ciSpec['siTestsFeatureFlags'] = ffMeta.unique().join(',') |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 799 | common.infoMsg("SI tests custom feature flags: ${ciSpec['siTestsFeatureFlags']}") |
| 800 | } |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 801 | if (ciConfig.getOrDefault('si-tests-feature-flags-stable', [])) { |
| 802 | common.infoMsg("""SI tests feature flags for stable release customization detected, |
| 803 | results will be merged with existing flags: [${ciSpec['siTestsFeatureFlagsStable']}] identification...""") |
| 804 | |
| 805 | def ffMeta = ciSpec['siTestsFeatureFlagsStable'].tokenize(',').collect { it.trim() } |
| 806 | ffMeta.addAll(ciConfig['si-tests-feature-flags-stable']) |
| 807 | |
| 808 | ciSpec['siTestsFeatureFlagsStable'] = ffMeta.unique().join(',') |
| 809 | common.infoMsg("SI tests custom feature flags for stable release: ${ciSpec['siTestsFeatureFlagsStable']}") |
| 810 | } |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 811 | |
| 812 | common.infoMsg("""Additional ci configuration parsed successfully: |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 813 | siTestsFeatureFlags: ${ciSpec['siTestsFeatureFlags']} |
| 814 | siTestsFeatureFlagsStable: ${ciSpec['siTestsFeatureFlagsStable']}""") |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 815 | return ciSpec |
| 816 | } |
| 817 | |
| 818 | /** |
| 819 | * Determine if custom kaas core/pipelines refspec forwarded from gerrit change request |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 820 | |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 821 | * Keyword list: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 822 | * Used for components team to test component changes w/ custom Core refspecs using kaas/core deployment jobs |
| 823 | * Example scheme: |
| 824 | * New CR pushed in kubernetes/lcm-ansible -> parsing it's commit body and get custom test refspecs -> trigger deployment jobs from kaas/core |
| 825 | * manage refspecs through Jenkins Job Parameters |
| 826 | * |
| 827 | * @return (map)[ core: (string) final refspec for kaas/core |
| 828 | * corePipelines: (string) final refspec for pipelines in kaas/core |
| 829 | * ] |
| 830 | */ |
| 831 | def checkCustomCoreRefspec() { |
| 832 | def common = new com.mirantis.mk.Common() |
| 833 | |
| 834 | // Available triggers and its sane defaults |
| 835 | def coreRefspec = env.KAAS_CORE_REFSPEC ?: 'master' |
| 836 | // by default using value of GERRIT_REFSPEC parameter in *kaas/core jobs* |
| 837 | def corePipelinesRefspec = env.KAAS_PIPELINE_REFSPEC ?: '\$GERRIT_REFSPEC' |
| 838 | def commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
| 839 | |
| 840 | def coreMatches = (commitMsg =~ /(\[core-ref\s*refs\/changes\/.*?\])/) |
| 841 | def corePipelinesMatches = (commitMsg =~ /(\[core-pipelines-ref\s*refs\/changes\/.*?\])/) |
| 842 | |
| 843 | if (coreMatches.size() > 0) { |
| 844 | coreRefspec = coreMatches[0][0].split('core-ref')[1].replaceAll('[\\[\\]]', '').trim() |
| 845 | } |
| 846 | if (corePipelinesMatches.size() > 0) { |
| 847 | corePipelinesRefspec = corePipelinesMatches[0][0].split('core-pipelines-ref')[1].replaceAll('[\\[\\]]', '').trim() |
| 848 | } |
| 849 | |
| 850 | common.infoMsg(""" |
| 851 | kaas/core will be fetched from: ${coreRefspec} |
| 852 | kaas/core pipelines will be fetched from: ${corePipelinesRefspec} |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 853 | Keywords: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md""") |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 854 | return [core: coreRefspec, corePipelines: corePipelinesRefspec] |
| 855 | } |
| 856 | |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 857 | |
| 858 | /** |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 859 | * generate Jenkins Parameter objects from from text parameter with additonal kaas core context |
| 860 | * needed to forward inside kaas core set of jobs |
| 861 | * |
| 862 | * @param context (string) Representation of the string enviroment variables needed for kaas core jobs in yaml format |
| 863 | * @return (list)[ string(name: '', value: ''), |
| 864 | * ] |
| 865 | */ |
| 866 | def generateKaaSVarsFromContext(context) { |
| 867 | def common = new com.mirantis.mk.Common() |
| 868 | def parameters = [] |
| 869 | def config = readYaml text: context |
| 870 | |
| 871 | config.each { k,v -> |
| 872 | common.infoMsg("Custom KaaS Core context parameter: ${k}=${v}") |
| 873 | parameters.add(string(name: k, value: v)) |
| 874 | } |
| 875 | |
| 876 | return parameters |
| 877 | } |
| 878 | |
| 879 | /** |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 880 | * Trigger KaaS demo jobs based on AWS/OS providers with customized test suite, parsed from external sources (gerrit commit/jj vars) |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 881 | * Keyword list: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 882 | * Used for components team to test component changes w/ customized SI tests/refspecs using kaas/core deployment jobs |
| 883 | * |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 884 | * @param: component (string) component name [iam, lcm, stacklight] |
| 885 | * @param: patchSpec (string) Patch for kaas/cluster releases in json format |
| 886 | * @param: configurationFile (string) Additional file for component repo CI config in yaml format |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 887 | */ |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 888 | def triggerPatchedComponentDemo(component, patchSpec = '', configurationFile = '.ci-parameters.yaml', coreContext = '') { |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 889 | def common = new com.mirantis.mk.Common() |
| 890 | // Determine if custom trigger keywords forwarded from gerrit |
| 891 | def triggers = checkDeploymentTestSuite() |
| 892 | // Determine SI refspecs |
| 893 | def siRefspec = checkCustomSIRefspec() |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 894 | // Determine Core refspecs |
| 895 | def coreRefspec = checkCustomCoreRefspec() |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 896 | |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 897 | // Determine component repo ci configuration |
| 898 | def ciSpec = [:] |
| 899 | def componentFeatureFlags = env.SI_TESTS_FEATURE_FLAGS ?: '' |
| 900 | if (fileExists(configurationFile)) { |
| 901 | common.infoMsg('Component CI configuration file detected, parsing...') |
| 902 | ciSpec = parseKaaSComponentCIParameters(configurationFile) |
| 903 | componentFeatureFlags = ciSpec['siTestsFeatureFlags'] |
| 904 | } else { |
| 905 | common.warningMsg('''Component CI configuration file is not exists, |
Владислав Наумов | c17dd55 | 2020-07-29 17:07:38 +0200 | [diff] [blame] | 906 | several code-management features may be unavailable, |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 907 | follow https://mirantis.jira.com/wiki/spaces/QA/pages/2310832276/SI-tests+feature+flags#%5BUpdated%5D-Using-a-feature-flag |
| 908 | to create the configuration file''') |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 909 | } |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 910 | |
| 911 | def platforms = [] |
| 912 | if (component == 'ipam' && triggers.vsphereDemoEnabled) { |
| 913 | // Currently only vsphere demo is required for IPAM component |
| 914 | platforms.add('vsphere') |
| 915 | } else { |
| 916 | if (triggers.osDemoEnabled) { |
| 917 | platforms.add('openstack') |
| 918 | } |
| 919 | if (triggers.awsOnDemandDemoEnabled) { |
| 920 | platforms.add('aws') |
| 921 | } |
| 922 | if (triggers.equinixOnDemandDemoEnabled) { |
| 923 | platforms.add('equinix') |
| 924 | } |
Владислав Наумов | 144956f | 2021-10-14 17:49:19 +0200 | [diff] [blame] | 925 | if (triggers.equinixMetalV2OnDemandDemoEnabled) { |
| 926 | platforms.add('equinixmetalv2') |
| 927 | } |
Владислав Наумов | c52dd9d | 2021-06-28 16:27:29 +0200 | [diff] [blame] | 928 | if (triggers.azureOnDemandDemoEnabled) { |
| 929 | platforms.add('azure') |
| 930 | } |
Ivan Berezovskiy | b0229d0 | 2021-05-17 16:55:18 +0400 | [diff] [blame] | 931 | if (triggers.vsphereDemoEnabled) { |
| 932 | platforms.add('vsphere') |
| 933 | } |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 934 | } |
| 935 | |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 936 | def jobs = [:] |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 937 | def parameters = [ |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 938 | string(name: 'GERRIT_REFSPEC', value: coreRefspec.core), |
| 939 | string(name: 'KAAS_PIPELINE_REFSPEC', value: coreRefspec.corePipelines), |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 940 | string(name: 'SI_TESTS_REFSPEC', value: siRefspec.siTests), |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 941 | string(name: 'SI_TESTS_FEATURE_FLAGS', value: componentFeatureFlags), |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 942 | string(name: 'SI_TESTS_DOCKER_IMAGE', value: siRefspec.siTestsDockerImage), |
| 943 | string(name: 'SI_TESTS_DOCKER_IMAGE_TAG', value: siRefspec.siTestsDockerImageTag), |
Владислав Наумов | 4a5c324 | 2020-06-08 14:36:11 +0200 | [diff] [blame] | 944 | string(name: 'SI_PIPELINES_REFSPEC', value: siRefspec.siPipelines), |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 945 | string(name: 'CUSTOM_RELEASE_PATCH_SPEC', value: patchSpec), |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 946 | string(name: 'KAAS_CHILD_CLUSTER_RELEASE_NAME', value: triggers.childDeployCustomRelease), |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 947 | string(name: 'OPENSTACK_CLOUD_LOCATION', value: triggers.osCloudLocation), |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 948 | booleanParam(name: 'OFFLINE_MGMT_CLUSTER', value: triggers.proxyConfig['mgmtOffline']), |
Владислав Наумов | f8f23fa | 2021-04-01 16:57:52 +0200 | [diff] [blame] | 949 | booleanParam(name: 'OFFLINE_CHILD_CLUSTER', value: triggers.proxyConfig['childOffline']), |
Владислав Наумов | 257ea13 | 2021-04-14 14:44:13 +0200 | [diff] [blame] | 950 | booleanParam(name: 'PROXY_CHILD_CLUSTER', value: triggers.proxyConfig['childProxy']), |
Владислав Наумов | 44c64b7 | 2020-12-04 20:22:53 +0100 | [diff] [blame] | 951 | booleanParam(name: 'SEED_MACOS', value: triggers.useMacOsSeedNode), |
Владислав Наумов | 080d941 | 2020-07-29 13:05:14 +0200 | [diff] [blame] | 952 | booleanParam(name: 'UPGRADE_MGMT_CLUSTER', value: triggers.upgradeMgmtEnabled), |
slalov | 1202bba | 2022-04-20 22:31:07 +0400 | [diff] [blame] | 953 | booleanParam(name: 'AUTO_UPGRADE_MCC', value: triggers.autoUpgradeMgmtEnabled), |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 954 | booleanParam(name: 'ENABLE_LMA_LOGGING', value: triggers.enableLMALoggingEnabled), |
Sergey Lalov | b2f6037 | 2022-09-20 23:58:47 +0400 | [diff] [blame] | 955 | booleanParam(name: 'DEPLOY_OS_ON_MOS', value: triggers.deployOsOnMosEnabled), |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 956 | booleanParam(name: 'RUN_UI_E2E', value: triggers.runUie2eEnabled), |
Владислав Наумов | 080d941 | 2020-07-29 13:05:14 +0200 | [diff] [blame] | 957 | booleanParam(name: 'RUN_MGMT_CFM', value: triggers.runMgmtConformanceEnabled), |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 958 | booleanParam(name: 'RUN_MGMT_CFM_NETWORK_POLICY', value: triggers.runMgmtConformanceNetworkPolicyEnabled), |
slalov | 0a4947a | 2022-06-09 15:44:35 +0400 | [diff] [blame] | 959 | booleanParam(name: 'RUN_MAINTENANCE_TEST', value: triggers.runMaintenanceTestEnabled), |
| 960 | booleanParam(name: 'RUN_CONTAINER_REGISTRY_TEST', value: triggers.runContainerregistryTestEnabled), |
Mikhail Nikolaenko | 7e632cd | 2022-10-24 16:20:31 +0300 | [diff] [blame] | 961 | booleanParam(name: 'RUN_GRACEFUL_REBOOT_TEST', value: triggers.runGracefulRebootTestEnabled), |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 962 | booleanParam(name: 'RUN_MGMT_DELETE_MASTER_TEST', value: triggers.runMgmtDeleteMasterTestEnabled), |
| 963 | booleanParam(name: 'RUN_RGNL_DELETE_MASTER_TEST', value: triggers.runRgnlDeleteMasterTestEnabled), |
| 964 | booleanParam(name: 'RUN_CHILD_DELETE_MASTER_TEST', value: triggers.runChildDeleteMasterTestEnabled), |
Sergey Lalov | d5efcd5 | 2023-03-01 22:42:17 +0400 | [diff] [blame] | 965 | booleanParam(name: 'RUN_CHILD_CUSTOM_CERT_TEST', value: triggers.runChildCustomCertTestEnabled), |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 966 | booleanParam(name: 'RUN_MGMT_CUSTOM_CACHE_CERT_TEST', value: triggers.runMgmtCustomCacheCertTestEnabled), |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 967 | booleanParam(name: 'RUN_MKE_CUSTOM_CERT_TEST', value: triggers.runMkeCustomCertTestEnabled), |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 968 | booleanParam(name: 'RUN_CUSTOM_HOSTNAMES', value: triggers.runCustomHostnamesEnabled), |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 969 | booleanParam(name: 'SL_LATEST', value: triggers.slLatestEnabled), |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 970 | booleanParam(name: 'RUN_BYO_CHILD_CUSTOM_CERT_TEST', value: triggers.runByoChildCustomCertTestEnabled), |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 971 | booleanParam(name: 'RUN_CHILD_MACHINE_DELETION_POLICY_TEST', value: triggers.runChildMachineDeletionPolicyTestEnabled), |
Владислав Наумов | 9cec55d | 2021-08-03 15:00:59 +0200 | [diff] [blame] | 972 | booleanParam(name: 'RUN_LMA_TEST', value: triggers.runLMATestEnabled), |
Vladyslav Drok | c4f9c1b | 2021-07-22 15:34:24 +0200 | [diff] [blame] | 973 | booleanParam(name: 'RUN_MGMT_USER_CONTROLLER_TEST', value: triggers.runMgmtUserControllerTestEnabled), |
Владислав Наумов | 080d941 | 2020-07-29 13:05:14 +0200 | [diff] [blame] | 974 | booleanParam(name: 'DEPLOY_CHILD_CLUSTER', value: triggers.deployChildEnabled), |
| 975 | booleanParam(name: 'UPGRADE_CHILD_CLUSTER', value: triggers.upgradeChildEnabled), |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 976 | booleanParam(name: 'FULL_UPGRADE_CHILD_CLUSTER', value: triggers.fullUpgradeChildEnabled), |
slalov | 574123e | 2022-04-06 17:24:19 +0400 | [diff] [blame] | 977 | booleanParam(name: 'RUN_PROXY_CHILD_TEST', value: triggers.runProxyChildTestEnabled), |
Владислав Наумов | 0dc9925 | 2020-11-13 13:30:48 +0100 | [diff] [blame] | 978 | booleanParam(name: 'ATTACH_BYO', value: triggers.attachBYOEnabled), |
Владислав Наумов | cdbd84e | 2020-12-01 16:51:09 +0100 | [diff] [blame] | 979 | booleanParam(name: 'UPGRADE_BYO', value: triggers.upgradeBYOEnabled), |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 980 | booleanParam(name: 'RUN_BYO_MATRIX', value: triggers.runBYOMatrixEnabled), |
Владислав Наумов | 080d941 | 2020-07-29 13:05:14 +0200 | [diff] [blame] | 981 | booleanParam(name: 'RUN_CHILD_CFM', value: triggers.runChildConformanceEnabled), |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 982 | booleanParam(name: 'RUN_CHILD_CFM_NETPOLICY', value: triggers.runChildConformanceNetworkPolicyEnabled), |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 983 | booleanParam(name: 'RUN_CHILD_HPA', value: triggers.runChildHPAEnabled), |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame^] | 984 | booleanParam(name: 'RUN_STACKLIGHT_CHILD_HA', value: triggers.runChildStacklightHaEnabled), |
Ivan Berezovskiy | cbf9eeb | 2021-03-22 15:57:32 +0400 | [diff] [blame] | 985 | booleanParam(name: 'ALLOW_AWS_ON_DEMAND', value: triggers.awsOnDemandDemoEnabled), |
Владислав Наумов | e021b02 | 2021-05-06 11:26:38 +0200 | [diff] [blame] | 986 | booleanParam(name: 'ALLOW_EQUINIX_ON_DEMAND', value: triggers.equinixOnDemandDemoEnabled), |
Владислав Наумов | 82305e9 | 2021-10-14 20:45:20 +0200 | [diff] [blame] | 987 | booleanParam(name: 'ALLOW_EQUINIXMETALV2_ON_DEMAND', value: triggers.equinixMetalV2OnDemandDemoEnabled), |
Vladislav Naumov | 42b71dc | 2021-11-22 13:09:42 +0100 | [diff] [blame] | 988 | booleanParam(name: 'EQUINIXMETALV2_CHILD_DIFF_METRO', value: triggers.equinixMetalV2ChildDiffMetroEnabled), |
eromanova | d339751 | 2021-04-01 20:19:19 +0400 | [diff] [blame] | 989 | booleanParam(name: 'EQUINIX_ON_AWS_DEMO', value: triggers.equinixOnAwsDemoEnabled), |
Владислав Наумов | c52dd9d | 2021-06-28 16:27:29 +0200 | [diff] [blame] | 990 | booleanParam(name: 'ALLOW_AZURE_ON_DEMAND', value: triggers.azureOnDemandDemoEnabled), |
Владислав Наумов | 2d3db33 | 2021-06-15 15:19:19 +0200 | [diff] [blame] | 991 | booleanParam(name: 'AZURE_ON_AWS_DEMO', value: triggers.azureOnAwsDemoEnabled), |
Sergey Zhemerdeev | 9074f6e | 2022-06-07 12:03:16 +0300 | [diff] [blame] | 992 | booleanParam(name: 'VSPHERE_DEPLOY_UBUNTU', value: triggers.vsphereUbuntuEnabled), |
Sergey Lalov | bc68d75 | 2022-11-08 13:40:53 +0400 | [diff] [blame] | 993 | booleanParam(name: 'PAUSE_FOR_DEBUG', value: triggers.pauseForDebugEnabled), |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 994 | booleanParam(name: 'ENABLE_FIPS', value: triggers.enableFips), |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 995 | booleanParam(name: 'ENABLE_MKE_DUBUG', value: triggers.enableMkeDebugEnabled), |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 996 | booleanParam(name: 'AIO_CLUSTER', value: triggers.aioCluster), |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 997 | ] |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 998 | |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 999 | // customize multiregional demo |
| 1000 | if (triggers.multiregionalConfiguration.enabled) { |
| 1001 | parameters.add(string(name: 'MULTIREGION_SETUP', |
| 1002 | value: "${triggers.multiregionalConfiguration.managementLocation},${triggers.multiregionalConfiguration.regionLocation}" |
| 1003 | )) |
| 1004 | } |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1005 | |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 1006 | // Determine component team custom context |
| 1007 | if (coreContext != '') { |
| 1008 | common.infoMsg('Additional KaaS Core context detected, will be forwarded into kaas core cicd...') |
| 1009 | def additionalParameters = generateKaaSVarsFromContext(coreContext) |
Владислав Наумов | bef51a9 | 2020-10-01 17:36:51 +0200 | [diff] [blame] | 1010 | parameters.addAll(additionalParameters) |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 1011 | } |
| 1012 | |
Владислав Наумов | aa43061 | 2020-06-08 17:18:31 +0200 | [diff] [blame] | 1013 | def jobResults = [] |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 1014 | |
| 1015 | platforms.each { platform -> |
| 1016 | jobs["kaas-core-${platform}-patched-${component}"] = { |
Vladislav Naumov | 5313a20 | 2021-04-07 17:13:39 +0000 | [diff] [blame] | 1017 | try { |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 1018 | common.infoMsg("Deploy: patched KaaS demo with ${platform} provider") |
| 1019 | def job_info = build job: "kaas-testing-core-${platform}-workflow-${component}", parameters: parameters, wait: true |
| 1020 | def build_description = job_info.getDescription() |
| 1021 | def build_result = job_info.getResult() |
Vladislav Naumov | 5313a20 | 2021-04-07 17:13:39 +0000 | [diff] [blame] | 1022 | jobResults.add(build_result) |
Владислав Наумов | d044e84 | 2020-06-17 15:33:43 +0200 | [diff] [blame] | 1023 | |
Vladislav Naumov | 5313a20 | 2021-04-07 17:13:39 +0000 | [diff] [blame] | 1024 | if (build_description) { |
| 1025 | currentBuild.description += build_description |
| 1026 | } |
| 1027 | } finally { |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 1028 | common.infoMsg("Patched KaaS demo with ${platform} provider finished") |
Vladislav Naumov | 5313a20 | 2021-04-07 17:13:39 +0000 | [diff] [blame] | 1029 | } |
| 1030 | } |
| 1031 | } |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1032 | |
| 1033 | common.infoMsg('Trigger KaaS demo deployments according to defined provider set') |
Владислав Наумов | 37f7f84 | 2021-03-09 16:08:39 +0400 | [diff] [blame] | 1034 | if (jobs.size() == 0) { |
| 1035 | error('No demo jobs matched with keywords, execution will be aborted, at least 1 provider should be enabled') |
| 1036 | } |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1037 | // Limit build concurency workaround examples: https://issues.jenkins-ci.org/browse/JENKINS-44085 |
| 1038 | parallel jobs |
Владислав Наумов | aa43061 | 2020-06-08 17:18:31 +0200 | [diff] [blame] | 1039 | |
| 1040 | if (jobResults.contains('FAILURE')) { |
Владислав Наумов | f86b111 | 2020-06-09 14:04:48 +0200 | [diff] [blame] | 1041 | common.infoMsg('One of parallel downstream jobs is failed, mark executor job as failed') |
Владислав Наумов | aa43061 | 2020-06-08 17:18:31 +0200 | [diff] [blame] | 1042 | currentBuild.result = 'FAILURE' |
| 1043 | } |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1044 | } |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 1045 | |
| 1046 | |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1047 | /** |
| 1048 | * Function currently supported to be called from aws or vsphere demos. It gets particular demo context |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1049 | * and generate proper lockResources data and netMap data for vsphere,equinix related clusters. |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1050 | * |
| 1051 | * @param: callBackDemo (string) Demo which requested to generate lockResources [aws or vsphere] |
| 1052 | * @param: triggers (map) Custom trigger keywords forwarded from gerrit |
| 1053 | * @param: multiregionalConfiguration (map) Multiregional configuration |
| 1054 | * @return (map) Return aggregated map with lockResources and netMap |
| 1055 | */ |
| 1056 | |
| 1057 | |
| 1058 | def generateLockResources(callBackDemo, triggers) { |
| 1059 | def common = new com.mirantis.mk.Common() |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1060 | def netMap = [ |
| 1061 | vsphere: [:], |
| 1062 | equinix: [:], |
| 1063 | ] |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1064 | // Define vsphere locklabels with initial quantity |
| 1065 | def lockLabels = [ |
| 1066 | vsphere_networking_core_ci: 0, |
| 1067 | vsphere_offline_networking_core_ci: 0, |
| 1068 | ] |
| 1069 | def deployChild = triggers.deployChildEnabled |
Sergey Lalov | 13eea42 | 2023-08-21 23:10:17 +0400 | [diff] [blame] | 1070 | def testUiVsphere = triggers.runUie2eEnabled || triggers.runUie2eNewEnabled |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1071 | def multiregionConfig = triggers.multiregionalConfiguration |
| 1072 | def runMultiregion = multiregionConfig.enabled |
| 1073 | |
| 1074 | // Generate vsphere netMap and lockLabels based on demo context |
| 1075 | switch (callBackDemo) { |
| 1076 | case 'aws': |
| 1077 | // Add aws specific lock label with quantity calculated based on single mgmt deploy or mgmt + child |
| 1078 | lockLabels['aws_core_ci_queue'] = triggers.demoWeight |
Sergey Kolekonov | f4c1f49 | 2022-02-03 14:44:45 +0400 | [diff] [blame] | 1079 | if (triggers.runBYOMatrixEnabled) { lockLabels['aws_core_ci_queue'] += 6 } |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1080 | |
| 1081 | // Define netMap for Vsphere region |
Mikhail Ivanov | 90a27fa | 2022-05-30 15:18:24 +0400 | [diff] [blame] | 1082 | if (runMultiregion && multiregionConfig.managementLocation == 'aws') { |
| 1083 | if (multiregionConfig.regionLocation == 'vsphere') { |
| 1084 | if (deployChild) { |
| 1085 | addToProviderNetMap(netMap, 'vsphere', 'regional-child') |
| 1086 | } |
| 1087 | addToProviderNetMap(netMap, 'vsphere', 'region') |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1088 | } |
Mikhail Ivanov | 90a27fa | 2022-05-30 15:18:24 +0400 | [diff] [blame] | 1089 | |
| 1090 | if (multiregionConfig.regionLocation == 'azure') { |
| 1091 | lockLabels['azure_core_ci_queue'] = 1 |
| 1092 | if (deployChild) { |
| 1093 | lockLabels['azure_core_ci_queue'] += 1 |
| 1094 | } |
| 1095 | } |
| 1096 | } |
| 1097 | if (triggers.azureOnAwsDemoEnabled) { |
| 1098 | lockLabels['azure_core_ci_queue'] = 1 |
| 1099 | } |
| 1100 | |
| 1101 | if (triggers.equinixOnAwsDemoEnabled) { |
| 1102 | lockLabels['equinix_core_ci_queue'] = 1 |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1103 | } |
| 1104 | break |
| 1105 | case 'vsphere': |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1106 | addToProviderNetMap(netMap, 'vsphere', 'mgmt') |
slalov | 2783327 | 2022-06-30 02:13:50 +0400 | [diff] [blame] | 1107 | if (deployChild || testUiVsphere) { |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1108 | addToProviderNetMap(netMap, 'vsphere', 'child') |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1109 | } |
| 1110 | if (runMultiregion && multiregionConfig.managementLocation == 'vsphere' && |
| 1111 | multiregionConfig.regionLocation == 'vsphere') { |
| 1112 | if (deployChild) { |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1113 | addToProviderNetMap(netMap, 'vsphere', 'regional-child') |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1114 | } |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1115 | addToProviderNetMap(netMap, 'vsphere', 'region') |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1116 | } |
| 1117 | break |
Mikhail Ivanov | 90a27fa | 2022-05-30 15:18:24 +0400 | [diff] [blame] | 1118 | case 'azure': |
| 1119 | lockLabels['azure_core_ci_queue'] = triggers.demoWeight |
| 1120 | if (runMultiregion && multiregionConfig.managementLocation == 'azure') { |
| 1121 | if (multiregionConfig.regionLocation == 'aws') { |
| 1122 | lockLabels['aws_core_ci_queue'] = 1 |
| 1123 | if (deployChild) { |
| 1124 | lockLabels['aws_core_ci_queue'] += 1 |
| 1125 | } |
| 1126 | } |
| 1127 | |
| 1128 | if (multiregionConfig.regionLocation == 'equinix') { |
| 1129 | lockLabels['equinix_core_ci_queue'] = 1 |
| 1130 | if (deployChild) { |
| 1131 | lockLabels['equinix_core_ci_queue'] +=1 |
| 1132 | } |
| 1133 | } |
| 1134 | } |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1135 | default: |
Mikhail Ivanov | 90a27fa | 2022-05-30 15:18:24 +0400 | [diff] [blame] | 1136 | error('Supposed to be called from aws, azure or vsphere demos only') |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1137 | } |
| 1138 | |
| 1139 | // Checking gerrit triggers and manage lock label quantity and network types in case of Offline deployment |
| 1140 | // Vsphere labels only |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1141 | netMap['vsphere'].each { clusterType, netConfig -> |
| 1142 | if (triggers.proxyConfig["${clusterType}Offline"] == true || |
| 1143 | (clusterType == 'regional-child' && triggers.proxyConfig['childOffline'] == true) || |
| 1144 | (clusterType == 'region' && triggers.proxyConfig['mgmtOffline'])) { |
| 1145 | |
| 1146 | netMap['vsphere'][clusterType]['netName'] = 'offline' |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1147 | lockLabels['vsphere_offline_networking_core_ci']++ |
| 1148 | } else { |
| 1149 | lockLabels['vsphere_networking_core_ci']++ |
| 1150 | } |
| 1151 | } |
| 1152 | |
| 1153 | // generate lock metadata |
| 1154 | def lockResources = [] |
| 1155 | lockLabels.each { label, quantity -> |
| 1156 | if (quantity > 0) { |
| 1157 | def res = [ |
| 1158 | label: label, |
| 1159 | quantity: quantity, |
| 1160 | ] |
| 1161 | lockResources.add(res) |
| 1162 | } |
| 1163 | } |
| 1164 | |
| 1165 | common.infoMsg("""Generated vsphere netMap: ${netMap} |
| 1166 | Generated lockResources: ${lockResources}""") |
| 1167 | |
| 1168 | return [ |
| 1169 | netMap: netMap, |
| 1170 | lockResources: lockResources, |
| 1171 | ] |
| 1172 | } |
| 1173 | |
| 1174 | /** |
| 1175 | * Function gets vsphere netMap or empty map and adds new vsphere clusterType with default netName |
| 1176 | * and empty rangeConfig to the this map. |
| 1177 | * |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1178 | * @param: netMap (string) vsphere, equinix netMap or empty map |
| 1179 | * @param: provider (string) provider type |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1180 | * @param: clusterType (string) Vsphere cluster type |
| 1181 | */ |
| 1182 | |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1183 | def addToProviderNetMap (netMap, provider, clusterType) { |
| 1184 | switch (provider) { |
| 1185 | case 'equinix': |
| 1186 | netMap[provider][clusterType] = [ |
| 1187 | vlanConfig: '', |
| 1188 | ] |
| 1189 | break |
| 1190 | case 'vsphere': |
| 1191 | netMap[provider][clusterType] = [ |
| 1192 | netName: 'default', |
| 1193 | rangeConfig: '', |
| 1194 | ] |
| 1195 | break |
| 1196 | default: |
| 1197 | error('Net map locks supported for Equinix/Vsphere providers only') |
| 1198 | } |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1199 | } |
Dmitry Teselkin | fce71aa | 2022-03-05 19:36:52 +0300 | [diff] [blame] | 1200 | |
| 1201 | /** |
| 1202 | * getCIKeywordsFromCommitMsg parses commit message and returns all gerrit keywords with their values as a list of maps. |
| 1203 | * Each element (map) contains keys 'key' for keyword name and 'value' for its value. |
| 1204 | * If keyword contains only 'key' part then 'value' is boolean True. |
| 1205 | * This function does not perform keywords validation. |
| 1206 | * First line of a commit message is ignored. |
| 1207 | * To use '[' or ']' characters inside keyword prepend it with backslash '\'. |
| 1208 | * TODO: Remove backslash chars from values if they prepend '[' or ']'. |
| 1209 | **/ |
| 1210 | |
| 1211 | List getCIKeywordsFromCommitMsg() { |
| 1212 | String commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
| 1213 | List commitMsgLines = commitMsg.split('\n') |
| 1214 | List keywords = [] |
| 1215 | if (commitMsgLines.size() < 2) { |
| 1216 | return keywords |
| 1217 | } |
| 1218 | |
| 1219 | String commitMsgBody = commitMsgLines[1..-1].join('\n') |
| 1220 | |
| 1221 | // Split commit message body to chunks using '[' or ']' as delimiter, |
| 1222 | // ignoring them if prepended by backslash (regex negative lookbehind). |
| 1223 | // Resulting list will have chunks between '[' and ']' at odd indexes. |
| 1224 | List parts = commitMsgBody.split(/(?<!\\)[\[\]]/) |
| 1225 | |
| 1226 | // Iterate chunks by odd indexes only, trim values and split to |
| 1227 | // <key> / <value> pair where <key> is the part of a sting before the first |
| 1228 | // whitespace delimiter, and <value> is the rest (may include whitespaces). |
| 1229 | // If there is no whitespace in the string then this is a 'switch' |
| 1230 | // and <value> will be boolean True. |
| 1231 | for (i = 1; i < parts.size(); i += 2) { |
| 1232 | def (key, value) = (parts[i].trim().split(/\s+/, 2) + [true, ])[0..1] |
| 1233 | keywords.add(['key': key, 'value': value]) |
| 1234 | } |
| 1235 | |
| 1236 | return keywords |
| 1237 | } |
| 1238 | |
| 1239 | /** |
| 1240 | * getJobsParamsFromCommitMsg parses list of CI keywords and returns values of 'job-params' keyword |
| 1241 | * that were specified for given job name. `job-params` keyword has the following structure |
| 1242 | * |
| 1243 | * [job-params <job name> <parameter name> <parameter value>] |
| 1244 | * |
| 1245 | * Return value is a Map that contains those parameters using the following structure: |
| 1246 | * |
| 1247 | * <job name>: |
| 1248 | * <parameter name>: <parameter value> |
| 1249 | * |
| 1250 | **/ |
| 1251 | Map getJobsParamsFromCommitMsg() { |
| 1252 | List keywords = getCIKeywordsFromCommitMsg() |
| 1253 | |
| 1254 | List jobsParamsList = [] |
| 1255 | keywords.findAll{ it.key == 'job-params' }.collect(jobsParamsList) { |
| 1256 | def (name, params) = (it['value'].split(/\s+/, 2) + [null, ])[0..1] |
| 1257 | def (key, value) = params.split(/\s+/, 2) |
| 1258 | ['name': name, 'key': key, 'value': value] |
| 1259 | } |
| 1260 | |
| 1261 | Map jobsParams = jobsParamsList.inject([:]) { result, it -> |
| 1262 | if (!result.containsKey(it.name)) { |
| 1263 | result[it.name] = [:] |
| 1264 | } |
| 1265 | result[it.name][it.key] = it.value |
| 1266 | result |
| 1267 | } |
| 1268 | |
| 1269 | return jobsParams |
| 1270 | } |
| 1271 | |
| 1272 | |
| 1273 | /** |
| 1274 | * getJobParamsFromCommitMsg returns key:value Map of parameters set for a job in commit message. |
| 1275 | * It uses getJobsParamsFromCommitMsg to get all parameters from commit message and then |
| 1276 | * uses only those parametes that were set to all jobs (with <job name> == '*') or to |
| 1277 | * a particular job. Parameters set to a particular job have higher precedence. |
| 1278 | * |
| 1279 | * Return value is a Map that contains those parameters: |
| 1280 | * |
| 1281 | * <parameter name>: <parameter value> |
| 1282 | * |
| 1283 | **/ |
| 1284 | Map getJobParamsFromCommitMsg(String jobName) { |
| 1285 | jobsParams = getJobsParamsFromCommitMsg() |
| 1286 | jobParams = jobsParams.getOrDefault('*', [:]) |
| 1287 | if (jobName) { |
| 1288 | jobParams.putAll(jobsParams.getOrDefault(jobName, [:])) |
| 1289 | } |
| 1290 | return jobParams |
| 1291 | } |
azvyagintsev | c17d14b | 2022-06-06 19:06:33 +0300 | [diff] [blame] | 1292 | |
| 1293 | /** Getting test scheme from text, which should be |
| 1294 | Imput example: |
| 1295 | text=""" |
| 1296 | DATA |
| 1297 | |
| 1298 | kaas_bm_test_schemas: |
| 1299 | KAAS_RELEASES_REFSPEC: '' |
| 1300 | KEY: VAL |
| 1301 | |
| 1302 | DATA |
| 1303 | """ |
| 1304 | |
| 1305 | Call: parseTextForTestSchemas(['text' : text,'keyLine' : 'kaas_bm_test_schemas']) |
| 1306 | |
| 1307 | Return: |
| 1308 | ['KAAS_RELEASES_REFSPEC': '', 'KEY' : 'VAL'] |
| 1309 | **/ |
| 1310 | def parseTextForTestSchemas(Map opts) { |
azvyagintsev | d96aac2 | 2022-06-10 14:23:26 +0300 | [diff] [blame] | 1311 | String text = opts.getOrDefault('text', '') |
azvyagintsev | c17d14b | 2022-06-06 19:06:33 +0300 | [diff] [blame] | 1312 | String keyLine = opts.getOrDefault('keyLine', '') |
| 1313 | Map testScheme = [:] |
| 1314 | if (!text || !keyLine) { |
azvyagintsev | d96aac2 | 2022-06-10 14:23:26 +0300 | [diff] [blame] | 1315 | return testScheme |
azvyagintsev | c17d14b | 2022-06-06 19:06:33 +0300 | [diff] [blame] | 1316 | } |
| 1317 | if (text =~ /\n$keyLine\n.*/) { |
| 1318 | def common = new com.mirantis.mk.Common() |
| 1319 | try { |
| 1320 | String regExp = '\\n' + keyLine + '\\n' |
| 1321 | // regexep block must be followed by empty line |
| 1322 | testScheme = readYaml text: "${text.split(regExp)[1].split('\n\n')[0]}" |
| 1323 | common.infoMsg("parseTextForTestSchemas result:\n" + testScheme) |
| 1324 | common.mergeEnv(env, toJson(testScheme)) |
| 1325 | } |
| 1326 | catch (Exception e) { |
| 1327 | common.errorMsg("There is an error occured during parseTextForTestSchemas execution:\n${e}") |
| 1328 | throw e |
| 1329 | } |
| 1330 | } |
azvyagintsev | d96aac2 | 2022-06-10 14:23:26 +0300 | [diff] [blame] | 1331 | return testScheme |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 1332 | } |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1333 | |
| 1334 | |
| 1335 | /** |
eromanova | b24cb23 | 2023-11-17 12:17:06 +0400 | [diff] [blame] | 1336 | * getEquinixMetroWithCapacity returns list of Equinix metros using specified |
| 1337 | * instance type (nodeType), desired count of metros (metroCount) and |
| 1338 | * instances (nodeCount) in a metro using specified matal version. |
| 1339 | * Function downloads metal CLI from the |
| 1340 | * https://artifactory.mcp.mirantis.net:443/artifactory/binary-dev-kaas-local/core/bin/mirror/metal-${version}-linux |
| 1341 | * Empty list is returned in case of no metros with specified capacity was found or any other errors. |
| 1342 | * Non-empty list is shuffled. |
| 1343 | * |
| 1344 | * @param: metroCount (int) Desired count of metros |
| 1345 | * @param: nodeCount (int) Desired count of instances |
| 1346 | * @param: nodeType (string) Instance type |
| 1347 | * @param: version (string) Metal version to use |
| 1348 | * @return ([]string) List of selected metros |
| 1349 | * |
| 1350 | **/ |
| 1351 | def getEquinixMetroWithCapacity(metroCount = 1, nodeCount = 50, nodeType = 'c3.small.x86', version = '0.9.0') { |
| 1352 | def common = new com.mirantis.mk.Common() |
| 1353 | def metalUrl = "https://artifactory.mcp.mirantis.net:443/artifactory/binary-dev-kaas-local/core/bin/mirror/metal-${version}-linux" |
| 1354 | def metal = './metal --config metal.yaml' |
| 1355 | def metro = [] |
| 1356 | def out = '' |
| 1357 | def retries = 3 // number of retries |
| 1358 | def i = 0 |
| 1359 | def delay = 60 // 1 minute sleep |
| 1360 | def excludeMetro = [] // list of metros to exclude from selection |
| 1361 | try { |
| 1362 | if (excludeMetro.size() > 0) { |
| 1363 | common.infoMsg("Excluded metros: ${excludeMetros}") |
| 1364 | } |
| 1365 | sh "curl -o metal -# ${metalUrl} && chmod +x metal" |
| 1366 | withCredentials([string(credentialsId: env.KAAS_EQUINIX_API_TOKEN, variable: 'KAAS_EQUINIX_API_TOKEN')]) { |
| 1367 | sh 'echo "project-id: ${KAAS_EQUINIX_PROJECT_ID}\ntoken: ${KAAS_EQUINIX_API_TOKEN}" >metal.yaml' |
| 1368 | } |
| 1369 | while (metro.size() < metroCount && i < retries) { |
| 1370 | common.infoMsg("Selecting ${metroCount} available Equinix metros with free ${nodeCount} ${nodeType} hosts, try ${i+1}/${retries} ...") |
| 1371 | if (i > 0) { // skip sleep on first step |
| 1372 | sleep(delay) |
| 1373 | } |
| 1374 | out = sh(script: "${metal} capacity get -m -P ${nodeType}|awk '/${nodeType}/ {print \$2}'|paste -s -d,|xargs ${metal} capacity check -P ${nodeType} -q ${nodeCount} -m|grep true|awk '{print \$2}'|paste -s -d,", returnStdout: true).trim() |
| 1375 | metro = out.tokenize(',') |
| 1376 | metro -= excludeMetro |
| 1377 | if (metro.size() < metroCount) { |
| 1378 | nodeCount -= 10 |
| 1379 | // We need different metros for the [equinixmetalv2-child-diff-metro] case |
| 1380 | } else if (metro.size() == 2 && metro[0][0, 1] == metro[1][0, 1]) { |
| 1381 | nodeCount -= 10 |
| 1382 | } |
| 1383 | i++ |
| 1384 | } |
| 1385 | if (metro.size() > 0) { |
eromanova | efbbb42 | 2023-11-24 13:54:35 +0400 | [diff] [blame] | 1386 | m = metro.size() > 1 ? "${metro[0]},${metro[1]}" : "${metro[0]}" |
| 1387 | sh "${metal} capacity check -P ${nodeType} -m ${m} -q ${nodeCount}" |
eromanova | b24cb23 | 2023-11-17 12:17:06 +0400 | [diff] [blame] | 1388 | } |
| 1389 | } catch (Exception e) { |
| 1390 | common.errorMsg "Exception: '${e}'" |
| 1391 | return [] |
| 1392 | } finally { |
| 1393 | sh 'rm metal.yaml' |
| 1394 | } |
| 1395 | if (metro.size() > 0) { |
| 1396 | Collections.shuffle(metro) |
| 1397 | common.infoMsg("Selected metros: ${metro}") |
| 1398 | } else { |
| 1399 | common.warningMsg('No any metros have been selected !!! :(') |
| 1400 | } |
| 1401 | return metro |
| 1402 | } |
| 1403 | |
| 1404 | |
| 1405 | /** |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1406 | * getEquinixFacilityWithCapacity returns list of Equinix facilities using specified |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1407 | * instance type (nodeType), desired count of facilities (facilityCount) and |
| 1408 | * instances (nodeCount) in a facility using specified matal version. |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1409 | * Function downloads metal CLI from the |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1410 | * https://artifactory.mcp.mirantis.net:443/artifactory/binary-dev-kaas-local/core/bin/mirror/metal-${version}-linux |
| 1411 | * Empty list is returned in case of no facilities with specified capacity was found or any other errors. |
Sergey Zhemerdeev | 15aa860 | 2022-10-13 11:10:02 +0300 | [diff] [blame] | 1412 | * Non-empty list is shuffled. |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1413 | * |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1414 | * @param: facilityCount (int) Desired count of facilities |
| 1415 | * @param: nodeCount (int) Desired count of instances |
| 1416 | * @param: nodeType (string) Instance type |
| 1417 | * @param: version (string) Metal version to use |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1418 | * @return ([]string) List of selected facilities |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1419 | * |
| 1420 | **/ |
eromanova | b24cb23 | 2023-11-17 12:17:06 +0400 | [diff] [blame] | 1421 | @Deprecated |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1422 | def getEquinixFacilityWithCapacity(facilityCount = 1, nodeCount = 50, nodeType = 'c3.small.x86', version = '0.9.0') { |
eromanova | b24cb23 | 2023-11-17 12:17:06 +0400 | [diff] [blame] | 1423 | common.warningMsg('You are using deprecated method getEquinixFacilityWithCapacity. Use getEquinixMetroWithCapacity instead') |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1424 | def common = new com.mirantis.mk.Common() |
| 1425 | def metalUrl = "https://artifactory.mcp.mirantis.net:443/artifactory/binary-dev-kaas-local/core/bin/mirror/metal-${version}-linux" |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1426 | def metal = './metal --config metal.yaml' |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1427 | def facility = [] |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1428 | def out = '' |
Sergey Zhemerdeev | bcccb91 | 2022-08-25 14:26:52 +0300 | [diff] [blame] | 1429 | def retries = 3 // number of retries |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1430 | def i = 0 |
| 1431 | def delay = 60 // 1 minute sleep |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1432 | def excludeFacility = [] // list of facilities to exclude from selection |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1433 | try { |
Sergey Zhemerdeev | b357534 | 2022-10-04 11:02:19 +0300 | [diff] [blame] | 1434 | if (excludeFacility.size() > 0) { |
| 1435 | common.infoMsg("Excluded facilities: ${excludeFacility}") |
| 1436 | } |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1437 | sh "curl -o metal -# ${metalUrl} && chmod +x metal" |
| 1438 | withCredentials([string(credentialsId: env.KAAS_EQUINIX_API_TOKEN, variable: 'KAAS_EQUINIX_API_TOKEN')]) { |
| 1439 | sh 'echo "project-id: ${KAAS_EQUINIX_PROJECT_ID}\ntoken: ${KAAS_EQUINIX_API_TOKEN}" >metal.yaml' |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1440 | } |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1441 | while (facility.size() < facilityCount && i < retries) { |
| 1442 | common.infoMsg("Selecting ${facilityCount} available Equinix facilities with free ${nodeCount} ${nodeType} hosts, try ${i+1}/${retries} ...") |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1443 | if (i > 0 ) { // skip sleep on first step |
| 1444 | sleep(delay) |
| 1445 | } |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1446 | out = sh(script: "${metal} capacity get -f -P ${nodeType}|awk '/${nodeType}/ {print \$2}'|paste -s -d,|xargs ${metal} capacity check -P ${nodeType} -q ${nodeCount} -f|grep true|awk '{print \$2}'|paste -s -d,", returnStdout: true).trim() |
| 1447 | facility = out.tokenize(',') |
Sergey Zhemerdeev | b357534 | 2022-10-04 11:02:19 +0300 | [diff] [blame] | 1448 | facility -= excludeFacility |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1449 | if (facility.size() < facilityCount) { |
| 1450 | nodeCount -= 10 |
| 1451 | // We need different metros for the [equinixmetalv2-child-diff-metro] case, facility[][0, 1] contains a metro name |
| 1452 | } else if (facility.size() == 2 && facility[0][0, 1] == facility[1][0, 1]) { |
Sergey Zhemerdeev | bcccb91 | 2022-08-25 14:26:52 +0300 | [diff] [blame] | 1453 | nodeCount -= 10 |
| 1454 | } |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1455 | i++ |
| 1456 | } |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1457 | if (facility.size() > 0) { |
| 1458 | f = facility.size() > 1 ? "${facility[0]},${facility[1]}" : "${facility[0]}" |
| 1459 | sh "${metal} capacity check -P ${nodeType} -f ${f} -q ${nodeCount}" |
Sergey Zhemerdeev | bcccb91 | 2022-08-25 14:26:52 +0300 | [diff] [blame] | 1460 | } |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1461 | } catch (Exception e) { |
| 1462 | common.errorMsg "Exception: '${e}'" |
| 1463 | return [] |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1464 | } finally { |
| 1465 | sh 'rm metal.yaml' |
| 1466 | } |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1467 | if (facility.size() > 0) { |
Sergey Zhemerdeev | 15aa860 | 2022-10-13 11:10:02 +0300 | [diff] [blame] | 1468 | Collections.shuffle(facility) |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1469 | common.infoMsg("Selected facilities: ${facility}") |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1470 | } else { |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1471 | common.warningMsg('No any facilities have been selected !!! :(') |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1472 | } |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1473 | return facility |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1474 | } |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1475 | |
| 1476 | |
| 1477 | /** |
| 1478 | * genCommandLine prepares command line for artifactory-replication |
| 1479 | * command using legacy environment variables |
| 1480 | * |
| 1481 | * @return: (string) Prepared command line |
| 1482 | */ |
| 1483 | def genCommandLine() { |
| 1484 | def envToParam = [ |
| 1485 | 'DESTINATION_USER': '-dst-user', |
| 1486 | 'ARTIFACT_FILTER': '-artifact-filter', |
| 1487 | 'ARTIFACT_FILTER_PROD': '-artifact-filter-prod', |
| 1488 | 'ARTIFACT_TYPE': '-artifact-type', |
| 1489 | 'BINARY_CLEAN': '-bin-cleanup', |
| 1490 | 'BINARY_CLEAN_KEEP_DAYS': '-bin-clean-keep-days', |
| 1491 | 'BINARY_CLEAN_PREFIX': '-bin-clean-prefix', |
| 1492 | 'BUILD_URL': '-slack-build-url', |
| 1493 | 'CHECK_REPOS': '-check-repos', |
| 1494 | 'DESTINATION_REGISTRY': '-dst-repo', |
| 1495 | 'DESTINATION_REGISTRY_TYPE': '-dst-repo-type', |
| 1496 | 'DOCKER_CLEAN': '-cleanup', |
| 1497 | 'DOCKER_REPO_PREFIX': '-docker-repo-prefix', |
| 1498 | 'DOCKER_TAG': '-docker-tag', |
| 1499 | 'FORCE': '-force', |
| 1500 | 'HELM_CDN_DOMAIN': '-helm-cdn-domain', |
| 1501 | 'SLACK_CHANNEL': '-slack-channel', |
| 1502 | 'SLACK_USER': '-slack-user', |
| 1503 | 'SOURCE_REGISTRY': '-src-repo', |
| 1504 | 'SOURCE_REGISTRY_TYPE': '-src-repo-type', |
| 1505 | 'SYNC_PATTERN': '-sync-pattern' |
| 1506 | ] |
| 1507 | def cmdParams = '' |
Sergey Zhemerdeev | 88d1c3d | 2022-08-31 16:37:48 +0300 | [diff] [blame] | 1508 | def isCheckClean = false |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1509 | for (e in envToParam) { |
| 1510 | if (env[e.key] == null) { |
| 1511 | continue |
| 1512 | } |
| 1513 | if (e.key == 'CHECK_REPOS' || e.key == 'DOCKER_CLEAN') { |
Sergey Zhemerdeev | 88d1c3d | 2022-08-31 16:37:48 +0300 | [diff] [blame] | 1514 | // Avoid CHECK_REPOS=true and DOCKER_CLEAN=true |
| 1515 | if (env[e.key].toBoolean() && !isCheckClean) { |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1516 | cmdParams += e.value + ' ' |
Sergey Zhemerdeev | 88d1c3d | 2022-08-31 16:37:48 +0300 | [diff] [blame] | 1517 | isCheckClean = true |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1518 | } |
| 1519 | } else if (e.key == 'FORCE') { |
| 1520 | if (env[e.key].toBoolean()) { |
| 1521 | cmdParams += e.value + ' ' |
| 1522 | } |
| 1523 | } else { |
Sergey Zhemerdeev | e2926cd | 2022-08-29 15:28:47 +0300 | [diff] [blame] | 1524 | cmdParams += "${e.value} '${env[e.key]}' " |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1525 | } |
| 1526 | } |
Sergey Zhemerdeev | 88d1c3d | 2022-08-31 16:37:48 +0300 | [diff] [blame] | 1527 | // No any check or clean was specified - take a default action |
| 1528 | if (!isCheckClean) { |
| 1529 | cmdParams += '-replicate' |
| 1530 | } |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1531 | return cmdParams |
| 1532 | } |
Sergey Kolekonov | 0e60a94 | 2022-09-05 13:02:22 +0400 | [diff] [blame] | 1533 | |
| 1534 | /** |
| 1535 | * custom scheduling algorithm |
| 1536 | * it ensures that builds of the same job are distributed as much as possible between different nodes |
| 1537 | * @param label (string) desired node label |
| 1538 | * @return: (string) node name |
| 1539 | */ |
| 1540 | def schedule (label='docker') { |
| 1541 | def common = new com.mirantis.mk.Common() |
| 1542 | def freeNodes = [] |
| 1543 | def nodesMap = [:] |
| 1544 | |
| 1545 | // filter nodes with the specified label and at least one free executor |
| 1546 | timeout(time: 30, unit: 'MINUTES') { |
| 1547 | while (!freeNodes) { |
| 1548 | freeNodes = jenkins.model.Jenkins.instance.computers.findAll { node -> |
| 1549 | label in node.getAssignedLabels().collect { it.name } && |
Sergey Kolekonov | d588717 | 2022-11-10 12:13:22 +0600 | [diff] [blame] | 1550 | node.isPartiallyIdle() && |
| 1551 | node.isOnline() |
Sergey Kolekonov | 0e60a94 | 2022-09-05 13:02:22 +0400 | [diff] [blame] | 1552 | } |
| 1553 | if (!freeNodes) { |
| 1554 | echo 'No nodes available for scheduling, retrying...' |
| 1555 | sleep 30 |
| 1556 | } |
| 1557 | } |
| 1558 | } |
| 1559 | |
| 1560 | // generate a map of nodes matching other criteria |
| 1561 | for (node in freeNodes) { |
| 1562 | // sameJobExecutors is the number of executors running the same job as the calling one |
| 1563 | sameJobExecutors = node.getExecutors() // get all executors |
| 1564 | .collect { executor -> executor.getCurrentExecutable() } // get running "threads" |
| 1565 | .collect { thread -> thread?.displayName } // filter job names from threads |
| 1566 | .minus(null) // null = empty executors, remove them from the list |
| 1567 | .findAll { it.contains(env.JOB_NAME) } // filter the same jobs as the calling one |
| 1568 | .size() |
| 1569 | |
| 1570 | // calculate busy executors, we don't want to count "sameJobExecutors" twice |
| 1571 | totalBusyExecutors = node.countBusy() - sameJobExecutors |
| 1572 | // generate the final map which contains nodes matching criteria with their load score |
| 1573 | // builds of the same jobs have x10 score, all others x1 |
| 1574 | nodesMap += ["${node.getName()}" : sameJobExecutors * 10 + totalBusyExecutors] |
| 1575 | } |
| 1576 | |
| 1577 | // return the least loaded node |
| 1578 | return common.SortMapByValueAsc(nodesMap).collect { it.key }[0] |
| 1579 | } |
Sergey Zhemerdeev | 78a6527 | 2023-03-23 18:05:22 +0200 | [diff] [blame] | 1580 | |
| 1581 | |
| 1582 | /** |
| 1583 | * Get latest tag for test/frontend & equinix-private-infra images |
| 1584 | * @param version (str) default tag value from main workflow |
| 1585 | * @param isChanged (bool) is dependent directory files were changed |
| 1586 | * @param imageName (string) image name for information message |
| 1587 | * @return: (string) tag name |
| 1588 | */ |
| 1589 | def getImageTag(version, isChanged, imageName) { |
| 1590 | def common = new com.mirantis.mk.Common() |
Sergey Zhemerdeev | 5fbf202 | 2023-04-28 14:51:36 +0300 | [diff] [blame] | 1591 | def latestTag = '' |
| 1592 | if (env.GERRIT_EVENT_TYPE && !(env.GERRIT_EVENT_TYPE in ['change-merged', 'ref-updated']) && isChanged) { |
Sergey Zhemerdeev | 78a6527 | 2023-03-23 18:05:22 +0200 | [diff] [blame] | 1593 | latestTag = version |
Sergey Zhemerdeev | ebdcad2 | 2023-04-25 16:58:28 +0300 | [diff] [blame] | 1594 | } else { |
| 1595 | if (env.GERRIT_EVENT_TYPE == 'ref-updated') { |
| 1596 | latestTag = env.GERRIT_REFNAME.replace('refs/tags/v', '').trim() |
| 1597 | } else { |
| 1598 | latestTag = env.GERRIT_BRANCH ? env.GERRIT_BRANCH : env.GERRIT_REFSPEC ? env.GERRIT_REFSPEC : 'master' |
| 1599 | if (latestTag != 'master') { |
| 1600 | latestTag = latestTag.replaceAll('/', '_') |
| 1601 | } |
| 1602 | } |
Sergey Zhemerdeev | 78a6527 | 2023-03-23 18:05:22 +0200 | [diff] [blame] | 1603 | } |
| 1604 | common.infoMsg("${imageName} image will use tag '${latestTag}'") |
| 1605 | return latestTag |
| 1606 | } |
Sergey Zhemerdeev | 1d2c03e | 2023-04-28 11:07:24 +0300 | [diff] [blame] | 1607 | |
| 1608 | |
| 1609 | /** |
| 1610 | * Translates set of environment vars into actual replicator command line |
| 1611 | * @return: (string cmdParams, string jobDescription) |
| 1612 | * cmdParams - generated command line |
| 1613 | * jobDescription - job description |
| 1614 | */ |
| 1615 | def genReplicatorCommandLine() { |
| 1616 | def mainModes = ['REPLICATE', 'CLEANUP', 'CHECK_REPOS', 'BIN_CLEANUP'] |
Sergey Zhemerdeev | 9919b1b | 2023-04-28 17:24:21 +0300 | [diff] [blame] | 1617 | def parameterWithoutArgument = mainModes |
Sergey Zhemerdeev | 1d2c03e | 2023-04-28 11:07:24 +0300 | [diff] [blame] | 1618 | def parametersList = parameterWithoutArgument + [ |
| 1619 | 'ARTIFACT_FILTER', |
| 1620 | 'ARTIFACT_TYPE', |
| 1621 | 'BIN_CLEAN_KEEP_DAYS', |
| 1622 | 'BIN_CLEAN_PREFIX', |
| 1623 | 'DOCKER_TAG', |
| 1624 | // DST_ will be changed to TARGET_ |
| 1625 | 'DST_REPO', |
| 1626 | 'DST_REPO_TYPE', |
| 1627 | 'DST_USER', |
| 1628 | 'OLDER_THAN_DAYS', |
| 1629 | 'SLACK_BUILD_URL', |
| 1630 | 'SLACK_CHANNEL', |
| 1631 | 'SLACK_USER', |
| 1632 | 'SRC_REPO', |
| 1633 | 'SRC_REPO_TYPE', |
| 1634 | 'SRC_USER', |
| 1635 | 'SYNC_PATTERN', |
| 1636 | 'THREAD_COUNT' |
| 1637 | ] |
| 1638 | def mainModesDescriptions = [ |
| 1639 | 'REPLICATE': 'Replicating binaries/Docker images', |
| 1640 | 'CLEANUP': 'Cleaning Docker images', |
| 1641 | 'BIN_CLEANUP': 'Cleaning binaries', |
| 1642 | 'CHECK_REPOS': 'Checking binaries' |
| 1643 | ] |
| 1644 | |
| 1645 | def cmdParams = '' |
| 1646 | def jobDescription = '' |
| 1647 | for (e in parametersList) { |
| 1648 | if (env[e] == null || env[e] == '') { |
| 1649 | continue |
| 1650 | } |
| 1651 | if (e in mainModes) { |
| 1652 | jobDescription = mainModesDescriptions[e] |
| 1653 | } |
| 1654 | cmdParams += "-${e.replaceAll('_', '-').toLowerCase()} " |
| 1655 | if (!(e in parameterWithoutArgument)) { |
| 1656 | cmdParams += "'${env[e]}' " |
| 1657 | } |
| 1658 | } |
| 1659 | return [cmdParams, jobDescription] |
| 1660 | } |