/**
 *
 * Create fuel-devops environment, generate a model for it
 * and bootstrap a salt cluster on the environment nodes
 *
 * Expected parameters:

 *   PARENT_NODE_NAME              Name of the jenkins slave to create the environment
 *   PARENT_WORKSPACE              Path to the workspace of the parent job to use tcp-qa repo
 *   LAB_CONFIG_NAME               Name of the tcp-qa deployment template
 *   ENV_NAME                      Fuel-devops environment name
 *   MCP_VERSION                   MCP version, like 2018.4 or proposed
 *   MCP_IMAGE_PATH1604            Local path to the image http://ci.mcp.mirantis.net:8085/images/ubuntu-16-04-x64-mcpproposed.qcow2
 *   IMAGE_PATH_CFG01_DAY01        Local path to the image http://ci.mcp.mirantis.net:8085/images/cfg01-day01-proposed.qcow2
 *   CFG01_CONFIG_IMAGE_NAME       Name for the creating config drive image, like cfg01.${LAB_CONFIG_NAME}-config-drive.iso
 *   TCP_QA_REFS                   Reference to the tcp-qa change on review.gerrithub.io, like refs/changes/46/418546/41
 *   PIPELINE_LIBRARY_REF          Reference to the pipeline-library change
 *   MK_PIPELINES_REF              Reference to the mk-pipelines change
 *   COOKIECUTTER_TEMPLATE_COMMIT  Commit/tag/branch for cookiecutter-templates repository. If empty, then takes ${MCP_VERSION} value
 *   SALT_MODELS_SYSTEM_COMMIT     Commit/tag/branch for reclass-system repository. If empty, then takes ${MCP_VERSION} value
 *   SHUTDOWN_ENV_ON_TEARDOWN      optional, shutdown fuel-devops environment at the end of the job
 *   MCP_SALT_REPO_URL             Base URL for MCP repositories required to bootstrap cfg01 node. Leave blank to use default
 *                                 (http://mirror.mirantis.com/ from mcp-common-scripts)
 *   MCP_SALT_REPO_KEY             URL of the key file. Leave blank to use default
 *                                 (${MCP_SALT_REPO_URL}/${MCP_VERSION}/salt-formulas/xenial/archive-salt-formulas.key from mcp-common-scripts)
 *   OS_AUTH_URL                   OpenStack keystone catalog URL
 *   OS_PROJECT_NAME               OpenStack project (tenant) name
 *   OS_USER_DOMAIN_NAME           OpenStack user domain name
 *   OS_CREDENTIALS                OpenStack username and password credentials ID in Jenkins
 *   JENKINS_PIPELINE_BRANCH       Should be set in release/proposed/2019.2.0 when we test non-released version
 *   UPDATE_VERSION                Version of update to deploy
 *   LAB_PARAM_DEFAULTS            Filename placed in tcp_tests/templates/_heat_environments, with default parameters for the heat template
 *
 *   CREATE_JENKINS_NODE_CREDENTIALS   Jenkins username and password with rights to add/delete Jenkins agents
 */

@Library('tcp-qa')_

import groovy.xml.XmlUtil

common = new com.mirantis.mk.Common()
shared = new com.mirantis.system_qa.SharedPipeline()

if (! env.PARENT_NODE_NAME) {
    error "'PARENT_NODE_NAME' must be set from the parent deployment job!"
}

currentBuild.description = "${PARENT_NODE_NAME}:${ENV_NAME}"
def cfg01_day01_image_name = "cfg01-day01-${MCP_VERSION}"
def ubuntu_vcp_image_name = "ubuntu-vcp-${MCP_VERSION}"
def ubuntu_foundation_image_name = "ubuntu-16.04-foundation-${MCP_VERSION}"

node ("${PARENT_NODE_NAME}") {
    if (! fileExists("${PARENT_WORKSPACE}")) {
        error "'PARENT_WORKSPACE' contains path to non-existing directory ${PARENT_WORKSPACE} on the node '${PARENT_NODE_NAME}'."
    }
    dir("${PARENT_WORKSPACE}") {

        if (env.TCP_QA_REFS) {
            stage("Update working dir to patch ${TCP_QA_REFS}") {
                shared.update_working_dir()
            }
        }

        withCredentials([
           [$class          : 'UsernamePasswordMultiBinding',
           credentialsId   : env.OS_CREDENTIALS,
           passwordVariable: 'OS_PASSWORD',
           usernameVariable: 'OS_USERNAME']
        ]) {
            env.OS_IDENTITY_API_VERSION = 3

            stage("Cleanup: erase ${ENV_NAME} and remove config drive") {

                // delete heat stack
                println "Remove heat stack '${ENV_NAME}'"
                shared.run_cmd("""\
                    # export OS_IDENTITY_API_VERSION=3
                    # export OS_AUTH_URL=${OS_AUTH_URL}
                    # export OS_USERNAME=${OS_USERNAME}
                    # export OS_PASSWORD=${OS_PASSWORD}
                    # export OS_PROJECT_NAME=${OS_PROJECT_NAME}
                    openstack --insecure stack delete -y ${ENV_NAME} || true
                    while openstack --insecure stack show ${ENV_NAME} -f value -c stack_status; do sleep 10; done
                """)

                println "Remove config drive ISO"
                shared.run_cmd("""\
                    rm /home/jenkins/images/${CFG01_CONFIG_IMAGE_NAME} || true
                """)
            }

            stage("Generate the model") {
                def IPV4_NET_ADMIN=shared.run_cmd_stdout("./tcp_tests/utils/get_param_heat_template.py management_subnet_cidr").trim().split().last()
                def IPV4_NET_CONTROL=shared.run_cmd_stdout("./tcp_tests/utils/get_param_heat_template.py control_subnet_cidr").trim().split().last()
                def IPV4_NET_TENANT=shared.run_cmd_stdout("./tcp_tests/utils/get_param_heat_template.py tenant_subnet_cidr").trim().split().last()
                def IPV4_NET_EXTERNAL=shared.run_cmd_stdout("./tcp_tests/utils/get_param_heat_template.py external_subnet_cidr").trim().split().last()
                shared.generate_cookied_model(IPV4_NET_ADMIN, IPV4_NET_CONTROL, IPV4_NET_TENANT, IPV4_NET_EXTERNAL)
            }

            stage("Generate config drive ISO") {
                SALT_MASTER_IP=shared.run_cmd_stdout("./tcp_tests/utils/get_param_heat_template.py management_subnet_cfg01_ip").trim().split().last()
                def ADMIN_NETWORK_GW=shared.run_cmd_stdout("./tcp_tests/utils/get_param_heat_template.py management_subnet_gateway_ip").trim().split().last()
                shared.generate_configdrive_iso(SALT_MASTER_IP, ADMIN_NETWORK_GW)
            }

            stage("Upload Ubuntu image for foundation node") {
                shared.run_cmd("""\
                    if ! openstack --insecure image show ${ubuntu_foundation_image_name} -f value -c name; then
                        wget -O ./${ubuntu_foundation_image_name} https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
                        openstack --insecure image create ${ubuntu_foundation_image_name} --file ./${ubuntu_foundation_image_name} --disk-format qcow2 --container-format bare
                        rm ./${ubuntu_foundation_image_name}
                    else
                        echo Image ${ubuntu_foundation_image_name} already exists
                    fi
                """)
            }

            stage("Upload cfg01-day01 and VCP images") {
                shared.run_cmd("""\
                    # export OS_IDENTITY_API_VERSION=3
                    # export OS_AUTH_URL=${OS_AUTH_URL}
                    # export OS_USERNAME=${OS_USERNAME}
                    # export OS_PASSWORD=${OS_PASSWORD}
                    # export OS_PROJECT_NAME=${OS_PROJECT_NAME}

                    openstack --insecure image show ${cfg01_day01_image_name} -f value -c name || openstack --insecure image create ${cfg01_day01_image_name} --file ${IMAGE_PATH_CFG01_DAY01} --disk-format qcow2 --container-format bare
                    openstack --insecure image show ${ubuntu_vcp_image_name} -f value -c name || openstack --insecure image create ${ubuntu_vcp_image_name} --file ${MCP_IMAGE_PATH1604} --disk-format qcow2 --container-format bare
                """)
            }

            stage("Upload generated config drive ISO into volume on cfg01 node") {
                shared.run_cmd("""\
                    # export OS_IDENTITY_API_VERSION=3
                    # export OS_AUTH_URL=${OS_AUTH_URL}
                    # export OS_USERNAME=${OS_USERNAME}
                    # export OS_PASSWORD=${OS_PASSWORD}
                    # export OS_PROJECT_NAME=${OS_PROJECT_NAME}

                    openstack --insecure image delete cfg01.${ENV_NAME}-config-drive.iso || true
                    sleep 3
                    openstack --insecure image create cfg01.${ENV_NAME}-config-drive.iso --file /home/jenkins/images/${CFG01_CONFIG_IMAGE_NAME} --disk-format iso --container-format bare
                """)
            }

            stage("Create Heat stack '${ENV_NAME}'") {
                // Create stack and wait for CREATE_COMPLETED status, manual analog:
                //    openstack --insecure stack create ${ENV_NAME} \
                //        --template ./tcp_tests/templates/${LAB_CONFIG_NAME}/underlay.hot \
                //        --environment ./tcp_tests/templates/_heat_environments/${LAB_PARAM_DEFAULTS} \
                //        --parameter env_name=${ENV_NAME} --parameter mcp_version=${MCP_VERSION}
                shared.run_cmd("""\
                    export BOOTSTRAP_TIMEOUT=3600
                    export ENV_MANAGER=heat
                    export TEST_GROUP=test_create_environment
                    export SHUTDOWN_ENV_ON_TEARDOWN=false
                    export PYTHONIOENCODING=UTF-8
                    export REPOSITORY_SUITE=${MCP_VERSION}
                    export UPDATE_VERSION=${UPDATE_VERSION}
                    export ENV_NAME=${ENV_NAME}
                    export LAB_CONFIG_NAME=${LAB_CONFIG_NAME}
                    export LAB_PARAM_DEFAULTS=${LAB_PARAM_DEFAULTS}
                    export LOG_NAME=swarm_test_create_environment.log
                    py.test --cache-clear -vvv -s -p no:django -p no:ipdb --junit-xml=deploy_hardware.xml -k \${TEST_GROUP}
                """)
            }

            stage("Add the Jenkins slave node") {
                def jenkins_slave_ip_value_name = "foundation_floating"
                def jenkins_slave_ip = shared.run_cmd_stdout("openstack --insecure stack output show ${ENV_NAME} ${jenkins_slave_ip_value_name} -f value -c output_value").trim().split().last()
                def jenkins_slave_executors = 2
                common.printMsg("JENKINS_SLAVE_NODE_NAME=${JENKINS_SLAVE_NODE_NAME}", "green")
                common.printMsg("JENKINS_SLAVE_IP=${jenkins_slave_ip}", "green")

        withCredentials([
           [$class          : 'UsernamePasswordMultiBinding',
           credentialsId   : "${CREATE_JENKINS_NODE_CREDENTIALS}",
           passwordVariable: 'JENKINS_PASS',
           usernameVariable: 'JENKINS_USER']
        ]) {

                script_delete_agent = ("""\
                    CRUMB=\$(curl --fail -0 -u \"\${JENKINS_USER}:\${JENKINS_PASS}\" \${JENKINS_URL}\'/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)\' 2>/dev/null)
                    curl -w '%{http_code}' -o /dev/null \
                        -u \"\${JENKINS_USER}:\${JENKINS_PASS}\" \
                        -H \"Content-Type:application/x-www-form-urlencoded\" \
                        -H \"\$CRUMB\" \
                        \"\${JENKINS_URL}/computer/\${JENKINS_SLAVE_NODE_NAME}/doDelete\" \
                        --request \'POST\' --data \'\'
                    sleep 10
                """)

                script_create_agent = ("""\
                    CRUMB=\$(curl --fail -0 -u \"\${JENKINS_USER}:\${JENKINS_PASS}\" \${JENKINS_URL}\'/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)\' 2>/dev/null)

                    curl -L -sS -w '%{http_code}' -o /dev/null \
                        -u \"\${JENKINS_USER}:\${JENKINS_PASS}\" \
                        -H \"Content-Type:application/x-www-form-urlencoded\" \
                        -H \"\$CRUMB\" \
                        -X POST -d 'json={\
                            \"name\": \"'\"\$JENKINS_SLAVE_NODE_NAME\"'\", \
                            \"nodeDescription\": \"'\"\$ENV_NAME\"'\", \
                            \"numExecutors\": \"'\"${jenkins_slave_executors}\"'\", \
                            \"remoteFS\": \"'\"/home/jenkins/workspace\"'\", \
                            \"labelString\": \"'\"\$ENV_NAME\"'\", \
                            \"mode\": \"EXCLUSIVE\", \
                            \"\": [\"hudson.plugins.sshslaves.SSHLauncher\", \"hudson.slaves.RetentionStrategy\$Always\"], \
                            \"launcher\": {\
                                \"stapler-class\": \"hudson.plugins.sshslaves.SSHLauncher\", \
                                \"\$class\": \"hudson.plugins.sshslaves.SSHLauncher\", \
                                \"host\": \"'\"${jenkins_slave_ip}\"'\", \
                                \"credentialsId\": \"'\"\$ACCESS_JENKINS_NODE_CREDENTIALS\"'\", \
                                \"port\": \"'\"22\"'\", \
                                \"javaPath\": \"\", \
                                \"jvmOptions\": \"\", \
                                \"prefixStartSlaveCmd\": \"\", \
                                \"suffixStartSlaveCmd\": \"\", \
                                \"launchTimeoutSeconds\": \"\", \
                                \"maxNumRetries\": \"\", \
                                \"retryWaitTime\": \"\", \
                                \"sshHostKeyVerificationStrategy\": {\
                                    \"\$class\": \"hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy\" \
                                }, \
                                \"tcpNoDelay\": \"true\"\
                            }, \
                            \"retentionStrategy\": {\
                                \"stapler-class\": \"hudson.slaves.RetentionStrategy\$Always\", \
                                \"\$class\": \"hudson.slaves.RetentionStrategy\$Always\"\
                            }, \
                            \"nodeProperties\": {\
                                \"stapler-class-bag\": \"true\"\
                            }, \
                            \"type\": \"hudson.slaves.DumbSlave\", \
                            \"crumb\": \"'\"\$CRUMB\"'\"}' \
                        \"\${JENKINS_URL}/computer/doCreateItem?name=\${JENKINS_SLAVE_NODE_NAME}&type=hudson.slaves.DumbSlave\"
                """)
                shared.verbose_sh(script_delete_agent, true, false, true)
                shared.verbose_sh(script_create_agent, true, false, true)

                // Store jenkins agent IP address
                jenkins_agent_description = "ssh jenkins@${jenkins_slave_ip}  # foundation node with Jenkins agent <a href=${JENKINS_URL}/computer/${JENKINS_SLAVE_NODE_NAME}>${JENKINS_SLAVE_NODE_NAME}</a><br>ssh root@${SALT_MASTER_IP}  # cfg01 node<br>"
                writeFile(file: "jenkins_agent_description.txt", text: jenkins_agent_description, encoding: "UTF-8")

        } // withCredentials

            }// stage

        } // withCredentials

    } // dir
} // node


node ("${JENKINS_SLAVE_NODE_NAME}") {
    dir("${PARENT_WORKSPACE}") {

        stage("Clean the environment and clone tcp-qa") {
            deleteDir()
            shared.verbose_sh("""\
                [ -d /home/jenkins/venv_testrail_reporter ] || virtualenv /home/jenkins/venv_testrail_reporter
            """, true, false, true)
            shared.run_cmd("""\
                . /home/jenkins/venv_testrail_reporter/bin/activate; pip install git+https://github.com/dis-xcom/testrail_reporter -U
            """)
            shared.verbose_sh("""\
                [ -d /home/jenkins/fuel-devops30 ] || virtualenv /home/jenkins/fuel-devops30
            """, true, false, true)
            shared.run_cmd("""\
                git clone https://github.com/Mirantis/tcp-qa.git ${PARENT_WORKSPACE}
            """)
            shared.update_working_dir()
        }

        withCredentials([
           [$class          : 'UsernamePasswordMultiBinding',
           credentialsId   : env.OS_CREDENTIALS,
           passwordVariable: 'OS_PASSWORD',
           usernameVariable: 'OS_USERNAME']
        ]) {


            stage("Run the 'underlay' and 'salt-deployed' fixtures to bootstrap salt cluster") {
                def xml_report_name = "deploy_salt.xml"
                try {
                    // deploy_salt.xml
                    shared.run_sh("""\
                        export ENV_NAME=${ENV_NAME}
                        export LAB_CONFIG_NAME=${LAB_CONFIG_NAME}
                        export LAB_PARAM_DEFAULTS=${LAB_PARAM_DEFAULTS}
                        export ENV_MANAGER=heat
                        export SHUTDOWN_ENV_ON_TEARDOWN=false
                        export BOOTSTRAP_TIMEOUT=3600
                        export PYTHONIOENCODING=UTF-8
                        export REPOSITORY_SUITE=${MCP_VERSION}
                        export UPDATE_VERSION=${UPDATE_VERSION}
                        export TEST_GROUP=test_bootstrap_salt
                        export LOG_NAME=swarm_test_bootstrap_salt.log
                        py.test -vvv -s -p no:django -p no:ipdb --junit-xml=${xml_report_name} -k \${TEST_GROUP}
                    """)
                    // Wait for jenkins to start and IO calm down
                    sleep(60)

                } catch (e) {
                      common.printMsg("Saltstack cluster deploy is failed", "purple")
                      if (fileExists(xml_report_name)) {
                          shared.download_logs("deploy_salt_${ENV_NAME}")
                          def String junit_report_xml = readFile(xml_report_name)
                          def String junit_report_xml_pretty = new XmlUtil().serialize(junit_report_xml)
                          throw new Exception(junit_report_xml_pretty)
                      } else {
                          throw e
                      }
                } finally {
                    // TODO(ddmitriev): add checks for salt cluster
                }
            } // stage
        } // withCredentials
    } // dir
} // node
