aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-cassandra
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-06-09 16:13:27 +0300
committerMichael Lando <ml636r@att.com>2017-06-09 16:15:08 +0300
commit3ca8a037896ac13ff9fa7f8a618470bc645393b9 (patch)
tree6a46c2093cc078b2f79ca9314150dd100fa5e6e8 /sdc-os-chef/sdc-cassandra
parentb7bc7da72ae31e8549edb40eccccad298852de6e (diff)
[SDC-29] add mising script got Comformance
Change-Id: Ie80539d82d15d3a95ac2c46d82a926d8408ac16f Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'sdc-os-chef/sdc-cassandra')
-rw-r--r--sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/07-importComformance.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/07-importComformance.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/07-importComformance.rb
new file mode 100644
index 0000000000..ac91d1892b
--- /dev/null
+++ b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/07-importComformance.rb
@@ -0,0 +1,36 @@
+working_directory = "/tmp"
+cl_release=node['version'].split('.')[0..2].join('.').split('-')[0]
+printf("\033[33mcl_release=[%s]\n\033[0m", cl_release)
+
+cookbook_file "/tmp/sdctool.tar" do
+ source "sdctool.tar"
+end
+
+bash "extract sdctool.tar" do
+ cwd "#{working_directory}"
+ code <<-EOH
+ tar xvf /tmp/sdctool.tar
+ EOH
+end
+
+cookbook_file "/tmp/sdctool/config/SDC.zip" do
+ source "SDC-#{cl_release}.zip"
+end
+
+bash "import-Comformance" do
+ cwd "#{working_directory}"
+ code <<-EOH
+ conf_dir=/tmp/sdctool/config
+ schema_file_name=SDC.zip
+
+ cl_version=`grep 'toscaConformanceLevel:' $conf_dir/configuration.yaml |awk '{print $2}'`
+
+ cd /tmp/sdctool/scripts
+ /bin/chmod +x sdcSchemaFileImport.sh
+ echo "execute /tmp/sdctool/scripts/sdcSchemaFileImport.sh $conf_dir/$schema_file_name #{cl_release} $cl_version $conf_dir "
+ ./sdcSchemaFileImport.sh ${conf_dir}/${schema_file_name} $cl_release ${cl_version} ${conf_dir}
+ EOH
+end
+
+
+