blob: 4e5b328fafb3d785a68eaf8ffd858887e70b771d [file] [log] [blame]
Vladimir Khlyuneva66f4102023-07-10 14:35:48 +04001/*
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
7def common = new com.mirantis.mk.Common()
8def shared = new com.mirantis.system_qa.SharedPipeline()
9
10def batch_size = env.BATCH_SIZE ?: ''
11def dist_upgrade_nodes = "${env.DIST_UPGRADE_NODES}" != "false" ? true : false
12env.LAB_CONFIG_NAME = 'cookied-model-generator'
13
14timeout(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 Khlyunev7f7fcc62023-07-11 17:35:08 +040030 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 Khlyuneva66f4102023-07-10 14:35:48 +040037 }
Vladimir Khlyunev7f7fcc62023-07-11 17:35:08 +040038 } 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 Khlyunevb0d8cf22023-07-20 17:43:27 +030046 sh "${venv_cmd} && dos.py erase ${ENV_NAME}"
Vladimir Khlyunev7f7fcc62023-07-11 17:35:08 +040047 }
Vladimir Khlyuneva66f4102023-07-10 14:35:48 +040048 }
Vladimir Khlyunev7f7fcc62023-07-11 17:35:08 +040049 } //try
50 } // withCredentials
Vladimir Khlyuneva66f4102023-07-10 14:35:48 +040051 } // withEnv
52 } // node
53} // timeout