Removed timestamps from cloud deploy pipeline

Change-Id: Ib2ca2e1df1c9aa58b835f03092344cb7185b1dc8
diff --git a/cloud-deploy-pipeline.groovy b/cloud-deploy-pipeline.groovy
index 235380f..6ce96c1 100644
--- a/cloud-deploy-pipeline.groovy
+++ b/cloud-deploy-pipeline.groovy
@@ -69,376 +69,374 @@
     def aws_env_vars
 }
 
-timestamps {
-    node("python") {
-        try {
-            // Set build-specific variables
-            venv = "${env.WORKSPACE}/venv"
+node("python") {
+    try {
+        // Set build-specific variables
+        venv = "${env.WORKSPACE}/venv"
 
-            //
-            // Prepare machines
-            //
-            stage ('Create infrastructure') {
+        //
+        // Prepare machines
+        //
+        stage ('Create infrastructure') {
 
-                if (STACK_TYPE == 'heat') {
-                    // value defaults
-                    def openstackCloud
+            if (STACK_TYPE == 'heat') {
+                // value defaults
+                def openstackCloud
 
-                    if (STACK_REUSE.toBoolean() == true && STACK_NAME == '') {
-                        error("If you want to reuse existing stack you need to provide it's name")
+                if (STACK_REUSE.toBoolean() == true && STACK_NAME == '') {
+                    error("If you want to reuse existing stack you need to provide it's name")
+                }
+
+                if (STACK_REUSE.toBoolean() == false) {
+                    // Don't allow to set custom heat stack name
+                    wrap([$class: 'BuildUser']) {
+                        if (env.BUILD_USER_ID) {
+                            STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
+                        } else {
+                            STACK_NAME = "jenkins-${JOB_NAME}-${BUILD_NUMBER}"
+                        }
+                        currentBuild.description = STACK_NAME
                     }
+                }
 
-                    if (STACK_REUSE.toBoolean() == false) {
-                        // Don't allow to set custom heat stack name
-                        wrap([$class: 'BuildUser']) {
-                            if (env.BUILD_USER_ID) {
-                                STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
-                            } else {
-                                STACK_NAME = "jenkins-${JOB_NAME}-${BUILD_NUMBER}"
-                            }
-                            currentBuild.description = STACK_NAME
+                // set description
+                currentBuild.description = "${STACK_NAME}"
+
+                // get templates
+                git.checkoutGitRepository('template', STACK_TEMPLATE_URL, STACK_TEMPLATE_BRANCH, STACK_TEMPLATE_CREDENTIALS)
+
+                // create openstack env
+                openstack.setupOpenstackVirtualenv(venv, OPENSTACK_API_CLIENT)
+                openstackCloud = openstack.createOpenstackEnv(
+                    OPENSTACK_API_URL, OPENSTACK_API_CREDENTIALS,
+                    OPENSTACK_API_PROJECT, OPENSTACK_API_PROJECT_DOMAIN,
+                    OPENSTACK_API_PROJECT_ID, OPENSTACK_API_USER_DOMAIN,
+                    OPENSTACK_API_VERSION)
+                openstack.getKeystoneToken(openstackCloud, venv)
+                //
+                // Verify possibility of create stack for given user and stack type
+                //
+                wrap([$class: 'BuildUser']) {
+                    if (env.BUILD_USER_ID && !env.BUILD_USER_ID.equals("jenkins") && !STACK_REUSE.toBoolean()) {
+                        def existingStacks = openstack.getStacksForNameContains(openstackCloud, "${env.BUILD_USER_ID}-${JOB_NAME}", venv)
+                        if(existingStacks.size() >= _MAX_PERMITTED_STACKS){
+                            STACK_DELETE = "false"
+                            throw new Exception("You cannot create new stack, you already have ${_MAX_PERMITTED_STACKS} stacks of this type (${JOB_NAME}). \nStack names: ${existingStacks}")
+                        }
+                    }
+                }
+                // launch stack
+                if (STACK_REUSE.toBoolean() == false) {
+                    stage('Launch new Heat stack') {
+                        envParams = [
+                            'cluster_zone': HEAT_STACK_ZONE,
+                            'cluster_public_net': HEAT_STACK_PUBLIC_NET
+                        ]
+
+                        // set reclass repo in heat env
+                        try {
+                            envParams.put('cfg_reclass_branch', STACK_RECLASS_BRANCH)
+                            envParams.put('cfg_reclass_address', STACK_RECLASS_ADDRESS)
+                        } catch (MissingPropertyException e) {
+                            common.infoMsg("Property STACK_RECLASS_BRANCH or STACK_RECLASS_ADDRESS not found! Using default values from template.")
+                        }
+
+                        openstack.createHeatStack(openstackCloud, STACK_NAME, STACK_TEMPLATE, envParams, HEAT_STACK_ENVIRONMENT, venv, false)
+                    }
+                }
+
+                // get SALT_MASTER_URL
+                saltMasterHost = openstack.getHeatStackOutputParam(openstackCloud, STACK_NAME, 'salt_master_ip', venv)
+                currentBuild.description = "${STACK_NAME} ${saltMasterHost}"
+
+                SALT_MASTER_URL = "http://${saltMasterHost}:6969"
+
+            } else if (STACK_TYPE == 'aws') {
+
+                // setup environment
+                aws.setupVirtualEnv(venv)
+
+                // set aws_env_vars
+                aws_env_vars = aws.getEnvVars(AWS_API_CREDENTIALS, AWS_STACK_REGION)
+
+                if (STACK_REUSE.toBoolean() == true && STACK_NAME == '') {
+                    error("If you want to reuse existing stack you need to provide it's name")
+                }
+
+                if (STACK_REUSE.toBoolean() == false) {
+                    // Don't allow to set custom stack name
+                    wrap([$class: 'BuildUser']) {
+                        if (env.BUILD_USER_ID) {
+                            STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
+                        } else {
+                            STACK_NAME = "jenkins-${JOB_NAME}-${BUILD_NUMBER}"
                         }
                     }
 
-                    // set description
-                    currentBuild.description = "${STACK_NAME}"
+                    // no underscore in STACK_NAME
+                    STACK_NAME = STACK_NAME.replaceAll('_', '-')
+                }
 
+                // set description
+                currentBuild.description = STACK_NAME
+
+                if (STACK_REUSE.toBoolean() == false) {
                     // get templates
                     git.checkoutGitRepository('template', STACK_TEMPLATE_URL, STACK_TEMPLATE_BRANCH, STACK_TEMPLATE_CREDENTIALS)
 
-                    // create openstack env
-                    openstack.setupOpenstackVirtualenv(venv, OPENSTACK_API_CLIENT)
-                    openstackCloud = openstack.createOpenstackEnv(
-                        OPENSTACK_API_URL, OPENSTACK_API_CREDENTIALS,
-                        OPENSTACK_API_PROJECT, OPENSTACK_API_PROJECT_DOMAIN,
-                        OPENSTACK_API_PROJECT_ID, OPENSTACK_API_USER_DOMAIN,
-                        OPENSTACK_API_VERSION)
-                    openstack.getKeystoneToken(openstackCloud, venv)
-                    //
-                    // Verify possibility of create stack for given user and stack type
-                    //
-                    wrap([$class: 'BuildUser']) {
-                        if (env.BUILD_USER_ID && !env.BUILD_USER_ID.equals("jenkins") && !STACK_REUSE.toBoolean()) {
-                            def existingStacks = openstack.getStacksForNameContains(openstackCloud, "${env.BUILD_USER_ID}-${JOB_NAME}", venv)
-                            if(existingStacks.size() >= _MAX_PERMITTED_STACKS){
-                                STACK_DELETE = "false"
-                                throw new Exception("You cannot create new stack, you already have ${_MAX_PERMITTED_STACKS} stacks of this type (${JOB_NAME}). \nStack names: ${existingStacks}")
-                            }
-                        }
-                    }
-                    // launch stack
-                    if (STACK_REUSE.toBoolean() == false) {
-                        stage('Launch new Heat stack') {
-                            envParams = [
-                                'cluster_zone': HEAT_STACK_ZONE,
-                                'cluster_public_net': HEAT_STACK_PUBLIC_NET
-                            ]
-
-                            // set reclass repo in heat env
-                            try {
-                                envParams.put('cfg_reclass_branch', STACK_RECLASS_BRANCH)
-                                envParams.put('cfg_reclass_address', STACK_RECLASS_ADDRESS)
-                            } catch (MissingPropertyException e) {
-                                common.infoMsg("Property STACK_RECLASS_BRANCH or STACK_RECLASS_ADDRESS not found! Using default values from template.")
-                            }
-
-                            openstack.createHeatStack(openstackCloud, STACK_NAME, STACK_TEMPLATE, envParams, HEAT_STACK_ENVIRONMENT, venv, false)
-                        }
-                    }
-
-                    // get SALT_MASTER_URL
-                    saltMasterHost = openstack.getHeatStackOutputParam(openstackCloud, STACK_NAME, 'salt_master_ip', venv)
-                    currentBuild.description = "${STACK_NAME} ${saltMasterHost}"
-
-                    SALT_MASTER_URL = "http://${saltMasterHost}:6969"
-
-                } else if (STACK_TYPE == 'aws') {
-
-                    // setup environment
-                    aws.setupVirtualEnv(venv)
-
-                    // set aws_env_vars
-                    aws_env_vars = aws.getEnvVars(AWS_API_CREDENTIALS, AWS_STACK_REGION)
-
-                    if (STACK_REUSE.toBoolean() == true && STACK_NAME == '') {
-                        error("If you want to reuse existing stack you need to provide it's name")
-                    }
-
-                    if (STACK_REUSE.toBoolean() == false) {
-                        // Don't allow to set custom stack name
-                        wrap([$class: 'BuildUser']) {
-                            if (env.BUILD_USER_ID) {
-                                STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
-                            } else {
-                                STACK_NAME = "jenkins-${JOB_NAME}-${BUILD_NUMBER}"
-                            }
-                        }
-
-                        // no underscore in STACK_NAME
-                        STACK_NAME = STACK_NAME.replaceAll('_', '-')
-                    }
-
-                    // set description
-                    currentBuild.description = STACK_NAME
-
-                    if (STACK_REUSE.toBoolean() == false) {
-                        // get templates
-                        git.checkoutGitRepository('template', STACK_TEMPLATE_URL, STACK_TEMPLATE_BRANCH, STACK_TEMPLATE_CREDENTIALS)
-
-                        // start stack
-                        def stack_params = [
-                            "ParameterKey=KeyName,ParameterValue=" + AWS_SSH_KEY,
-                            "ParameterKey=CmpNodeCount,ParameterValue=" + STACK_COMPUTE_COUNT
-                        ]
-                        def template_file = 'cfn/' + STACK_TEMPLATE + '.yml'
-                        aws.createStack(venv, aws_env_vars, template_file, STACK_NAME, stack_params)
-                    }
-
-                    // wait for stack to be ready
-                    aws.waitForStatus(venv, aws_env_vars, STACK_NAME, 'CREATE_COMPLETE')
-
-                    // get outputs
-                    saltMasterHost = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'SaltMasterIP')
-                    currentBuild.description = "${STACK_NAME} ${saltMasterHost}"
-                    SALT_MASTER_URL = "http://${saltMasterHost}:6969"
-
-                } else if (STACK_TYPE != 'physical') {
-                    throw new Exception("STACK_TYPE ${STACK_TYPE} is not supported")
+                    // start stack
+                    def stack_params = [
+                        "ParameterKey=KeyName,ParameterValue=" + AWS_SSH_KEY,
+                        "ParameterKey=CmpNodeCount,ParameterValue=" + STACK_COMPUTE_COUNT
+                    ]
+                    def template_file = 'cfn/' + STACK_TEMPLATE + '.yml'
+                    aws.createStack(venv, aws_env_vars, template_file, STACK_NAME, stack_params)
                 }
 
-                // Connect to Salt master
-                saltMaster = salt.connection(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
+                // wait for stack to be ready
+                aws.waitForStatus(venv, aws_env_vars, STACK_NAME, 'CREATE_COMPLETE')
+
+                // get outputs
+                saltMasterHost = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'SaltMasterIP')
+                currentBuild.description = "${STACK_NAME} ${saltMasterHost}"
+                SALT_MASTER_URL = "http://${saltMasterHost}:6969"
+
+            } else if (STACK_TYPE != 'physical') {
+                throw new Exception("STACK_TYPE ${STACK_TYPE} is not supported")
             }
 
+            // Connect to Salt master
+            saltMaster = salt.connection(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
+        }
 
-            // Set up override params
-            if (env.getEnvironment().containsKey('SALT_OVERRIDES')) {
-                stage('Set Salt overrides') {
-                    salt.setSaltOverrides(saltMaster,  SALT_OVERRIDES)
-                }
+
+        // Set up override params
+        if (env.getEnvironment().containsKey('SALT_OVERRIDES')) {
+            stage('Set Salt overrides') {
+                salt.setSaltOverrides(saltMaster,  SALT_OVERRIDES)
             }
+        }
 
-            //
-            // Install
-            //
+        //
+        // Install
+        //
 
-            if (common.checkContains('STACK_INSTALL', 'core')) {
-                stage('Install core infrastructure') {
+        if (common.checkContains('STACK_INSTALL', 'core')) {
+            stage('Install core infrastructure') {
+                orchestrate.installFoundationInfra(saltMaster)
+
+                if (common.checkContains('STACK_INSTALL', 'kvm')) {
+                    orchestrate.installInfraKvm(saltMaster)
                     orchestrate.installFoundationInfra(saltMaster)
+                }
 
-                    if (common.checkContains('STACK_INSTALL', 'kvm')) {
-                        orchestrate.installInfraKvm(saltMaster)
-                        orchestrate.installFoundationInfra(saltMaster)
-                    }
+                orchestrate.validateFoundationInfra(saltMaster)
+            }
+        }
 
-                    orchestrate.validateFoundationInfra(saltMaster)
+        // install k8s
+        if (common.checkContains('STACK_INSTALL', 'k8s')) {
+
+            stage('Install Kubernetes infra') {
+                if (STACK_TYPE == 'aws') {
+                    // configure kubernetes_control_address - save loadbalancer
+                    def kubernetes_control_address = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ControlLoadBalancer')
+                    print(kubernetes_control_address)
+                    salt.runSaltProcessStep(saltMaster, 'I@salt:master', 'reclass.cluster_meta_set', ['kubernetes_control_address', kubernetes_control_address], null, true)
+                }
+
+                // ensure certificates are generated properly
+                salt.runSaltProcessStep(saltMaster, '*', 'saltutil.refresh_pillar', [], null, true)
+                salt.enforceState(saltMaster, '*', ['salt.minion.cert'], true)
+
+                orchestrate.installKubernetesInfra(saltMaster)
+            }
+
+            if (common.checkContains('STACK_INSTALL', 'contrail')) {
+                stage('Install Contrail for Kubernetes') {
+                    orchestrate.installContrailNetwork(saltMaster)
+                    orchestrate.installContrailCompute(saltMaster)
+                    orchestrate.installKubernetesContrailCompute(saltMaster)
                 }
             }
 
-            // install k8s
-            if (common.checkContains('STACK_INSTALL', 'k8s')) {
+            stage('Install Kubernetes control') {
 
-                stage('Install Kubernetes infra') {
+                orchestrate.installKubernetesControl(saltMaster)
+            }
+
+            stage('Scale Kubernetes computes') {
+                if (STACK_COMPUTE_COUNT > 0) {
                     if (STACK_TYPE == 'aws') {
-                        // configure kubernetes_control_address - save loadbalancer
-                        def kubernetes_control_address = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ControlLoadBalancer')
-                        print(kubernetes_control_address)
-                        salt.runSaltProcessStep(saltMaster, 'I@salt:master', 'reclass.cluster_meta_set', ['kubernetes_control_address', kubernetes_control_address], null, true)
+                        // get stack info
+                        def scaling_group = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ComputesScalingGroup')
+
+                        //update autoscaling group
+                        aws.updateAutoscalingGroup(venv, aws_env_vars, scaling_group, ["--desired-capacity " + STACK_COMPUTE_COUNT])
+
+                        // wait for computes to boot up
+                        aws.waitForAutoscalingInstances(venv, aws_env_vars, scaling_group)
+                        sleep(60)
                     }
 
-                    // ensure certificates are generated properly
-                    salt.runSaltProcessStep(saltMaster, '*', 'saltutil.refresh_pillar', [], null, true)
-                    salt.enforceState(saltMaster, '*', ['salt.minion.cert'], true)
-
-                    orchestrate.installKubernetesInfra(saltMaster)
+                    orchestrate.installKubernetesCompute(saltMaster)
                 }
+            }
+        }
+
+        // install openstack
+        if (common.checkContains('STACK_INSTALL', 'openstack')) {
+            // install Infra and control, tests, ...
+
+            stage('Install OpenStack infra') {
+                orchestrate.installOpenstackInfra(saltMaster)
+            }
+
+            stage('Install OpenStack control') {
+                orchestrate.installOpenstackControl(saltMaster)
+            }
+
+            stage('Install OpenStack network') {
 
                 if (common.checkContains('STACK_INSTALL', 'contrail')) {
-                    stage('Install Contrail for Kubernetes') {
-                        orchestrate.installContrailNetwork(saltMaster)
-                        orchestrate.installContrailCompute(saltMaster)
-                        orchestrate.installKubernetesContrailCompute(saltMaster)
-                    }
+                    orchestrate.installContrailNetwork(saltMaster)
+                } else if (common.checkContains('STACK_INSTALL', 'ovs')) {
+                    orchestrate.installOpenstackNetwork(saltMaster)
                 }
 
-                stage('Install Kubernetes control') {
+                salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; neutron net-list'])
+                salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; nova net-list'])
+            }
 
-                    orchestrate.installKubernetesControl(saltMaster)
-                }
-
-                stage('Scale Kubernetes computes') {
-                    if (STACK_COMPUTE_COUNT > 0) {
-                        if (STACK_TYPE == 'aws') {
-                            // get stack info
-                            def scaling_group = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ComputesScalingGroup')
-
-                            //update autoscaling group
-                            aws.updateAutoscalingGroup(venv, aws_env_vars, scaling_group, ["--desired-capacity " + STACK_COMPUTE_COUNT])
-
-                            // wait for computes to boot up
-                            aws.waitForAutoscalingInstances(venv, aws_env_vars, scaling_group)
-                            sleep(60)
-                        }
-
-                        orchestrate.installKubernetesCompute(saltMaster)
-                    }
+            if (salt.testTarget(saltMaster, 'I@ironic:conductor')){
+                stage('Install OpenStack Ironic conductor') {
+                    orchestrate.installIronicConductor(saltMaster)
                 }
             }
 
-            // install openstack
-            if (common.checkContains('STACK_INSTALL', 'openstack')) {
-                // install Infra and control, tests, ...
 
-                stage('Install OpenStack infra') {
-                    orchestrate.installOpenstackInfra(saltMaster)
-                }
+            stage('Install OpenStack compute') {
+                orchestrate.installOpenstackCompute(saltMaster)
 
-                stage('Install OpenStack control') {
-                    orchestrate.installOpenstackControl(saltMaster)
-                }
-
-                stage('Install OpenStack network') {
-
-                    if (common.checkContains('STACK_INSTALL', 'contrail')) {
-                        orchestrate.installContrailNetwork(saltMaster)
-                    } else if (common.checkContains('STACK_INSTALL', 'ovs')) {
-                        orchestrate.installOpenstackNetwork(saltMaster)
-                    }
-
-                    salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; neutron net-list'])
-                    salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; nova net-list'])
-                }
-
-                if (salt.testTarget(saltMaster, 'I@ironic:conductor')){
-                    stage('Install OpenStack Ironic conductor') {
-                        orchestrate.installIronicConductor(saltMaster)
-                    }
-                }
-
-
-                stage('Install OpenStack compute') {
-                    orchestrate.installOpenstackCompute(saltMaster)
-
-                    if (common.checkContains('STACK_INSTALL', 'contrail')) {
-                        orchestrate.installContrailCompute(saltMaster)
-                    }
-                }
-
-            }
-
-
-            if (common.checkContains('STACK_INSTALL', 'sl-legacy')) {
-                stage('Install StackLight v1') {
-                    orchestrate.installStacklightv1Control(saltMaster)
-                    orchestrate.installStacklightv1Client(saltMaster)
+                if (common.checkContains('STACK_INSTALL', 'contrail')) {
+                    orchestrate.installContrailCompute(saltMaster)
                 }
             }
 
-            if (common.checkContains('STACK_INSTALL', 'stacklight')) {
-                stage('Install StackLight') {
-                    orchestrate.installDockerSwarm(saltMaster)
-                    orchestrate.installStacklight(saltMaster)
-                }
+        }
+
+
+        if (common.checkContains('STACK_INSTALL', 'sl-legacy')) {
+            stage('Install StackLight v1') {
+                orchestrate.installStacklightv1Control(saltMaster)
+                orchestrate.installStacklightv1Client(saltMaster)
+            }
+        }
+
+        if (common.checkContains('STACK_INSTALL', 'stacklight')) {
+            stage('Install StackLight') {
+                orchestrate.installDockerSwarm(saltMaster)
+                orchestrate.installStacklight(saltMaster)
+            }
+        }
+
+        //
+        // Test
+        //
+        def artifacts_dir = '_artifacts/'
+
+        if (common.checkContains('STACK_TEST', 'k8s')) {
+            stage('Run k8s bootstrap tests') {
+                def image = 'tomkukral/k8s-scripts'
+                def output_file = image.replaceAll('/', '-') + '.output'
+
+                // run image
+                test.runConformanceTests(saltMaster, TEST_K8S_API_SERVER, image)
+
+                // collect output
+                sh "mkdir -p ${artifacts_dir}"
+                file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
+                writeFile file: "${artifacts_dir}${output_file}", text: file_content
+                sh "cat ${artifacts_dir}${output_file}"
+
+                // collect artifacts
+                archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
             }
 
-            //
-            // Test
-            //
-            def artifacts_dir = '_artifacts/'
+            stage('Run k8s conformance e2e tests') {
+                def image = K8S_CONFORMANCE_IMAGE
+                def output_file = image.replaceAll('/', '-') + '.output'
 
-            if (common.checkContains('STACK_TEST', 'k8s')) {
-                stage('Run k8s bootstrap tests') {
-                    def image = 'tomkukral/k8s-scripts'
-                    def output_file = image.replaceAll('/', '-') + '.output'
+                // run image
+                test.runConformanceTests(saltMaster, TEST_K8S_API_SERVER, image)
 
-                    // run image
-                    test.runConformanceTests(saltMaster, TEST_K8S_API_SERVER, image)
+                // collect output
+                sh "mkdir -p ${artifacts_dir}"
+                file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
+                writeFile file: "${artifacts_dir}${output_file}", text: file_content
+                sh "cat ${artifacts_dir}${output_file}"
 
-                    // collect output
-                    sh "mkdir -p ${artifacts_dir}"
-                    file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
-                    writeFile file: "${artifacts_dir}${output_file}", text: file_content
-                    sh "cat ${artifacts_dir}${output_file}"
+                // collect artifacts
+                archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
+            }
+        }
 
-                    // collect artifacts
-                    archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
-                }
-
-                stage('Run k8s conformance e2e tests') {
-                    def image = K8S_CONFORMANCE_IMAGE
-                    def output_file = image.replaceAll('/', '-') + '.output'
-
-                    // run image
-                    test.runConformanceTests(saltMaster, TEST_K8S_API_SERVER, image)
-
-                    // collect output
-                    sh "mkdir -p ${artifacts_dir}"
-                    file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
-                    writeFile file: "${artifacts_dir}${output_file}", text: file_content
-                    sh "cat ${artifacts_dir}${output_file}"
-
-                    // collect artifacts
-                    archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
-                }
+        if (common.checkContains('STACK_TEST', 'openstack')) {
+            if (common.checkContains('TEST_DOCKER_INSTALL', 'true')) {
+                test.install_docker(saltMaster, TEST_TEMPEST_TARGET)
+            }
+            stage('Run OpenStack tests') {
+                test.runTempestTests(saltMaster, TEST_TEMPEST_IMAGE, TEST_TEMPEST_TARGET, TEST_TEMPEST_PATTERN)
             }
 
-            if (common.checkContains('STACK_TEST', 'openstack')) {
-                if (common.checkContains('TEST_DOCKER_INSTALL', 'true')) {
-                    test.install_docker(saltMaster, TEST_TEMPEST_TARGET)
-                }
-                stage('Run OpenStack tests') {
-                    test.runTempestTests(saltMaster, TEST_TEMPEST_IMAGE, TEST_TEMPEST_TARGET, TEST_TEMPEST_PATTERN)
-                }
-
-                stage('Copy Tempest results to config node') {
-                    test.copyTempestResults(saltMaster, TEST_TEMPEST_TARGET)
-                }
+            stage('Copy Tempest results to config node') {
+                test.copyTempestResults(saltMaster, TEST_TEMPEST_TARGET)
             }
+        }
 
-            if (common.checkContains('STACK_INSTALL', 'finalize')) {
-                stage('Finalize') {
-                    salt.runSaltProcessStep(saltMaster, '*', 'state.apply', [], null, true)
-                }
+        if (common.checkContains('STACK_INSTALL', 'finalize')) {
+            stage('Finalize') {
+                salt.runSaltProcessStep(saltMaster, '*', 'state.apply', [], null, true)
             }
+        }
 
-        } catch (Throwable e) {
-            currentBuild.result = 'FAILURE'
-            throw e
-        } finally {
+    } catch (Throwable e) {
+        currentBuild.result = 'FAILURE'
+        throw e
+    } finally {
 
 
-            //
-            // Clean
-            //
+        //
+        // Clean
+        //
 
-            if (STACK_NAME && STACK_NAME != '') {
-                // send notification
-                common.sendNotification(currentBuild.result, STACK_NAME, ["slack"])
+        if (STACK_NAME && STACK_NAME != '') {
+            // send notification
+            common.sendNotification(currentBuild.result, STACK_NAME, ["slack"])
+        }
+
+        if (STACK_DELETE.toBoolean() == true) {
+            stage('Trigger cleanup job') {
+                common.errorMsg('Stack cleanup job triggered')
+                build(job: STACK_CLEANUP_JOB, parameters: [
+                    [$class: 'StringParameterValue', name: 'STACK_NAME', value: STACK_NAME],
+                    [$class: 'StringParameterValue', name: 'STACK_TYPE', value: STACK_TYPE],
+                    [$class: 'StringParameterValue', name: 'OPENSTACK_API_URL', value: OPENSTACK_API_URL],
+                    [$class: 'StringParameterValue', name: 'OPENSTACK_API_CREDENTIALS', value: OPENSTACK_API_CREDENTIALS],
+                    [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT', value: OPENSTACK_API_PROJECT],
+                    [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_DOMAIN', value: OPENSTACK_API_PROJECT_DOMAIN],
+                    [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_ID', value: OPENSTACK_API_PROJECT_ID],
+                    [$class: 'StringParameterValue', name: 'OPENSTACK_API_USER_DOMAIN', value: OPENSTACK_API_USER_DOMAIN],
+                    [$class: 'StringParameterValue', name: 'OPENSTACK_API_CLIENT', value: OPENSTACK_API_CLIENT],
+                    [$class: 'StringParameterValue', name: 'OPENSTACK_API_VERSION', value: OPENSTACK_API_VERSION]
+                ])
             }
+        } else {
+            if (currentBuild.result == 'FAILURE') {
+                common.errorMsg("Deploy job FAILED and was not deleted. Please fix the problem and delete stack on you own.")
 
-            if (STACK_DELETE.toBoolean() == true) {
-                stage('Trigger cleanup job') {
-                    common.errorMsg('Stack cleanup job triggered')
-                    build(job: STACK_CLEANUP_JOB, parameters: [
-                        [$class: 'StringParameterValue', name: 'STACK_NAME', value: STACK_NAME],
-                        [$class: 'StringParameterValue', name: 'STACK_TYPE', value: STACK_TYPE],
-                        [$class: 'StringParameterValue', name: 'OPENSTACK_API_URL', value: OPENSTACK_API_URL],
-                        [$class: 'StringParameterValue', name: 'OPENSTACK_API_CREDENTIALS', value: OPENSTACK_API_CREDENTIALS],
-                        [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT', value: OPENSTACK_API_PROJECT],
-                        [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_DOMAIN', value: OPENSTACK_API_PROJECT_DOMAIN],
-                        [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_ID', value: OPENSTACK_API_PROJECT_ID],
-                        [$class: 'StringParameterValue', name: 'OPENSTACK_API_USER_DOMAIN', value: OPENSTACK_API_USER_DOMAIN],
-                        [$class: 'StringParameterValue', name: 'OPENSTACK_API_CLIENT', value: OPENSTACK_API_CLIENT],
-                        [$class: 'StringParameterValue', name: 'OPENSTACK_API_VERSION', value: OPENSTACK_API_VERSION]
-                    ])
-                }
-            } else {
-                if (currentBuild.result == 'FAILURE') {
-                    common.errorMsg("Deploy job FAILED and was not deleted. Please fix the problem and delete stack on you own.")
-
-                    if (SALT_MASTER_URL) {
-                        common.errorMsg("Salt master URL: ${SALT_MASTER_URL}")
-                    }
+                if (SALT_MASTER_URL) {
+                    common.errorMsg("Salt master URL: ${SALT_MASTER_URL}")
                 }
             }
         }