diff options
author | MD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com> | 2020-10-15 21:15:36 +0530 |
---|---|---|
committer | MD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com> | 2020-10-19 10:04:34 +0530 |
commit | 451ae3e4aada9dbf9b8bd2a0f7475d17188d02ae (patch) | |
tree | e2771084b2382960c2fa838d111a704d4e884e49 /openecomp-be | |
parent | 78712174a6f275fc722482ee7783dd705497baf6 (diff) |
Read files from resources to create HELM VFM
Issue-ID: SDC-3316
Signed-off-by: MD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com>
Change-Id: Ieb3a4aa46c657ffaa328aef00394a13361bdbe5a
Diffstat (limited to 'openecomp-be')
7 files changed, 72 insertions, 4 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java index 052bd78d11..a2db915d8b 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java @@ -697,7 +697,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa JsonUtil.json2Object(zipFileManifest, ManifestContent.class); for (FileData fileData : manifestContent.getData()) { if ((fileData.getFile()).contains("dummy_ignore.yaml")) { - String filePath = new File("").getAbsolutePath(); + String filePath = new File("").getAbsolutePath() + "/resources"; File envFilePath = new File(filePath + "/base_template.env"); File baseFilePath = new File(filePath + "/base_template.yaml"); try ( diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/onboarding/OnboardingPackageProcessor.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/onboarding/OnboardingPackageProcessor.java index d1b64e213e..a40f2ebd30 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/onboarding/OnboardingPackageProcessor.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/onboarding/OnboardingPackageProcessor.java @@ -143,7 +143,7 @@ public class OnboardingPackageProcessor { dataEnvList.add(dummyEnv); dummyHeat.setData(dataEnvList); newfiledata.add(dummyHeat); - String filePath = new File("").getAbsolutePath(); + String filePath = new File("").getAbsolutePath() + "/resources"; File envFilePath = new File(filePath + "/base_template.env"); File baseFilePath = new File(filePath + "/base_template.yaml"); try ( diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessZipHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessZipHandler.java index 45dc5faac5..71e47db48c 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessZipHandler.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessZipHandler.java @@ -150,7 +150,7 @@ public class OrchestrationTemplateProcessZipHandler implements OrchestrationTemp for (FileData fileData : manifestContent.getData()) { if (Objects.nonNull(fileData.getType()) && fileData.getType().equals(FileData.Type.HELM) && fileData.getBase()) { - String filePath = new File("").getAbsolutePath(); + String filePath = new File("").getAbsolutePath() + "/resources"; File envFilePath = new File(filePath + "/base_template.env"); File baseFilePath = new File(filePath + "/base_template.yaml"); try ( diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/files/default/base_template.env b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/files/default/base_template.env new file mode 100644 index 0000000000..1b96230a96 --- /dev/null +++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/files/default/base_template.env @@ -0,0 +1,4 @@ +parameters: + vnf_name: demo_vnf_ignore + vnf_id: demo_app + vf_module_id: demo_module_id
\ No newline at end of file diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/files/default/base_template.yaml b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/files/default/base_template.yaml new file mode 100644 index 0000000000..eb6962b95e --- /dev/null +++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/files/default/base_template.yaml @@ -0,0 +1,49 @@ + + +heat_template_version: 2013-05-23 + +description: Dummy base heat template + +############## +# # +# PARAMETERS # +# # +############## + +parameters: + vnf_name: + type: string + description: VNF_NAME + vnf_id: + type: string + label: VNF ID + description: The VNF ID is provided by ONAP + vf_module_id: + type: string + label: VF Module ID + description: The VF Module ID is provided by ONAP + +############# +# # +# RESOURCES # +# # +############# + +resources: + dummy: + type: OS::Heat::None + properties: + vnf_name: + get_param: vnf_name + vnf_id: + get_param: vnf_id + vf_module_id: + get_param: vf_module_id + + #SDC won't allow too dummy resource as it has to find 'topology_template' TOSCA equivalent in heat templates + dummy_base: + type: OS::Nova::Server + properties: + name: test + image: test + flavor: test
\ No newline at end of file diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_7_setup_base_template.rb b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_7_setup_base_template.rb new file mode 100644 index 0000000000..c84e660534 --- /dev/null +++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_7_setup_base_template.rb @@ -0,0 +1,14 @@ +cookbook_file "#{ENV['JETTY_BASE']}/resources/base_template.yaml" do + source "base_template.yaml" + mode 0644 + owner "jetty" + group "jetty" +end + +cookbook_file "#{ENV['JETTY_BASE']}/resources/base_template.env" do + source "base_template.env" + mode 0644 + owner "jetty" + group "jetty" +end + diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-solo/roles/sdc-onboard-backend.json b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-solo/roles/sdc-onboard-backend.json index 53915ff355..5fdf89b882 100644 --- a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-solo/roles/sdc-onboard-backend.json +++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-solo/roles/sdc-onboard-backend.json @@ -15,7 +15,8 @@ "recipe[sdc-onboard-backend::ON_3_logback]", "recipe[sdc-onboard-backend::ON_4_setup_jetty_modules]", "recipe[sdc-onboard-backend::ON_5_setup_configuration]", - "recipe[sdc-onboard-backend::ON_6_prepareProbeFile]" + "recipe[sdc-onboard-backend::ON_6_prepareProbeFile]", + "recipe[sdc-onboard-backend::ON_7_setup_base_template]" ], "env_run_lists": { } |