Vladimir Khlyunev | a66f410 | 2023-07-10 14:35:48 +0400 | [diff] [blame] | 1 | /* |
| 2 | * DEPLOY_EMPTY_NODE Add extra node to heat stack. Node without a role and with salt-minion |
| 3 | */ |
| 4 | |
| 5 | @Library('tcp-qa')_ |
| 6 | |
| 7 | def common = new com.mirantis.mk.Common() |
| 8 | def shared = new com.mirantis.system_qa.SharedPipeline() |
| 9 | |
| 10 | def batch_size = env.BATCH_SIZE ?: '' |
| 11 | def dist_upgrade_nodes = "${env.DIST_UPGRADE_NODES}" != "false" ? true : false |
| 12 | env.LAB_CONFIG_NAME = 'cookied-model-generator' |
| 13 | |
| 14 | timeout(time: 23, unit: 'HOURS') { |
| 15 | node ("${NODE_NAME}") { |
| 16 | env.slave_workdir = pwd() |
| 17 | |
| 18 | def inject_env_vars = [ |
| 19 | 'VENV_PATH=/home/jenkins/fuel-devops30', |
| 20 | "ENV_NAME=swarm_model_${BUILD_NUMBER}", |
| 21 | 'LAB_CONFIG_NAME=cookied-model-generator', |
| 22 | "SALT_STEPS_PATH=templates/${LAB_CONFIG_NAME}/salt_${LAB_CONTEXT_NAME}.yaml", |
| 23 | 'TEST_GROUP=test_generate_model', |
| 24 | 'PYTHONIOENCODING=UTF-8', |
| 25 | 'MAKE_SNAPSHOT_STAGES=false', |
| 26 | 'DEVOPS_LOCK_FILE=/run/lock/devops_lock', |
| 27 | ] |
| 28 | |
| 29 | withEnv(inject_env_vars) { |
Vladimir Khlyunev | 7f7fcc6 | 2023-07-11 17:35:08 +0400 | [diff] [blame] | 30 | withCredentials([[$class: 'SSHUserPrivateKeyBinding', |
| 31 | credentialsId : 'f4fb9dd6-ba63-4085-82f7-3fa601334d95', |
| 32 | keyFileVariable: "COOKIECUTTER_TEMPLATES_REPOSITORY_KEY_PATH"]]) { |
| 33 | try { |
| 34 | checkout scm |
| 35 | sshagent(credentials: ['f4fb9dd6-ba63-4085-82f7-3fa601334d95']) { |
| 36 | sh "/bin/bash ./jobs/pipelines/cookied-model-generator.sh" |
Vladimir Khlyunev | a66f410 | 2023-07-10 14:35:48 +0400 | [diff] [blame] | 37 | } |
Vladimir Khlyunev | 7f7fcc6 | 2023-07-11 17:35:08 +0400 | [diff] [blame] | 38 | } finally { |
| 39 | dir("${env.slave_workdir }") { |
| 40 | archiveArtifacts artifacts: 'tcp_tests/*.log,tcp_tests/*.tar.gz,tcp_tests/*.xml' |
| 41 | venv_cmd = "source ${VENV_PATH}/bin/activate" |
| 42 | if (env.SHUTDOWN_ENV_ON_TEARDOWN.toBoolean()){ |
| 43 | sh "${venv_cmd} && dos.py destroy ${ENV_NAME}" |
| 44 | } |
| 45 | if (env.ERASE_ENVIRONMENT_AFTER_BUILD.toBoolean()){ |
Vladimir Khlyunev | b0d8cf2 | 2023-07-20 17:43:27 +0300 | [diff] [blame] | 46 | sh "${venv_cmd} && dos.py erase ${ENV_NAME}" |
Vladimir Khlyunev | 7f7fcc6 | 2023-07-11 17:35:08 +0400 | [diff] [blame] | 47 | } |
Vladimir Khlyunev | a66f410 | 2023-07-10 14:35:48 +0400 | [diff] [blame] | 48 | } |
Vladimir Khlyunev | 7f7fcc6 | 2023-07-11 17:35:08 +0400 | [diff] [blame] | 49 | } //try |
| 50 | } // withCredentials |
Vladimir Khlyunev | a66f410 | 2023-07-10 14:35:48 +0400 | [diff] [blame] | 51 | } // withEnv |
| 52 | } // node |
| 53 | } // timeout |