Refactor vnf-onboarding to make VNF choice configurable

Currently vnf-onboarding enables piplines and gerrit repos for
all VNFs, but this should be configurable depends on customer needs.

Added job description for metaswitch-vsbc job and introduced separate
job for deploy cloudify.

Related-PROD: PROD-18930

Change-Id: I8fae90956bf18c23940d654d617eb06a95aaa617
diff --git a/jenkins/client/job/vnf-onboarding/deploy_cloudify.yml b/jenkins/client/job/vnf-onboarding/deploy_cloudify.yml
new file mode 100644
index 0000000..234178e
--- /dev/null
+++ b/jenkins/client/job/vnf-onboarding/deploy_cloudify.yml
@@ -0,0 +1,63 @@
+parameters:
+  jenkins:
+    client:
+      job:
+        deploy_cloudify:
+          type: workflow-scm
+          name: deploy-cloudify
+          display_name: "Deploy Cloudify"
+          discard:
+            build:
+              keep_num: 20
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/vnf-onboarding/pipelines"
+            credentials: "${_param:vnf_gerrit_credentials}"
+            script: deploy_cloudify.groovy
+          param:
+            OPENSTACK_API_URL:
+              type: string
+              default: "${_param:vnf_openstack_api_url}"
+            OPENSTACK_API_CREDENTIALS:
+              type: string
+              default: "${_param:vnf_openstack_api_admin_credentials}"
+            OPENSTACK_API_TENANT:
+              type: string
+              default: "test-cloudify"
+            NFV_PLATFORM_REPO:
+              type: string
+              description: "Take Cloudify blueprints, Dockerfile and CI scripts from this repo"
+              default: "${_param:jenkins_gerrit_url}/vnf-onboarding/nfv-platform"
+            NFV_PLATFORM_REPO_BRANCH:
+              type: string
+              default: "master"
+            NFV_PLATFORM_REPO_CREDENTIALS:
+              type: string
+              default: "${_param:vnf_gerrit_credentials}"
+            CFM_IMAGE:
+              type: string
+              default: "cloudify-enterprise"
+            CFM_FLAVOR:
+              type: string
+              default: "large"
+            CFM_DISK_SIZE:
+              type: string
+              default: "80"
+            CFM_NET_NAME:
+              type: string
+              default: "cfm-net-shared"
+            SHARE_CFM_NET:
+              type: boolean
+              default: true
+            CFM_SUBNET_CIDR:
+              type: string
+              default: "10.10.1.1/24"
+            CFM_SUBNET_DNS:
+              type: string
+              default: "${_param:dns_server01}"
+            CFM_SSH_KEY_ID:
+              type: string
+              default: "openstack_key"
+            EXTERNAL_NET:
+              type: string
+              default: "public"
\ No newline at end of file
diff --git a/jenkins/client/job/vnf-onboarding/init.yml b/jenkins/client/job/vnf-onboarding/init.yml
index 0e0a847..69b4f4d 100644
--- a/jenkins/client/job/vnf-onboarding/init.yml
+++ b/jenkins/client/job/vnf-onboarding/init.yml
@@ -1,7 +1,5 @@
 classes:
-  - system.jenkins.client.job.vnf-onboarding.test_avi_loadbalancer
-  - system.jenkins.client.job.vnf-onboarding.test_nginx_vnf
-  - system.jenkins.client.job.vnf-onboarding.test_platform
+  - system.jenkins.client.job.vnf-onboarding.deploy_cloudify
 
 parameters:
   _param:
@@ -9,6 +7,8 @@
     vnf_gerrit_credentials: "gerrit"
     vnf_openstack_api_url: "${_param:cluster_public_protocol}://${_param:cluster_public_host}:5000/v2.0"
     vnf_openstack_api_credentials: "test-openstack"
+    vnf_openstack_api_admin_credentials: "admin-openstack"
+    vnf_openstack_ssh_key_credentials: "openstack_key"
     vnf_elastic_url: "${_param:stacklight_log_address}:${_param:cluster_elasticsearch_port}"
     vnf_docker_registry_path: "docker-dev-local.docker.mirantis.net/mirantis/vnf-onboarding"
     vnf_artifactory_url: "https://artifactory.mcp.mirantis.net/artifactory/vnf-onboarding-sandbox"
diff --git a/jenkins/client/job/vnf-onboarding/test_avi_loadbalancer.yml b/jenkins/client/job/vnf-onboarding/test_avi_loadbalancer.yml
index 2bc206b..7caf52c 100644
--- a/jenkins/client/job/vnf-onboarding/test_avi_loadbalancer.yml
+++ b/jenkins/client/job/vnf-onboarding/test_avi_loadbalancer.yml
@@ -79,9 +79,28 @@
             CONTRAIL_API_URL:
               type: string
               default: "${_param:contrail_api_url}"
-            CI_OPTIONS:
+            SETUP_OWN_CLOUDIFY:
+              type: boolean
+              description: "Use temporary private Cloudify instance"
+              default: false
+            CLOUDIFY_MANAGER_IP:
               type: string
-              default: "CFY_AGENT_NET=cfm-net CFY_AGENT_FLAVOR=cfy.agent CFY_AGENT_IMAGE=ubuntu1 CFY_AGENT_USER=cfyuser CFY_SG=cfm-sg CFY_SSH_KEY_ID=openstack_key"
+              description: "IP address of extrenal Cloudify. \"auto\" refers to address of deploy_cloudify job Cloudify instance"
+              default: "auto"
+            CFM_SSH_KEY_ID:
+              type: string
+              description: "Credentials ID of ssh key for connection to Cloudify"
+              default: "${_param:vnf_openstack_ssh_key_credentials}"
+            CFY_AGENT_NET:
+              type: string
+              description: "Network for Cloudify agents that has access to Cloudify Manager"
+              default: "cfm-net-shared"
+            CFY_AGENT_FLAVOR:
+              type: string
+              default: "cfy.agent"
+            CFY_AGENT_IMAGE:
+              type: string
+              default: "ubuntu-xenial"
             VNF_ARTIFACTORY_URL:
               type: string
               default: "${_param:vnf_artifactory_url}"
@@ -110,3 +129,7 @@
             VNF_DOCKER_CLI_PLATFORM:
               type: string
               default: "ubuntu"
+            CLOUDIFY_DEPLOYMENT_TIMEOUT:
+              type: string
+              description: "Set up timeout for cloudify deployment (depends on each VNF specific and network throughput)."
+              default: 1800
diff --git a/jenkins/client/job/vnf-onboarding/test_metaswitch_vsbc.yml b/jenkins/client/job/vnf-onboarding/test_metaswitch_vsbc.yml
new file mode 100644
index 0000000..e27cc1b
--- /dev/null
+++ b/jenkins/client/job/vnf-onboarding/test_metaswitch_vsbc.yml
@@ -0,0 +1,226 @@
+parameters:
+  jenkins:
+    client:
+      plugin:
+        gerrit-trigger: {}
+      job:
+        test_metaswitch_vnf:
+            type: workflow-scm
+            name: test_metaswitch_vnf
+            display_name: "Onboarding tests for Metaswitch vSBC VNF"
+            discard:
+              build:
+                keep_num: 20
+            scm:
+              type: git
+              url: "${_param:jenkins_gerrit_url}/vnf-onboarding/pipelines"
+              credentials:  "${_param:vnf_gerrit_credentials}"
+              script: test_vnf_onboarding.groovy
+            trigger:
+              gerrit:
+                project:
+                  "vnf-onboarding/metaswitch-vsbc":
+                    branches:
+                      - compare_type: "ANT"
+                        name: "**"
+                event:
+                  patchset:
+                    - created:
+                        excludeDrafts: false
+                        excludeTrivialRebase: false
+                        excludeNoCodeChange: false
+                  change:
+                    - merged
+                  comment:
+                    - addedContains:
+                        commentAddedCommentContains: '(retest|recheck|reverify)'
+            param:
+              DEFAULT_GIT_URL:
+                type: string
+                description: "Run against alternate system reclass"
+                default: "${_param:jenkins_gerrit_url}/vnf-onboarding/metaswitch-vsbc"
+              DEFAULT_GIT_REF:
+                type: string
+                default: master
+              OPENSTACK_API_URL:
+                type: string
+                default: ${_param:vnf_openstack_api_url}"
+              OPENSTACK_API_CREDENTIALS:
+                type: string
+                default: "${_param:vnf_openstack_api_credentials}"
+              OPENSTACK_API_TENANT:
+                type: string
+                default: "test"
+              GERRIT_CREDENTIALS:
+                type: string
+                default: "${_param:vnf_gerrit_credentials}"
+              ELASTIC_URL:
+                type: string
+                default: "${_param:vnf_elastic_url}"
+              DEBUG_OPTIONS:
+                type: string
+                default: "skip_inspection=1"
+                description: "Example: skip_all=1 skip_deploy=1 skip_inspection=1"
+              NFV_PLATFORM_REPO:
+                type: string
+                description: "Take Cloudify blueprints, Dockerfile and CI scripts from this repo"
+                default: "ssh://mcp-gerrit@gerrit.mcp.mirantis.net:29418/vnf-onboarding/nfv-platform"
+              NFV_PLATFORM_REPO_BRANCH:
+                type: string
+                default: "master"
+              NFV_PLATFORM_REPO_CREDENTIALS:
+                type: string
+                default: "${_param:vnf_gerrit_credentials}"
+              CONTRAIL_ENABLED:
+                type: boolean
+                default: false
+              CONTRAIL_API_URL:
+                type: string
+                default: "${_param:contrail_api_url}"
+              SETUP_OWN_CLOUDIFY:
+                type: boolean
+                description: "Use temporary private Cloudify instance"
+                default: false
+              CLOUDIFY_MANAGER_IP:
+                type: string
+                description: "IP address of extrenal Cloudify. \"auto\" refers to address of deploy_cloudify job Cloudify instance"
+                default: "auto"
+              CFM_SSH_KEY_ID:
+                type: string
+                description: "Credentials ID of ssh key for connection to Cloudify"
+                default: "${_param:vnf_openstack_ssh_key_credentials}"
+              CFY_AGENT_NET:
+                type: string
+                description: "Network for Cloudify agents that has access to Cloudify Manager"
+                default: "cfm-net-shared"
+              CFY_AGENT_FLAVOR:
+                type: string
+                default: "cfy.agent"
+              CFY_AGENT_IMAGE:
+                type: string
+                default: "ubuntu-xenial"
+              VNF_ARTIFACTORY_URL:
+                type: string
+                default: "${_param:vnf_artifactory_url}"
+              VNF_ARTIFACTORY_PLUGINS_DIR:
+                type: string
+                default: "${_param:vnf_artifactory_url}/cloudify/plugins/"
+              VNF_DOCKER_REGISTRY_PATH:
+                type: string
+                default: "${_param:vnf_docker_registry_path}"
+              VNF_DOCKER_CLI_TAG:
+                type: string
+                default: "latest"
+              VNF_DOCKER_SCRUN_TAG:
+                type: string
+                description: "Not in use for this job"
+                default: "latest"
+              VNF_PLUGINS:
+                type: string
+                description: "Plugins to fetch from artifactory and install during build package step"
+                default: "vnf_onboarding_tools-0.1-py27-none-linux_x86_64_Ubuntu_xenial"
+              VNF_OPTIONS:
+                type: string
+                default: ""
+              VNF_DOCKER_CLI_PLATFORM:
+                type: string
+                default: "ubuntu"
+              CLOUDIFY_DEPLOYMENT_TIMEOUT:
+                type: string
+                description: "Set up timeout for cloudify deployment (depends on each VNF specific and network throughput)."
+                default: 7200
+
+
+        platform_validation_pipeline:
+          type: workflow-scm
+          name: platform_validation_pipeline
+          display_name: "Validate OpenStack platform before deploy of VNF"
+          discard:
+            build:
+              keep_num: 20
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/vnf-onboarding/pipelines"
+            credentials: "${_param:vnf_gerrit_credentials}"
+            script: test_platform.groovy
+          param:
+            OPENSTACK_API_CREDENTIALS:
+              type: string
+              description: "OpenStack admin user credentials for running tests"
+              default: "${_param:vnf_openstack_api_credentials}"
+            OS_PROJECT_NAME:
+              type: string
+              description: "OpenStack project name for running tests"
+              default: "platform-test"
+            OS_AUTH_URL:
+              type: string
+              description: "OpenStack auth url"
+              default: "http://${_param:openstack_control_address}:35357/v3"
+            IMAGE_ID:
+              type: string
+              description: "Specify image id to execute tests against custom images"
+              default: ""
+            FLAVOR_ID:
+              type: string
+              description: "Specify flavor id to execute tests against custom images"
+              default: ""
+            MIN_COMPUTE_NODES:
+              type: string
+              description: "Specify number of compute nodes of environment"
+              default: '2'
+            FIXED_SHARED_NETWORK_NAME:
+              type: string
+              description: "Shared network that will be used in tests."
+              default: "test-shared"
+            COMPUTE_NODE_HOST_NAME:
+              type: string
+              description: "To run CPU pinning/NUMA topology tests against specific node"
+              default: ''
+            COMPUTE_AVAILABILITY_ZONE:
+              type: string
+              description: "To run CPU pinning/NUMA topology tests against specific node"
+              default: 'nova'
+            COMPUTE_NUMA_NODE_COUNT:
+              type: string
+              description: "Number of NUMA node for NUMA topology testing."
+              default: '2'
+            IMAGE_SSH_USER:
+              type: string
+              description: "Specify user name to login in test OpenStack VMs"
+              default: "cirros"
+            VNF_PLATFORM_TESTS_REPO:
+              type: string
+              description: "Repository with testing framework"
+              default: "${_param:jenkins_gerrit_url}vnf-onboarding/platform-tests"
+            VNF_PLATFORM_TESTS_BRANCH:
+              type: string
+              default: "master"
+            VNF_PLATFORM_TESTS_REPO_CREDENTIALS:
+              type: string
+              default: "${_param:vnf_gerrit_credentials}"
+            TEMPEST_IMAGE_DOCKER_REGISTRY_PATH:
+              type: string
+              description: "Path for docker image with testing tool.  If empty, image will be build using VNF_PLATFORM_TESTS_* parameters."
+              default: ${_param:vnf_docker_registry_path}
+            TEMPEST_IMAGE_NAME:
+              type: string
+              description: "Name of docker image with testing tool"
+              default: "platform_tests:latest"
+            ELASTIC_URL:
+              type: string
+              description: "URL to elastic search API"
+              default: "${_param:vnf_elastic_url}"
+            ELASTIC_TRANSFER_REPO:
+              type: string
+              description: "Repository with scripts for transfering test results to elastic search"
+              default: "${_param:jenkins_gerrit_url}/vnf-onboarding/nfv-platform"
+            ELASTIC_TRANSFER_REPO_CREDENTIALS:
+              type: string
+              default: "${_param:vnf_gerrit_credentials}"
+            ELASTIC_TRANSFER_REPO_BRANCH:
+              type: string
+              default: "master"
+            DOCKER_TEMPEST_PARAMS:
+              type: string
+              description: "Pass custom parameters for tempest container"
+              default: ""
diff --git a/jenkins/client/job/vnf-onboarding/test_nginx_vnf.yml b/jenkins/client/job/vnf-onboarding/test_nginx_vnf.yml
index 2dc1a31..f5ca331 100644
--- a/jenkins/client/job/vnf-onboarding/test_nginx_vnf.yml
+++ b/jenkins/client/job/vnf-onboarding/test_nginx_vnf.yml
@@ -80,9 +80,28 @@
             CONTRAIL_API_URL:
               type: string
               default: "${_param:contrail_api_url}"
-            CI_OPTIONS:
+            SETUP_OWN_CLOUDIFY:
+              type: boolean
+              description: "Use temporary private Cloudify instance"
+              default: false
+            CLOUDIFY_MANAGER_IP:
               type: string
-              default: "CFY_AGENT_NET=cfm-net CFY_AGENT_FLAVOR=cfy.agent CFY_AGENT_IMAGE=ubuntu1 CFY_AGENT_USER=cfyuser CFY_SG=cfm-sg CFY_SSH_KEY_ID=openstack_key"
+              description: "IP address of extrenal Cloudify. \"auto\" refers to address of deploy_cloudify job Cloudify instance"
+              default: "auto"
+            CFM_SSH_KEY_ID:
+              type: string
+              description: "Credentials ID of ssh key for connection to Cloudify"
+              default: "${_param:vnf_openstack_ssh_key_credentials}"
+            CFY_AGENT_NET:
+              type: string
+              description: "Network for Cloudify agents that has access to Cloudify Manager"
+              default: "cfm-net-shared"
+            CFY_AGENT_FLAVOR:
+              type: string
+              default: "cfy.agent"
+            CFY_AGENT_IMAGE:
+              type: string
+              default: "ubuntu-xenial"
             VNF_ARTIFACTORY_URL:
               type: string
               default: "${_param:vnf_artifactory_url}"
@@ -108,3 +127,7 @@
             VNF_DOCKER_CLI_PLATFORM:
               type: string
               default: "ubuntu"
+            CLOUDIFY_DEPLOYMENT_TIMEOUT:
+              type: string
+              description: "Set up timeout for cloudify deployment (depends on each VNF specific and network throughput)."
+              default: 900
diff --git a/jenkins/client/job/vnf-onboarding/test_platform.yml b/jenkins/client/job/vnf-onboarding/test_platform.yml
deleted file mode 100644
index 1dd0051..0000000
--- a/jenkins/client/job/vnf-onboarding/test_platform.yml
+++ /dev/null
@@ -1,99 +0,0 @@
-parameters:
-  jenkins:
-    client:
-      plugin:
-        gerrit-trigger: {}
-      job:
-        platform_validation_pipeline:
-          type: workflow-scm
-          name: platform_validation_pipeline
-          display_name: "Validate OpenStack platform before deploy of VNF"
-          discard:
-            build:
-              keep_num: 20
-          scm:
-            type: git
-            url: "${_param:jenkins_gerrit_url}/vnf-onboarding/pipelines"
-            credentials: "${_param:vnf_gerrit_credentials}"
-            script: test_platform.groovy
-          param:
-            OPENSTACK_API_CREDENTIALS:
-              type: string
-              description: "OpenStack admin user credentials for running tests"
-              default: "${_param:vnf_openstack_api_credentials}"
-            OS_PROJECT_NAME:
-              type: string
-              description: "OpenStack project name for running tests"
-              default: "platform-test"
-            OS_AUTH_URL:
-              type: string
-              description: "OpenStack auth url"
-              default: "http://${_param:openstack_control_address}:35357/v3"
-            IMAGE_ID:
-              type: string
-              description: "Specify image id to execute tests against custom images"
-              default: ""
-            FLAVOR_ID:
-              type: string
-              description: "Specify flavor id to execute tests against custom images"
-              default: ""
-            MIN_COMPUTE_NODES:
-              type: string
-              description: "Specify number of compute nodes of environment"
-              default: '2'
-            FIXED_SHARED_NETWORK_NAME:
-              type: string
-              description: "Shared network that will be used in tests."
-              default: "test-shared"
-            COMPUTE_NODE_HOST_NAME:
-              type: string
-              description: "To run CPU pinning/NUMA topology tests against specific node"
-              default: ''
-            COMPUTE_AVAILABILITY_ZONE:
-              type: string
-              description: "To run CPU pinning/NUMA topology tests against specific node"
-              default: 'nova'
-            COMPUTE_NUMA_NODE_COUNT:
-              type: string
-              description: "Number of NUMA node for NUMA topology testing."
-              default: '2'
-            IMAGE_SSH_USER:
-              type: string
-              description: "Specify user name to login in test OpenStack VMs"
-              default: "cirros"
-            VNF_PLATFORM_TESTS_REPO:
-              type: string
-              description: "Repository with testing framework"
-              default: "${_param:jenkins_gerrit_url}vnf-onboarding/platform-tests"
-            VNF_PLATFORM_TESTS_BRANCH:
-              type: string
-              default: "master"
-            VNF_PLATFORM_TESTS_REPO_CREDENTIALS:
-              type: string
-              default: "${_param:vnf_gerrit_credentials}"
-            TEMPEST_IMAGE_DOCKER_REGISTRY_PATH:
-              type: string
-              description: "Path for docker image with testing tool.  If empty, image will be build using VNF_PLATFORM_TESTS_* parameters."
-              default: ${_param:vnf_docker_registry_path}
-            TEMPEST_IMAGE_NAME:
-              type: string
-              description: "Name of docker image with testing tool"
-              default: "platform_tests:latest"
-            ELASTIC_URL:
-              type: string
-              description: "URL to elastic search API"
-              default: "${_param:vnf_elastic_url}"
-            ELASTIC_TRANSFER_REPO:
-              type: string
-              description: "Repository with scripts for transfering test results to elastic search"
-              default: "${_param:jenkins_gerrit_url}/vnf-onboarding/nfv-platform"
-            ELASTIC_TRANSFER_REPO_CREDENTIALS:
-              type: string
-              default: "${_param:vnf_gerrit_credentials}"
-            ELASTIC_TRANSFER_REPO_BRANCH:
-              type: string
-              default: "master"
-            DOCKER_TEMPEST_PARAMS:
-              type: string
-              description: "Pass custom parameters for tempest container"
-              default: ""