Use integration-java11 Dockerfile
Use onap/integration-java11:7.1.0 as a source for the images requiring JDK 11 in SDC
Issue-ID: SDC-3298
Change-Id: Ifee3d2942dcb9c078f2ebb686bdabc0ecca857b3
Signed-off-by: xuegao <xue.gao@intl.att.com>
diff --git a/asdctool/sdc-cassandra-init/Dockerfile b/asdctool/sdc-cassandra-init/Dockerfile
index e35f841..e532100 100644
--- a/asdctool/sdc-cassandra-init/Dockerfile
+++ b/asdctool/sdc-cassandra-init/Dockerfile
@@ -16,7 +16,6 @@
echo '[cql]' > ~/.cassandra/cqlshrc && \
echo 'version=3.4.4' >> ~/.cassandra/cqlshrc && \
set -ex && \
- pip install cqlsh && \
apt-get install -y \
make \
gcc \
@@ -25,14 +24,12 @@
libffi-dev \
libxml2-dev && \
gem install chef:13.8.5 berkshelf:6.3.1 io-console:0.4.6 etc webrick --no-document && \
- apt-get update -y && \
+ apt-get update -y && apt-get remove bash -y --allow-remove-essential && \
apt-get install -y binutils && apt-get clean && gem cleanup
+
USER sdc
-
COPY --chown=sdc:sdc chef-solo /home/sdc/chef-solo/
-
COPY --chown=sdc:sdc chef-repo/cookbooks /home/sdc/chef-solo/cookbooks/
-
COPY --chown=sdc:sdc startup.sh /home/sdc/
RUN chmod 770 /home/sdc/startup.sh
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb
index 84b0cb2..3c67715 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb
@@ -11,9 +11,8 @@
})
end
-
-bash "create-sdc-user" do
- code <<-EOH
- cd /tmp ; /tmp/create_cassandra_user.sh
- EOH
-end
+execute "create-sdc-user" do
+ command "/tmp/create_cassandra_user.sh"
+ cwd "/tmp/"
+ action :run
+end
\ No newline at end of file
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb
index 38de1e8..5f740a8 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb
@@ -19,21 +19,16 @@
action :create
end
+execute "onboard-db-schema-creation" do
+ ignore_failure true
+ command "chmod +x onboard-db-schema-creation.sh && sh -x /tmp/tools/build/scripts/onboard-db-schema-creation.sh"
+ cwd "/tmp/tools/build/scripts"
+ action :run
+end
-bash "onboard-db-schema-creation" do
+execute "create-DOX-schema" do
ignore_failure true
- code <<-EOH
- cd /tmp/tools/build/scripts
- chmod +x onboard-db-schema-creation.sh
- bash /tmp/tools/build/scripts/onboard-db-schema-creation.sh
- EOH
-end
-
-bash "create-DOX-schema" do
- ignore_failure true
- code <<-EOH
- cd /tmp
- chmod +x /tmp/create_dox_keyspace.sh
- /tmp/create_dox_keyspace.sh
- EOH
-end
+ command "chmod +x /tmp/create_dox_keyspace.sh && /tmp/create_dox_keyspace.sh"
+ cwd "/tmp"
+ action :run
+end
\ No newline at end of file
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb
index a62550e..e60740f 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb
@@ -3,15 +3,12 @@
mode 0755
end
-## extract sdctool.tar
-bash "install tar" do
+execute "install tar" do
+ command "/bin/tar xf /tmp/sdctool.tar -C /tmp"
cwd "/tmp"
- code <<-EOH
- /bin/tar xf /tmp/sdctool.tar -C /tmp
- EOH
+ action :run
end
-
template "janusgraph.properties" do
sensitive true
path "/tmp/sdctool/config/janusgraph.properties"
@@ -49,19 +46,13 @@
})
end
-
-
-bash "executing-schema-creation" do
- code <<-EOH
- cd /tmp
- chmod +x /tmp/sdctool/scripts/schemaCreation.sh
- /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config
- EOH
+execute "executing-schema-creation" do
+ command "chmod +x /tmp/sdctool/scripts/schemaCreation.sh && /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config"
+ cwd "/tmp"
+ action :run
end
-bash "executing-janusGraphSchemaCreation.sh" do
- code <<-EOH
- chmod +x /tmp/sdctool/scripts/janusGraphSchemaCreation.sh
- /tmp/sdctool/scripts/janusGraphSchemaCreation.sh /tmp/sdctool/config
- EOH
-end
+execute "executing-janusGraphSchemaCreation.sh" do
+ command "chmod +x /tmp/sdctool/scripts/janusGraphSchemaCreation.sh && /tmp/sdctool/scripts/janusGraphSchemaCreation.sh /tmp/sdctool/config"
+ action :run
+end
\ No newline at end of file
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb
index 0490c89..8c2ee50 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb
@@ -2,19 +2,8 @@
cl_release=node['version'].split('.')[0..2].join('.').split('-')[0]
printf("\033[33mcl_release=[%s]\n\033[0m", cl_release)
-
-
-bash "import-Conformance" do
+execute "import-Conformance" do
+ command "conf_dir=/tmp/sdctool/config && tosca_dir=/tmp/sdctool/tosca && 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 ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} onap\" && ./sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} onap"
cwd "#{working_directory}"
- code <<-EOH
- conf_dir=/tmp/sdctool/config
- tosca_dir=/tmp/sdctool/tosca
-
- 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 ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} onap"
- ./sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} onap
- EOH
+ action :run
end
\ No newline at end of file
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb
index 426eed8..9fa3130 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
CASSANDRA_IP=<%= @cassandra_ip %>
CASSANDRA_PORT=<%= @cassandra_port %>
@@ -12,17 +12,17 @@
is_up=0
while [ $is_up -eq 0 -a $retry_num -le 100 ]; do
- echo "exit" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT > /dev/null 2>&1
+ echo "exit" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT
res1=$?
if [ $res1 -eq 0 ]; then
- echo "`date` --- cqlsh is enabled to connect."
+ echo "`date` --- cqlsh is able to connect."
is_up=1
else
- echo "`date` --- cqlsh is NOT enabled to connect yet. sleep 5"
+ echo "`date` --- cqlsh is NOT able to connect yet. sleep 5"
sleep 5
fi
- let "retry_num++"
+ retry_num=$((retry_num+1))
done
cassandra_user_exist=`echo "list users;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT | grep -c $SDC_USER`
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb
index e9d10af..9b20c6f 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
CASSANDRA_USER='<%= @cassandra_usr %>'
CASSANDRA_PASS='<%= @cassandra_pwd %>'