e9e44c0df9e43deea4dd52968168a25f298475e3
[sdc.git] / catalog-be / sdc-backend-init / chef-repo / cookbooks / sdc-catalog-be-setup / recipes / 3_import_Normatives.rb
1 be_ip=node['Nodes'][:BE]
2
3 if node['disableHttp']
4   protocol = "https"
5   be_port = node['BE']['https_port']
6   param="-i #{be_ip} -p #{be_port} --https"
7 else
8   protocol = "http"
9   be_port = node['BE']['http_port']
10   param="-i #{be_ip} -p #{be_port}"
11 end
12
13 cookbook_file "/var/tmp/normatives.tar.gz" do
14   source "normatives.tar.gz"
15 end
16
17 bash "executing-import_Normatives" do
18   code <<-EOH
19     set -ex
20
21     cd /var/tmp/
22     tar -xvf normatives.tar.gz
23     
24     # executing the normatives
25     # add --debug to the sdcinit command to enable debug
26
27     cd /var/tmp/normatives/import/tosca
28     sdcinit #{param} > /var/lib/jetty/logs/init.log
29     rc=$?
30     if [[ $rc != 0 ]]; then exit $rc; fi
31
32   EOH
33   returns [0]
34 end