Use integration-java11 Dockerfile 50/112950/25
authorsebdet <sebastien.determe@intl.att.com>
Mon, 21 Sep 2020 20:13:05 +0000 (22:13 +0200)
committerMichael Morris <michael.morris@est.tech>
Wed, 12 May 2021 10:27:10 +0000 (10:27 +0000)
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>
103 files changed:
asdctool/pom.xml
asdctool/sdc-cassandra-init/Dockerfile
asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb
asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb
asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb
asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb
asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb
asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb
asdctool/src/main/resources/scripts/UUIDFix1707.sh
asdctool/src/main/resources/scripts/artifactsIdValidation.sh
asdctool/src/main/resources/scripts/baseOperation.sh
asdctool/src/main/resources/scripts/cleanCsar.sh
asdctool/src/main/resources/scripts/deleteAllProducts.sh
asdctool/src/main/resources/scripts/deleteComponentTool.sh
asdctool/src/main/resources/scripts/derivedFromAlignment.sh
asdctool/src/main/resources/scripts/distributionStatusUpdate1707.sh
asdctool/src/main/resources/scripts/exportGraph.sh
asdctool/src/main/resources/scripts/exportGraphAsGraphMl.sh
asdctool/src/main/resources/scripts/exportUsers.sh
asdctool/src/main/resources/scripts/fix_icons.sh
asdctool/src/main/resources/scripts/fix_issue.sh
asdctool/src/main/resources/scripts/generateCsar.sh
asdctool/src/main/resources/scripts/groupsAlignment.sh
asdctool/src/main/resources/scripts/importGraph.sh
asdctool/src/main/resources/scripts/janusGraphSchemaCreation.sh
asdctool/src/main/resources/scripts/migration1707RelationsFix.sh
asdctool/src/main/resources/scripts/postMigration1707Fix.sh
asdctool/src/main/resources/scripts/schemaCreation.sh
asdctool/src/main/resources/scripts/sdc-migration.sh
asdctool/src/main/resources/scripts/sdcSchemaFileImport.sh
asdctool/src/main/resources/scripts/updateIsVnf.sh
asdctool/src/main/resources/scripts/upgradePostMigration1710.sh
asdctool/src/main/resources/scripts/validationTool.sh
asdctool/src/main/resources/scripts/vfModulePropertiesAdding.sh
asdctool/src/main/resources/scripts/vfcNameAlignment.sh
asdctool/src/main/resources/scripts/vfmoduleFix1707.sh
asdctool/src/main/resources/scripts/vrfObjectFix.sh
catalog-be-plugins/backend-all-plugins/pom.xml
catalog-be-plugins/backend-all-plugins/src/main/docker/backend-all-plugins/Dockerfile
catalog-be/pom.xml
catalog-be/sdc-backend-init/Dockerfile
catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/1_create_consumer_and_user.rb
catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb
catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/3_import_Normatives.rb
catalog-be/sdc-backend-init/startup.sh
catalog-be/src/main/docker/backend/Dockerfile
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_10_setup_cadi.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_1_cleanup_jettydir.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_3_locate_keystore.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_5_setup_elasticsearch.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_6_setup_portal_and_key_properties.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_7_logback.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_8_errors_config.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_9_prepareProbeFile.rb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-distribution-engine-configuration.yaml.erb
catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb
catalog-be/src/main/docker/backend/startup.sh
catalog-be/src/main/resources/config/distribution-engine-configuration.yaml
catalog-fe/pom.xml
catalog-fe/sdc-frontend/Dockerfile
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_1_cleanup_jettydir.rb
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_2_setup_configuration.rb
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_3_errors_config.rb
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_4_logback.rb
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_5_rest_configuration.rb
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_6_locate_keystore.rb
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_7_create_jetty_modules.rb
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_8_prepareProbeFile.rb
catalog-fe/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/templates/default/ready-probe.sh.erb
catalog-fe/sdc-frontend/startup.sh
integration-tests/pom.xml
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/attributes/default.rb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_1_cleanup_jettydir.rb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_2_locate_keystore.rb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_3_logback.rb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_4_setup_jetty_modules.rb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_5_setup_configuration.rb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_6_prepareProbeFile.rb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/recipes/ON_7_setup_base_template.rb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/templates/default/configuration.yaml.erb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/chef-repo/cookbooks/sdc-onboard-backend/templates/default/ready-probe.sh.erb
openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh
openecomp-be/dist/sdc-onboard-backend-docker/pom.xml
openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile
openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh
openecomp-be/dist/sdc-onboard-db-init-docker/pom.xml
pom.xml
sdc-os-chef/pom.xml
sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/change_cassandra_pass.sh.erb
utils/webseal-simulator/pom.xml
utils/webseal-simulator/scripts/simulator_docker_run.sh
utils/webseal-simulator/sdc-simulator/Dockerfile
utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_1_cleanup_jettydir.rb
utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_2_setup_configuration.rb
utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb
utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_locate_keystore.rb
utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_create_jetty_modules.rb
utils/webseal-simulator/sdc-simulator/startup.sh

index 623d4e6..7161f89 100644 (file)
             <groupId>io.fabric8</groupId>
             <artifactId>docker-maven-plugin</artifactId>
             <configuration>
+              <verbose>${verbose}</verbose>
               <apiVersion>${docker.api.version}</apiVersion>
               <registry>nexus3.onap.org:10001</registry>
               <authConfig>
index e35f841..e532100 100644 (file)
@@ -16,7 +16,6 @@ RUN apt-get update && apt-get install -y python-pip && \
     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 @@ RUN apt-get update && apt-get install -y python-pip && \
     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
 
+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
index 84b0cb2..3c67715 100644 (file)
@@ -11,9 +11,8 @@ template "/tmp/create_cassandra_user.sh" do
   })
 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
index 38de1e8..5f740a8 100644 (file)
@@ -19,21 +19,16 @@ remote_directory '/tmp/tools' do
     action :create
 end
 
-
-bash "onboard-db-schema-creation" do
+execute "onboard-db-schema-creation" 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
+  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 "create-DOX-schema" do
+
+execute "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
index a62550e..e60740f 100644 (file)
@@ -3,15 +3,12 @@ cookbook_file "/tmp/sdctool.tar" do
   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 @@ template "/tmp/sdctool/config/configuration.yaml" do
   })
 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
index 0490c89..8c2ee50 100644 (file)
@@ -2,19 +2,8 @@ working_directory =  "/tmp"
 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
index 426eed8..9fa3130 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 CASSANDRA_IP=<%= @cassandra_ip %>
 CASSANDRA_PORT=<%= @cassandra_port %>
@@ -12,17 +12,17 @@ retry_num=1
 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`
index 0ceb0a0..71cda4b 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Distribution Status Update 1707
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.ArtifactUUIDFixMenu"
 
index 9064a64..9c60aa7 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 #   Artifact Validator Tool   #
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.ArtifactValidatorTool"
 
index b27b734..ffa101e 100644 (file)
@@ -1,9 +1,9 @@
-#!/bin/bash
+#!/bin/sh
 
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
index c11cdef..a5fba0a 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index 474b6c8..07dbae1 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 #####################################
 # delete all products from JanusGraph
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.RemoveUtils"
 
index afdf816..0c65d54 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Distribution Status Update 1707
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.DeleteComponentTool"
 
index 05025a0..c9ee64b 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index a9d308f..3be4a49 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Distribution Status Update 1707
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index 648cb50..41874d5 100644 (file)
@@ -1,16 +1,16 @@
-#!/bin/bash
+#!/bin/sh
 
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.ExportImportMenu"
 
index 17d660c..bd8f51a 100644 (file)
@@ -1,16 +1,16 @@
-#!/bin/bash
+#!/bin/sh
 
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.ExportImportMenu"
 
index fec7d5a..4a6d0fe 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##################################
 # export all users from JanusGraph
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.ExportImportMenu"
 
index 230dea7..dfa50aa 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index af63ec5..7c4d426 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index c741688..fb01c2f 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Distribution Status Update 1707
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.CsarGeneratorTool"
 
index 742b246..7ce927a 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Groups Alignment
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index ffdd2fd..4d4dd69 100644 (file)
@@ -1,16 +1,16 @@
-#!/bin/bash
+#!/bin/sh
 
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.ExportImportMenu"
 
index d4b7871..d964c99 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # JanusGraph Schema Creation
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.DataSchemaMenu"
 
index c930243..0e7ce42 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration: fix relations after migration 1707
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index 56a16db..0d25d7c 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration 1707
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index 657db5e..fbc2251 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.DataSchemaMenu"
 
index 15e6d6b..c369800 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.migration.main.MigrationMenu"
 
index 4002e38..afe6b65 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 #   Sdc Schema File Import   #
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.SdcSchemaFileImport"
 
index bf45fa8..4d15b04 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ########################################################################
 #
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.UpdateIsVnfMenu"
 
index 927d148..3b58fdc 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration: Upgrade Post Migration 1710
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.migration.main.MigrationMenu"
 
index 58cd7f3..6ac0541 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 #   Validation Tool   #
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.ValidationTool"
 
index 1ead248..7fd4096 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration: Adding new properties to vfModules
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index 10fbb25..a7578ec 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index 4857924..6f08fa2 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Distribution Status Update 1707
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu"
 
index 3f875fa..a3eb067 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ##############################
 # Data Migration
@@ -7,14 +7,14 @@
 CURRENT_DIR=`pwd`
 BASEDIR=$(dirname $0)
 
-if [ ${BASEDIR:0:1} = "/" ]
+if [ `echo ${BASEDIR} | cut -c1-1` = "/" ]
 then
                 FULL_PATH=$BASEDIR
 else
                 FULL_PATH=$CURRENT_DIR/$BASEDIR
 fi
 
-source ${FULL_PATH}/baseOperation.sh
+. ${FULL_PATH}/baseOperation.sh
 
 mainClass="org.openecomp.sdc.asdctool.main.VrfObjectFixMenu"
 
index 4cd4879..a261c1e 100644 (file)
@@ -58,9 +58,10 @@ limitations under the License.
                 <groupId>io.fabric8</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
                 <configuration>
+                    <verbose>${verbose}</verbose>
                     <apiVersion>${docker.api.version}</apiVersion>
                     <registry>nexus3.onap.org:10001</registry>
-                    <verbose>true</verbose>
+                    <verbose>${verbose}</verbose>
                     <authConfig>
                         <pull>
                             <username>docker</username>
index ab42a10..24e9146 100644 (file)
@@ -1,4 +1,3 @@
 FROM onap/sdc-backend:latest
 
-COPY --chown=jetty:jetty onap-sdc-backend-all-plugins/etsi-nfv-nsd-csar-plugin.jar       ${JETTY_BASE}/plugins/
-RUN ls -latr ${JETTY_BASE}/plugins/
\ No newline at end of file
+COPY --chown=onap:onap onap-sdc-backend-all-plugins/etsi-nfv-nsd-csar-plugin.jar       ${JETTY_BASE}/plugins/
\ No newline at end of file
index 00cbc8b..002e3fc 100644 (file)
                         <groupId>io.fabric8</groupId>
                         <artifactId>docker-maven-plugin</artifactId>
                         <configuration>
+                            <verbose>${verbose}</verbose>
                             <apiVersion>${docker.api.version}</apiVersion>
                             <registry>nexus3.onap.org:10001</registry>
                             <authConfig>
index 3ffcbe6..35e485b 100644 (file)
@@ -1,22 +1,59 @@
-FROM onap/base_sdc-python:1.7.0
+FROM onap/integration-python:8.0.0
+
+USER root
+
+# Needed for pycurl
+ENV PYCURL_SSL_LIBRARY=openssl
+
+# Install packages only needed for building
+RUN apk update && \
+    apk add binutils jq libpng && \
+    apk add --no-cache \
+        libcurl \
+        ruby && \
+    apk add --no-cache --virtual .build-dependencies \
+        libressl-dev \
+        ruby-dev \
+        libffi-dev \
+        libxml2-dev \
+        build-base \
+        curl-dev && \
+    # needed libcurl to install correctly
+    pip install 'pycurl==7.43.0.1' &&  \
+        set -ex && \
+    gem install \
+        chef:13.8.5 \
+        berkshelf:6.3.1 \
+        io-console:0.4.6 \
+        etc webrick \
+        --no-document && \
+    apk del .build-dependencies
+
+ENV ONAP_LOG=/home/onap/logs
+RUN mkdir $ONAP_LOG && chown onap:onap $ONAP_LOG
+
+# user/group are the same as in integration/docker/onap-python base image
+ENV user=onap group=onap
+
+USER onap
 
 # user/group args are inherited from base_sdc-python base image
-COPY --chown=$user:$group scripts /home/$user/scripts
+COPY --chown=onap:onap scripts /home/onap/scripts
 
-RUN chmod 770 -R /home/$user/scripts && \
-    cd /home/$user/scripts && \
+RUN chmod 770 -R /home/onap/scripts && \
+    cd /home/onap/scripts && \
     python setup.py install --user
 
-ENV PATH=$PATH:/home/$user/.local/bin
+ENV PATH=$PATH:/home/onap/.local/bin
 
-COPY --chown=$user:$group chef-solo /home/$user/chef-solo/
+COPY --chown=onap:onap chef-solo /home/onap/chef-solo/
 
-COPY --chown=$user:$group chef-repo/cookbooks /home/$user/chef-solo/cookbooks/
+COPY --chown=onap:onap chef-repo/cookbooks /home/onap/chef-solo/cookbooks/
 
-COPY --chown=$user:$group startup.sh /home/$user/
+COPY --chown=onap:onap startup.sh /home/onap/
 
-RUN chmod 770 /home/$user/startup.sh
+RUN chmod 770 /home/onap/startup.sh
 
-WORKDIR /home/$user/
+WORKDIR /home/onap/
 
 ENTRYPOINT /home/${user}/startup.sh
index dcf963f..3aabb0a 100644 (file)
@@ -28,20 +28,11 @@ if node['basic_auth']
   end
 end
 
-bash "executing-create_users" do
-  code <<-EOH
-    sdcuserinit -i #{node['Nodes']['BE']} -p #{be_port} #{basic_auth_config} #{user_conf_dir} #{https_flag}
-    rc=$?
-    if [[ $rc != 0 ]]; then exit $rc; fi
-  EOH
-  returns [0]
+execute "executing-create_users" do
+  command "sdcuserinit -i #{node['Nodes']['BE']} -p #{be_port} #{basic_auth_config} #{user_conf_dir} #{https_flag}"
+  action :run
 end
-
-bash "executing-create_consumers" do
-  code <<-EOH
-    sdcconsumerinit -i #{node['Nodes']['BE']} -p #{be_port} #{basic_auth_config} #{https_flag}
-    rc=$?
-    if [[ $rc != 0 ]]; then exit $rc; fi
-  EOH
-  returns [0]
+execute "executing-create_consumers" do
+  command "sdcconsumerinit -i #{node['Nodes']['BE']} -p #{be_port} #{basic_auth_config} #{https_flag}"
+  action :run
 end
index 27b1a7d..2e479e0 100644 (file)
@@ -21,11 +21,7 @@ if node['basic_auth']
   end
 end
 
-bash "executing-check_backend_health" do
-   code <<-EOH
-     sdccheckbackend -i #{node['Nodes']['BE']} -p #{be_port} #{basic_auth_config} #{https_flag}
-     rc=$?
-     if [[ $rc != 0 ]]; then exit $rc; fi
-   EOH
-   returns [0]
+execute "executing-check_backend_health" do
+  command "sdccheckbackend -i #{node['Nodes']['BE']} -p #{be_port} #{basic_auth_config} #{https_flag}"
+  action :run
 end
\ No newline at end of file
index 0abda0d..be32e98 100644 (file)
@@ -26,21 +26,8 @@ cookbook_file "/var/tmp/normatives.tar.gz" do
   source "normatives.tar.gz"
 end
 
-bash "executing-import_Normatives" do
-  code <<-EOH
-    set -ex
-
-    cd /var/tmp/
-    tar -xvf normatives.tar.gz
-    
-    # executing the normatives
-    # add --debug to the sdcinit command to enable debug
-
-    cd /var/tmp/normatives/import/tosca
-    sdcinit #{param} #{basic_auth_config} > /var/lib/jetty/logs/init.log
-    rc=$?
-    if [[ $rc != 0 ]]; then exit $rc; fi
-
-  EOH
-  returns [0]
+execute "create-jetty-modules" do
+  command "set -ex && tar -xvf normatives.tar.gz && cd /var/tmp/normatives/import/tosca && sdcinit #{param} #{basic_auth_config} > #{ENV['ONAP_LOG']}/init.log"
+  cwd "/var/tmp/"
+  action :run
 end
index 83bfbf2..e216341 100644 (file)
@@ -1,6 +1,4 @@
 #!/bin/sh
 
 cd /home/"${user}"/chef-solo || exit $?
-chef-solo -c solo.rb -E "${ENVNAME}"
-rc=$?
-if [ $rc != 0 ]; then exit $rc; fi
+chef-solo -c solo.rb -E "${ENVNAME}"
\ No newline at end of file
index 2772e62..30daaf4 100644 (file)
@@ -1,17 +1,13 @@
-FROM jetty:9.4.31-jre11-slim
+FROM onap/integration-java11:8.0.0
 
 USER root
+ARG JETTY_FOLDER=/app/jetty
 
 # Install Chef
 RUN set -ex && \
-    apt-get update -y && \
-    apt-get install -y \
-        jq \
-        curl \
-        curl \
-        vim \
-        make \
-        gcc \
+    apk update && \
+    apk add --no-cache \
+        build-base \
         ruby \
         ruby-dev \
         libffi-dev \
@@ -23,33 +19,30 @@ RUN set -ex && \
         etc webrick \
         --no-document && \
     gem cleanup && \
-    apt-get update -y && \
-    apt-get install -y binutils jq && \
-    apt-get clean
-
-# Replace Jetty user ID
-ENV USER_JETTY="jetty"
-ENV GROUP_JETTY="jetty"
-ENV UID_JETTY="352070"
-ENV GID_JETTY="35953"
-
-# Remove user:
-RUN deluser ${USER_JETTY}
-#RUN delgroup ${GROUP_JETTY}
-RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd
-RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group
-RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow
-RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY}
-RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty
-
-USER jetty
-
-COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/
-COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/
-COPY --chown=jetty:jetty onap-sdc-backend/catalog-be.war       ${JETTY_BASE}/webappwar/
-COPY --chown=jetty:jetty context.xml       ${JETTY_BASE}/webapps/
-COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/
-
-RUN chmod 770 ${JETTY_BASE}/startup.sh
-
-ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]
\ No newline at end of file
+    apk update
+
+ENV JETTY_HOME=$JETTY_FOLDER
+ENV JETTY_BASE=$JETTY_FOLDER
+ENV JETTY_USER=onap
+ENV JETTY_GROUP=onap
+
+RUN mkdir $JETTY_FOLDER && chown onap:onap $JETTY_FOLDER
+
+USER onap
+
+#Download jetty
+RUN wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.31.v20200723/jetty-distribution-9.4.31.v20200723.tar.gz -O $JETTY_FOLDER/jetty.tar.gz && \
+        tar xvz -C $JETTY_FOLDER -f $JETTY_FOLDER/jetty.tar.gz --strip 1 && \
+        rm -rf $JETTY_FOLDER/jetty.tar.gz
+
+RUN sed -i 's/"jetty"/"onap"/g' $JETTY_FOLDER/etc/jetty-setuid.xml
+
+COPY --chown=onap:onap chef-solo $JETTY_FOLDER/chef-solo/
+COPY --chown=onap:onap chef-repo/cookbooks $JETTY_FOLDER/chef-solo/cookbooks/
+COPY --chown=onap:onap onap-sdc-backend/catalog-be.war       $JETTY_FOLDER/webappwar/
+COPY --chown=onap:onap context.xml       $JETTY_FOLDER/webapps/
+COPY --chown=onap:onap startup.sh $JETTY_FOLDER/
+
+RUN chmod 770 $JETTY_FOLDER/startup.sh
+
+ENTRYPOINT [ "sh", "-c", "${JETTY_HOME}/startup.sh"]
\ No newline at end of file
index 528ddae..dc7d77b 100644 (file)
@@ -13,8 +13,9 @@ default['disableHttp'] = true
 #+----------------------------------+
 
 default['jetty']['dmaap_truststore_pwd'] = "dmaap_truststore_pwd"
-default['jetty'][:keystore_pwd] = "?(kP!Yur![*!Y5!E^f(ZKc31"
-default['jetty'][:keymanager_pwd] = "?(kP!Yur![*!Y5!E^f(ZKc31"
+default['jetty']['keystore_pwd'] = "?(kP!Yur![*!Y5!E^f(ZKc31"
+default['jetty']['keymanager_pwd'] = "?(kP!Yur![*!Y5!E^f(ZKc31"
+default['jetty']['truststore_path'] = "#{ENV['JETTY_BASE']}/etc/truststore"
 # TO CHANGE THE TRUSTSTORE CERT THE JVM CONFIGURATION
 # MUST BE ALSO CHANGE IN THE startup.sh FILE
 default['jetty'][:truststore_pwd] = "z+KEj;t+,KN^iimSiS89e#p0"
@@ -33,6 +34,7 @@ default['cassandra']['socket_read_timeout'] = 20000
 default['cassandra']['socket_connect_timeout'] = 20000
 default['cassandra']['janusgraph_connection_timeout'] = 10000
 default['cassandra'][:truststore_password] = "Aa123456"
+default['cassandra']['janusgraph_config_file'] = "#{ENV['JETTY_BASE']}/config/catalog-be/janusgraph.properties"
 
 
 #Onboard
@@ -86,10 +88,10 @@ default['DMAAP']['replicationcount'] = "3"
 #+----------------------------------+
 
 # Cadi
-default['access_restriction']['cadi_root_dir'] = "/var/lib/jetty/etc"
-default['access_restriction']['cadi_keyfile'] = "/var/lib/jetty/etc/org.onap.sdc.p12"
+default['access_restriction']['cadi_root_dir'] = "#{ENV['JETTY_BASE']}/etc"
+default['access_restriction']['cadi_keyfile'] = "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.p12"
 default['access_restriction']['cadi_loglevel'] = "DEBUG"
-default['access_restriction']['cadi_truststore'] = "/var/lib/jetty/etc/org.onap.sdc.trust.jks"
+default['access_restriction']['cadi_truststore'] = "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.trust.jks"
 default['access_restriction']['cadi_truststore_password'] = "changeit"
 default['access_restriction']['cadiX509Issuers'] = "CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US"
 default['access_restriction']['encrypted_password'] = "enc:AccessRestrictionEncryptedPassword"
index 3a79cfc..e7d11c9 100644 (file)
@@ -3,8 +3,8 @@ jetty_base = "#{ENV['JETTY_BASE']}"
 
 directory "Jetty_etc_dir_creation" do
        path "#{jetty_base}/etc"
-       owner 'jetty'
-       group 'jetty'
+       owner "#{ENV['JETTY_USER']}"
+       owner "#{ENV['JETTY_GROUP']}"
        mode '0755'
        action :create
   not_if { ::File.directory?("#{jetty_base}/etc") }
@@ -13,16 +13,16 @@ end
 
 cookbook_file "#{jetty_base}/etc/keyfile" do
    source "keyfile"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   owner "#{ENV['JETTY_GROUP']}"
    mode 0755
 end
 
 
 cookbook_file "#{jetty_base}/etc/cadi_truststore.jks" do
    source "cadi_truststore.jks"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   owner "#{ENV['JETTY_GROUP']}"
    mode 0755
 end
 
@@ -30,8 +30,8 @@ end
 template "#{jetty_base}/etc/cadi.properties" do
   path "#{jetty_base}/etc/cadi.properties"
   source "cadi.properties.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  owner "#{ENV['JETTY_GROUP']}"
   mode "0755"
 end
 
index 7ca3db8..620fa2e 100644 (file)
@@ -1,8 +1,8 @@
 unless Dir.exist? "#{ENV['JETTY_BASE']}/temp"
   directory "BE_tempdir_creation" do
     path "#{ENV['JETTY_BASE']}/temp"
-    owner 'jetty'
-    group 'jetty'
+    owner "#{ENV['JETTY_USER']}"
+    owner "#{ENV['JETTY_GROUP']}"
     mode '0755'
     action :create
   end
@@ -11,8 +11,8 @@ end
 unless Dir.exist? "#{ENV['JETTY_BASE']}/config"
   directory "BE_create_config_dir" do
     path "#{ENV['JETTY_BASE']}/config"
-    owner 'jetty'
-    group 'jetty'
+    owner "#{ENV['JETTY_USER']}"
+    owner "#{ENV['JETTY_GROUP']}"
     mode '0755'
     action :create
   end
@@ -21,8 +21,8 @@ end
 unless Dir.exist? "#{ENV['JETTY_BASE']}/config/catalog-be"
   directory "BE_create_catalog-be" do
     path "#{ENV['JETTY_BASE']}/config/catalog-be"
-    owner 'jetty'
-    group 'jetty'
+    owner "#{ENV['JETTY_USER']}"
+    owner "#{ENV['JETTY_GROUP']}"
     mode '0755'
     action :create
   end
index 51a943f..6522577 100644 (file)
@@ -17,8 +17,8 @@ end
 template "janusgraph.properties" do
   path "#{ENV['JETTY_BASE']}/config/catalog-be/janusgraph.properties"
   source "BE-janusgraph.properties.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0644"
   action :create_if_missing
   variables({
@@ -38,8 +38,8 @@ end
 template "catalog-be-config" do
   path "#{ENV['JETTY_BASE']}/config/catalog-be/configuration.yaml"
   source "BE-configuration.yaml.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0644"
   action :create_if_missing
   variables({
@@ -54,7 +54,7 @@ template "catalog-be-config" do
                 :rep_factor => replication_factor,
                 :DC_NAME => node['cassandra']['datacenter_name'],
                 :REP_STRING => conf_dcname_with_rep,
-                :janusgraph_Path => "/var/lib/jetty/config/catalog-be/",
+                :janusgraph_Path => "#{ENV['JETTY_BASE']}/config/catalog-be/",
                 :socket_connect_timeout => node['cassandra']['socket_connect_timeout'],
                 :socket_read_timeout => node['cassandra']['socket_read_timeout'],
                 :cassandra_pwd => node['cassandra'][:cassandra_password],
@@ -68,8 +68,8 @@ end
 template "distribution-engine-configuration" do
   path "#{ENV['JETTY_BASE']}/config/catalog-be/distribution-engine-configuration.yaml"
   source "BE-distribution-engine-configuration.yaml.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0644"
   action :create_if_missing
 end
index cb2ffc7..176edcf 100644 (file)
@@ -1,23 +1,23 @@
 
 directory "Jetty_etcdir_creation" do
        path "#{ENV['JETTY_BASE']}/etc"
-       owner 'jetty'
-       group 'jetty'
+       owner "#{ENV['JETTY_USER']}"
+       owner "#{ENV['JETTY_GROUP']}"
        mode '0755'
        action :create
 end
        
 cookbook_file "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.p12" do
    source "org.onap.sdc.p12"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   owner "#{ENV['JETTY_GROUP']}"
    mode 0755
 end
 
 cookbook_file "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.trust.jks" do
    source "org.onap.sdc.trust.jks"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   owner "#{ENV['JETTY_GROUP']}"
    mode 0755
 end
 
index 34934a4..772e0d4 100644 (file)
@@ -5,22 +5,17 @@ else
   http_option = "--module=http"
 end
 
-
-bash "create-jetty-modules" do
-cwd "#{ENV['JETTY_BASE']}"
-code <<-EOH
-  cd "#{ENV['JETTY_BASE']}"
-  java -jar "#{ENV['JETTY_HOME']}"/start.jar --add-to-start=deploy
-  java -jar "#{ENV['JETTY_HOME']}"/start.jar --create-startd --add-to-start=http,https,console-capture,setuid
-EOH
+execute "create-jetty-modules" do
+  command "java -jar #{ENV['JETTY_HOME']}/start.jar --add-to-start=deploy && java -jar #{ENV['JETTY_HOME']}/start.jar --create-startd --add-to-start=http,https,console-capture,setuid"
+  cwd "#{ENV['JETTY_BASE']}"
+  action :run
 end
 
-
 template "http-ini" do
   path "#{ENV['JETTY_BASE']}/start.d/http.ini"
   source "http-ini.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0755"
   variables ({
     :http_option => http_option ,
@@ -33,8 +28,8 @@ end
 template "https-ini" do
   path "#{ENV['JETTY_BASE']}/start.d/https.ini"
   source "https-ini.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0755"
   variables :https_port => "#{node['BE'][:https_port]}"
 end
@@ -43,8 +38,8 @@ end
 template "ssl-ini" do
   path "#{ENV['JETTY_BASE']}/start.d/ssl.ini"
   source "ssl-ini.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0755"
   variables ({
     :https_port => "#{node['BE'][:https_port]}" ,
index 7a2f24e..44e96f3 100644 (file)
@@ -11,8 +11,8 @@ end
 template "elasticsearch.yml-config" do
   path "#{ENV['JETTY_BASE']}/config/elasticsearch.yml"
   source "BE-elasticsearch.yml.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0755"
   variables ({
     :cluster_name => "#{clusterName}",
index 4f99938..5e37c29 100644 (file)
@@ -1,8 +1,8 @@
 template "template portal.properties" do
     path "#{ENV['JETTY_BASE']}/resources/portal.properties"
     source "BE-portal.properties.erb"
-    owner "jetty"
-    group "jetty"
+    owner "#{ENV['JETTY_USER']}"
+    group "#{ENV['JETTY_GROUP']}"
     mode "0755"
     variables ({
         :ecomp_rest_url      => node['ECompP']['ecomp_rest_url'],
@@ -16,8 +16,8 @@ end
 template "template key.properties" do
     path "#{ENV['JETTY_BASE']}/resources/key.properties"
     source "BE-key.properties.erb"
-    owner "jetty"
-    group "jetty"
+    owner "#{ENV['JETTY_USER']}"
+    group "#{ENV['JETTY_GROUP']}"
     mode "0755"
     variables ({
         :cipher_key      => node['ECompP']['cipher_key']
index 7d95d74..8dbebbb 100644 (file)
@@ -1,8 +1,8 @@
 cookbook_file "#{ENV['JETTY_BASE']}/config/catalog-be/logback.xml" do
   source "logback.xml"
   mode 0644
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   action :create_if_missing
 end
  
index b100356..cc059b4 100644 (file)
@@ -1,16 +1,16 @@
 cookbook_file "#{ENV['JETTY_BASE']}/config/catalog-be/ecomp-error-configuration.yaml" do
   source "ecomp-error-configuration.yaml"
   mode 0644
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   action :create_if_missing
 end
  
 cookbook_file "#{ENV['JETTY_BASE']}/config/catalog-be/error-configuration.yaml" do
   source "error-configuration.yaml"
   mode 0644
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   action :create_if_missing
 end
  
index 81e1a85..51e69ae 100644 (file)
@@ -6,7 +6,7 @@ else
   port = "#{node['BE'][:http_port]}"
 end
 
-template "/var/lib/jetty/ready-probe.sh" do
+template "#{ENV['JETTY_BASE']}/ready-probe.sh" do
   source "ready-probe.sh.erb"
   sensitive true
   mode 0755
index 5a059aa..9f49bc5 100644 (file)
@@ -28,7 +28,7 @@ released: 2012-11-30
 toscaConformanceLevel: 11.0
 minToscaConformanceLevel: 3.0
 
-janusGraphCfgFile: /var/lib/jetty/config/catalog-be/janusgraph.properties
+janusGraphCfgFile: <%= node['cassandra']['janusgraph_config_file'] %>
 janusGraphInMemoryGraph: false
 janusGraphLockTimeout: 1800
 # The interval to try and reconnect to JanusGraph DB when it is down during ASDC startup:
@@ -112,7 +112,7 @@ cassandraConfig:
     username: <%= @cassandra_usr %>
     password: <%= @cassandra_pwd %>
     ssl: <%= @cassandra_ssl_enabled %>
-    truststorePath : /var/lib/jetty/etc/truststore
+    truststorePath : <%= node['jetty']['truststore_path'] %>
     truststorePassword : <%= @cassandra_truststore_password %>
     keySpaces:
         - { name: dox,           replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @REP_STRING %>']}
@@ -1120,7 +1120,7 @@ dmaapConsumerConfiguration:
         username: user
         password:
     aftDme2SslEnable: true
-    aftDme2ClientKeystore: /var/lib/jetty/etc/truststore
+    aftDme2ClientKeystore: <%= node['jetty']['truststore_path'] %>
     aftDme2ClientKeystorePassword: ""
     aftDme2ClientSslCertAlias: certman
 
@@ -1153,7 +1153,7 @@ dmaapProducerConfiguration:
         username: <%= node['DMAAP']['producer']['username'] %>
         password: <%= node['DMAAP']['producer']['password'] %>
     aftDme2SslEnable: true
-    aftDme2ClientKeystore: /var/lib/jetty/etc/truststore
+    aftDme2ClientKeystore: <%= node['jetty']['truststore_path'] %>
     aftDme2ClientKeystorePassword: <%= node['jetty']['dmaap_truststore_pwd'] %>
     aftDme2ClientSslCertAlias: certman
 
index 0fa6936..7eeb7a8 100644 (file)
@@ -58,7 +58,7 @@ aaiConfig:
          readTimeoutMs: 5000
          connectTimeoutMs: 1000
       clientCertificate:
-         keyStore: /var/lib/jetty/base/be/etc/non-prod.jks
+         keyStore: /app/jetty/base/be/etc/non-prod.jks
          keyStorePassword: hmXYcznAljMSisdy8zgcag==
       headers:
          X-FromAppId: asdc
index 9f6646d..6592943 100644 (file)
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
 health_check_http_code=$(curl -k --max-time 5 -o /dev/null -w '%{http_code}' <%= @protocol %>://127.0.0.1:<%= @port %>/sdc2/rest/healthCheck)
 
-if [[ "$health_check_http_code" -eq 200 ]]; then
+if [ "$health_check_http_code" -eq 200 ]; then
   exit 0
 else
   echo "Health check http status: $health_check_http_code"
index 0dc54a8..50f2e3d 100644 (file)
@@ -1,27 +1,21 @@
 #!/bin/sh
 
-export JAVA_OPTIONS=" -Dconfig.home=${JETTY_BASE}/config \
-       -Dlog.home=${JETTY_BASE}/logs \
-       -Dlogback.configurationFile=${JETTY_BASE}/config/catalog-be/logback.xml \
-       -Dconfiguration.yaml=${JETTY_BASE}/config/catalog-be/configuration.yaml \
-       -Dartifactgenerator.config=${JETTY_BASE}/config/catalog-be/Artifact-Generator.properties \
-          -Donboarding_configuration.yaml=${JETTY_BASE}/config/onboarding-be/onboarding_configuration.yaml \
-       -Djavax.net.ssl.trustStore=${JETTY_BASE}/etc/org.onap.sdc.trust.jks \
+export JAVA_OPTIONS="$JAVA_OPTIONS -Dconfig.home=$JETTY_BASE/config \
+       -Dcom.datastax.driver.USE_NATIVE_CLOCK=false \
+       -Dlog.home=$JETTY_BASE/logs \
+       -Dlogback.configurationFile=$JETTY_BASE/config/catalog-be/logback.xml \
+       -Dconfiguration.yaml=$JETTY_BASE/config/catalog-be/configuration.yaml \
+       -Dartifactgenerator.config=$JETTY_BASE/config/catalog-be/Artifact-Generator.properties \
+            -Donboarding_configuration.yaml=$JETTY_BASE/config/onboarding-be/onboarding_configuration.yaml \
+       -Djavax.net.ssl.trustStore=$JETTY_BASE/etc/org.onap.sdc.trust.jks \
        -Djavax.net.ssl.trustStorePassword=z+KEj;t+,KN^iimSiS89e#p0 \
-       -Djetty.console-capture.dir=${JETTY_BASE}/logs \
-       ${JAVA_OPTIONS} "
+       -Djetty.console-capture.dir=$JETTY_BASE/logs"
 
-cd /var/lib/jetty/chef-solo
+cd $JETTY_BASE/chef-solo
 chef-solo -c solo.rb -E ${ENVNAME}
 
-status=$?
-if [ $status -ne 0 ]; then
-    echo "[ERROR] Problem detected while running chef. Aborting !"
-    exit 1
-fi
-
 # Execute Jetty
-cd /var/lib/jetty
+cd $JETTY_HOME
 
 java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar"
 
index 65a41e4..1f8d59b 100644 (file)
@@ -61,7 +61,7 @@ aaiConfig:
          readTimeoutMs: 5000
          connectTimeoutMs: 1000
       clientCertificate:
-         keyStore: /var/lib/jetty/opt/base/be/etc/non-prod.jks
+         keyStore: /app/jetty/opt/base/be/etc/non-prod.jks
          keyStorePassword: hmXYcznAljMSisdy8zgcag==
       headers:
          X-FromAppId: asdc
index 3591a51..a4be186 100644 (file)
             <groupId>io.fabric8</groupId>
             <artifactId>docker-maven-plugin</artifactId>
             <configuration>
+              <verbose>${verbose}</verbose>
               <apiVersion>${docker.api.version}</apiVersion>
               <registry>nexus3.onap.org:10001</registry>
               <authConfig>
index 3a2359c..65950cb 100644 (file)
@@ -1,17 +1,13 @@
-FROM jetty:9.4.31-jre11-slim
+FROM onap/integration-java11:8.0.0
 
 USER root
+ARG JETTY_FOLDER=/app/jetty
 
 # Install Chef
 RUN set -ex && \
-    apt-get update -y && \
-    apt-get install -y \
-        jq \
-        curl \
-        curl \
-        vim \
-        make \
-        gcc \
+    apk update && \
+    apk add --no-cache \
+        build-base \
         ruby \
         ruby-dev \
         libffi-dev \
@@ -23,39 +19,30 @@ RUN set -ex && \
         etc webrick \
         --no-document && \
     gem cleanup && \
-    apt-get update -y && \
-    apt-get install -y binutils jq && \
-    apt-get clean
+    apk update
 
-# Replace Jetty user ID
-ENV USER_JETTY="jetty"
-ENV GROUP_JETTY="jetty"
-ENV UID_JETTY="352070"
-ENV GID_JETTY="35953"
+ENV JETTY_HOME=$JETTY_FOLDER
+ENV JETTY_BASE=$JETTY_FOLDER
+ENV JETTY_USER=onap
+ENV JETTY_GROUP=onap
 
-# Remove user:
-RUN deluser ${USER_JETTY}
-#RUN delgroup ${GROUP_JETTY}
-RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd
-RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group
-RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow
-RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY}
-RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty
+RUN mkdir $JETTY_FOLDER && chown onap:onap $JETTY_FOLDER
 
-USER jetty
+USER onap
 
-RUN mkdir -p ${JETTY_BASE}/config/catalog-fe
+#Download jetty
+RUN wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.31.v20200723/jetty-distribution-9.4.31.v20200723.tar.gz -O $JETTY_FOLDER/jetty.tar.gz && \
+        tar xvz -C $JETTY_FOLDER -f $JETTY_FOLDER/jetty.tar.gz --strip 1 && \
+        rm -rf $JETTY_FOLDER/jetty.tar.gz
+RUN sed -i 's/"jetty"/"onap"/g' $JETTY_FOLDER/etc/jetty-setuid.xml
 
-COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/
+RUN mkdir -p $JETTY_FOLDER/config/catalog-fe
+COPY --chown=onap:onap chef-solo $JETTY_FOLDER/chef-solo/
+COPY --chown=onap:onap  chef-repo/cookbooks $JETTY_FOLDER/chef-solo/cookbooks/
+ADD --chown=onap:onap onboarding*.war         $JETTY_FOLDER/webapps/
+ADD --chown=onap:onap  catalog-fe-*.war        $JETTY_FOLDER/webapps/
+COPY --chown=onap:onap  startup.sh $JETTY_FOLDER
 
-COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/
+RUN chmod 770 $JETTY_FOLDER/startup.sh
 
-ADD --chown=jetty:jetty onboarding*.war         ${JETTY_BASE}/webapps/
-
-ADD --chown=jetty:jetty catalog-fe-*.war        ${JETTY_BASE}/webapps/
-
-COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}
-
-RUN chmod 770 ${JETTY_BASE}/startup.sh
-
-ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]
\ No newline at end of file
+ENTRYPOINT [ "sh", "-c", "${JETTY_HOME}/startup.sh"]
\ No newline at end of file
index 0dd305a..cdd6b19 100644 (file)
@@ -1,15 +1,15 @@
 directory "FE_tempdir_creation" do
   path "#{ENV['JETTY_BASE']}/temp"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
 
 directory "FE_create_config_dir" do
   path "#{ENV['JETTY_BASE']}/config"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
@@ -17,8 +17,8 @@ end
 
 directory "FE_create_catalog-fe" do
   path "#{ENV['JETTY_BASE']}/config/catalog-fe"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
@@ -26,8 +26,8 @@ end
 
 directory "FE_create_catalog-fe" do
   path "#{ENV['JETTY_BASE']}/config/onboarding-fe"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
index 640b5b8..819638a 100644 (file)
@@ -1,8 +1,8 @@
 template "catalog-fe-config" do
    path "#{ENV['JETTY_BASE']}/config/catalog-fe/configuration.yaml"
    source "FE-configuration.yaml.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
       :fe_host_ip   => node['FE_VIP'],
@@ -20,8 +20,8 @@ end
 cookbook_file "#{ENV['JETTY_BASE']}/config/catalog-fe/workspace-configuration.yaml" do
   source "FE-workspace-configuration.yaml"
   mode 0755
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
 end
 
 
@@ -29,7 +29,7 @@ end
 template "onboarding-fe-config" do
     path "#{ENV['JETTY_BASE']}/config/onboarding-fe/onboarding_configuration.yaml"
     source "FE-onboarding-configuration.yaml.erb"
-    owner "jetty"
-    group "jetty"
+    owner "#{ENV['JETTY_USER']}"
+    group "#{ENV['JETTY_GROUP']}"
     mode "0755"
 end
index 54dee2e..aa80879 100644 (file)
@@ -1,7 +1,7 @@
 cookbook_file "#{ENV['JETTY_BASE']}/config/catalog-fe/ecomp-error-configuration.yaml" do
   source "FE-ecomp-error-configuration.yaml"
   mode 0755
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
 end
  
index f264183..34c084e 100644 (file)
@@ -1,6 +1,6 @@
 cookbook_file "#{ENV['JETTY_BASE']}/config/catalog-fe/logback.xml" do
   source "FE-logback.xml"
   mode 0755
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
 end
index cf7575c..388974e 100644 (file)
@@ -1,7 +1,7 @@
 cookbook_file "#{ENV['JETTY_BASE']}/config/catalog-fe/rest-configuration-info.yaml" do
   source "FE-rest-configuration.yaml"
   mode 0755
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
 end
  
index 527713c..50cb263 100644 (file)
@@ -1,21 +1,21 @@
 directory "Jetty_etcdir_creation" do
        path "#{ENV['JETTY_BASE']}/etc"
-       owner 'jetty'
-       group 'jetty'
+       owner "#{ENV['JETTY_USER']}"
+       group "#{ENV['JETTY_GROUP']}"
        mode '0755'
        action :create
 end
 
 cookbook_file "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.p12" do
    source "org.onap.sdc.p12"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode 0755
 end
 
 cookbook_file "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.trust.jks" do
    source "org.onap.sdc.trust.jks"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode 0755
 end
index bf756fb..0a1527f 100644 (file)
@@ -6,22 +6,17 @@ else
   http_option = "--module=http"
 end
 
-
-bash "create-jetty-modules" do
-cwd "#{ENV['JETTY_BASE']}"
-code <<-EOH
-   cd "#{ENV['JETTY_BASE']}"
-   java -jar "#{ENV['JETTY_HOME']}"/start.jar --add-to-start=deploy
-   java -jar "#{ENV['JETTY_HOME']}"/start.jar --create-startd --add-to-start=http,https,console-capture,setuid
-EOH
+execute "create-jetty-modules" do
+  command "java -jar #{ENV['JETTY_HOME']}/start.jar --add-to-start=deploy && java -jar #{ENV['JETTY_HOME']}/start.jar --create-startd --add-to-start=http,https,console-capture,setuid"
+  cwd "#{ENV['JETTY_BASE']}"
+  action :run
 end
 
-
 template "http-ini" do
    path "#{ENV['JETTY_BASE']}/start.d/http.ini"
    source "http-ini.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
      :http_option => http_option ,
@@ -33,8 +28,8 @@ end
 template "https-ini" do
    path "#{ENV['JETTY_BASE']}/start.d/https.ini"
    source "https-ini.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables :https_port => "#{node['FE'][:https_port]}"
 end
@@ -43,8 +38,8 @@ end
 template "ssl-ini" do
    path "#{ENV['JETTY_BASE']}/start.d/ssl.ini"
    source "ssl-ini.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
      :https_port => "#{node['FE'][:https_port]}" ,
index 2ce61b9..46bc80a 100644 (file)
@@ -6,7 +6,7 @@ else
   port = "#{node['FE'][:http_port]}"
 end
 
-template "/var/lib/jetty/ready-probe.sh" do
+template "#{ENV['JETTY_BASE']}/ready-probe.sh" do
   source "ready-probe.sh.erb"
   sensitive true
   mode 0755
index 5b772ec..eb69f2e 100644 (file)
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
 health_check_http_code=$(curl -k --max-time 5 -o /dev/null -w '%{http_code}' <%= @protocol %>://127.0.0.1:<%= @port %>/sdc1/rest/healthCheck)
 
-if [[ "$health_check_http_code" -eq 200 ]]; then
+if [ "$health_check_http_code" -eq 200 ]; then
   exit 0
 else
   echo "Health check http status: $health_check_http_code"
index b2443f1..5a1dd27 100644 (file)
@@ -1,18 +1,18 @@
 #!/bin/sh
 
-JAVA_OPTIONS=" ${JAVA_OPTIONS} \
-               -Dconfig.home=${JETTY_BASE}/config \
-               -Dlog.home=${JETTY_BASE}/logs \
-               -Dlogback.configurationFile=${JETTY_BASE}/config/catalog-fe/logback.xml \
-               -Dconfiguration.yaml=${JETTY_BASE}/config/catalog-fe/configuration.yaml \
-               -Donboarding_configuration.yaml=${JETTY_BASE}/config/onboarding-fe/onboarding_configuration.yaml \
-               -Djavax.net.ssl.trustStore=${JETTY_BASE}/etc/org.onap.sdc.trust.jks \
+JAVA_OPTIONS="$JAVA_OPTIONS \
+               -Dconfig.home=$JETTY_BASE/config \
+               -Dlog.home=$JETTY_BASE/logs \
+               -Dlogback.configurationFile=$JETTY_BASE/config/catalog-fe/logback.xml \
+               -Dconfiguration.yaml=$JETTY_BASE/config/catalog-fe/configuration.yaml \
+               -Donboarding_configuration.yaml=$JETTY_BASE/config/onboarding-fe/onboarding_configuration.yaml \
+               -Djavax.net.ssl.trustStore=$JETTY_BASE/etc/org.onap.sdc.trust.jks \
                -Djavax.net.ssl.trustStorePassword=z+KEj;t+,KN^iimSiS89e#p0 \
-               -Djetty.console-capture.dir=${JETTY_BASE}/logs "
+               -Djetty.console-capture.dir=$JETTY_BASE/logs"
 
-cd /var/lib/jetty/chef-solo
+cd $JETTY_BASE/chef-solo
 chef-solo -c solo.rb -E ${ENVNAME}
 
-cd /var/lib/jetty
+cd $JETTY_HOME
 
-java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar"
+java $JAVA_OPTIONS -jar "${JETTY_HOME}/start.jar"
index 866e2ee..87761e6 100644 (file)
@@ -406,7 +406,7 @@ limitations under the License.
                     </dependency>
                 </dependencies>
                 <configuration>
-                    <verbose>true</verbose>
+                    <verbose>${verbose}</verbose>
                     <apiVersion>${docker.api.version}</apiVersion>
                     <autoCreateCustomNetworks>true</autoCreateCustomNetworks>
                     <images>
@@ -479,6 +479,7 @@ limitations under the License.
                                     <bind>
                                         <volume>${it.chef.config}:/home/sdc/chef-solo/environments
                                         </volume>
+
                                     </bind>
                                 </volumes>
                                 <wait>
@@ -549,13 +550,10 @@ limitations under the License.
                                 <hostname>sdc-onboard-BE</hostname>
                                 <volumes>
                                     <bind>
-                                        <volume>
-                                            ${it.chef.config}:/var/lib/jetty/chef-solo/environments
-                                        </volume>
-                                        <volume>
-                                            ${project.basedir}/src/test/resources/cert/onboarding-be:/var/lib/jetty/onap/cert
+                                        <volume>${it.chef.config}:/app/jetty/chef-solo/environments</volume>
+                                        <volume>${project.basedir}/src/test/resources/cert/onboarding-be:/app/jetty/onap/cert
                                         </volume>
-                                        <volume>${it.shared.volume}:/var/lib/jetty/logs</volume>
+                                        <volume>${it.shared.volume}:/app/jetty/logs</volume>
                                     </bind>
                                 </volumes>
                                 <wait>
@@ -603,12 +601,10 @@ limitations under the License.
                                 <hostname>sdc-BE</hostname>
                                 <volumes>
                                     <bind>
+                                        <volume>${it.chef.config}:/app/jetty/chef-solo/environments</volume>
+                                        <volume>${it.shared.volume}:/app/jetty/logs</volume>
                                         <volume>
-                                            ${it.chef.config}:/var/lib/jetty/chef-solo/environments
-                                        </volume>
-                                        <volume>${it.shared.volume}:/var/lib/jetty/logs</volume>
-                                        <volume>
-                                            ${project.basedir}/src/test/resources/cert/catalog-be:/var/lib/jetty/onap/cert
+                                            ${project.basedir}/src/test/resources/cert/catalog-be:/app/jetty/onap/cert
                                         </volume>
                                     </bind>
                                 </volumes>
@@ -652,7 +648,7 @@ limitations under the License.
                                         <volume>
                                             ${it.chef.config}:/home/onap/chef-solo/environments
                                         </volume>
-                                        <volume>${it.shared.volume}:/var/lib/jetty/logs</volume>
+                                        <volume>${it.shared.volume}:/home/onap/logs</volume>
                                     </bind>
                                 </volumes>
                                 <wait>
@@ -680,13 +676,12 @@ limitations under the License.
                                 <hostname>sdc-FE</hostname>
                                 <volumes>
                                     <bind>
+                                        <volume>${it.chef.config}:/app/jetty/chef-solo/environments</volume>
+                                        <volume>${it.shared.volume}:/app/jetty/logs</volume>
                                         <volume>
-                                            ${it.chef.config}:/var/lib/jetty/chef-solo/environments
-                                        </volume>
-                                        <volume>${it.shared.volume}:/var/lib/jetty/logs</volume>
-                                        <volume>
-                                            ${it.chef.config}/plugins-configuration.yaml:/var/lib/jetty/config/catalog-fe/plugins-configuration.yaml
+                                            ${it.chef.config}/plugins-configuration.yaml:/app/jetty/config/catalog-fe/plugins-configuration.yaml
                                         </volume>
+
                                     </bind>
                                 </volumes>
                                 <wait>
@@ -728,8 +723,8 @@ limitations under the License.
                                 <hostname>sdc-sim</hostname>
                                 <volumes>
                                     <bind>
-                                        <volume>${it.chef.config}:/root/chef-solo/environments
-                                        </volume>
+                                        <volume>${it.chef.config}:/app/jetty/chef-solo/environments</volume>
+                                        <volume>${it.shared.volume}:/app/jetty/logs</volume>
                                     </bind>
                                 </volumes>
                                 <wait>
index 9c6275d..c3f3a75 100644 (file)
@@ -1,20 +1,18 @@
-FROM jetty:9.4.31-jre11-slim
+FROM onap/integration-java11:8.0.0
 
 USER root
+ARG JETTY_FOLDER=/app/jetty
 
 # Install Chef
 RUN set -ex && \
-    apt-get update -y && \
-    apt-get install -y \
-        jq \
-        curl \
-        vim \
-        make \
-        gcc \
+    apk update && \
+    apk add --no-cache \
+        build-base \
         ruby \
         ruby-dev \
         libffi-dev \
-        libxml2-dev && \
+        libxml2-dev \
+        libressl-dev && \
     gem install \
         chef:13.8.5 \
         berkshelf:6.3.1 \
@@ -22,33 +20,30 @@ RUN set -ex && \
         etc webrick \
         --no-document && \
     gem cleanup && \
-    apt-get update -y && \
-    apt-get install -y binutils jq && \
-    apt-get clean
-
-# Replace Jetty user ID
-ENV USER_JETTY="jetty"
-ENV GROUP_JETTY="jetty"
-ENV UID_JETTY="352070"
-ENV GID_JETTY="35953"
-
-# Remove user:
-RUN deluser ${USER_JETTY}
-#RUN delgroup ${GROUP_JETTY}
-RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd
-RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group
-RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow
-RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY}
-RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty
-
-USER jetty
-
-COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/
-COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/
-ADD --chown=jetty:jetty onboarding-be-*.war    ${JETTY_BASE}/webapps/
-ADD --chown=jetty:jetty api-docs.war           ${JETTY_BASE}/webapps/
-COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/
-
-RUN chmod 770 ${JETTY_BASE}/startup.sh
-
-ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]
+    apk update
+
+ENV JETTY_HOME=$JETTY_FOLDER
+ENV JETTY_BASE=$JETTY_FOLDER
+ENV JETTY_USER=onap
+ENV JETTY_GROUP=onap
+
+RUN mkdir $JETTY_FOLDER && chown onap:onap $JETTY_FOLDER
+
+USER onap
+
+#Download jetty
+RUN wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.31.v20200723/jetty-distribution-9.4.31.v20200723.tar.gz -O $JETTY_FOLDER/jetty.tar.gz && \
+        tar xvz -C $JETTY_FOLDER -f $JETTY_FOLDER/jetty.tar.gz --strip 1 && \
+        rm -rf $JETTY_FOLDER/jetty.tar.gz
+RUN sed -i 's/"jetty"/"onap"/g' $JETTY_FOLDER/etc/jetty-setuid.xml
+
+
+COPY --chown=onap:onap chef-solo $JETTY_FOLDER/chef-solo/
+COPY --chown=onap:onap chef-repo/cookbooks $JETTY_FOLDER/chef-solo/cookbooks/
+ADD --chown=onap:onap onboarding-be-*.war    $JETTY_FOLDER/webapps/
+ADD --chown=onap:onap api-docs.war           $JETTY_FOLDER/webapps/
+COPY --chown=onap:onap startup.sh $JETTY_FOLDER/
+
+RUN chmod 770 $JETTY_FOLDER/startup.sh
+
+ENTRYPOINT [ "sh", "-c", "${JETTY_HOME}/startup.sh"]
index 761edc9..074584a 100644 (file)
@@ -8,6 +8,7 @@ default['cassandra'][:truststore_password] = "Aa123456"
 default['jetty'][:keystore_pwd] = "?(kP!Yur![*!Y5!E^f(ZKc31"
 default['jetty'][:keymanager_pwd] = "?(kP!Yur![*!Y5!E^f(ZKc31"
 default['jetty'][:truststore_pwd] = "z+KEj;t+,KN^iimSiS89e#p0"
+default['jetty']['truststore_path'] = "#{ENV['JETTY_BASE']}/etc/truststore"
 
 default['VnfRepo']['vnfRepoPort'] = 8702
 default['VnfRepo']['vnfRepoHost'] = "refrepo"
index 2c703f2..305ff23 100644 (file)
@@ -1,23 +1,23 @@
 directory "tempdir_creation" do
   path "#{ENV['JETTY_BASE']}/temp"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
 
 directory "create_config_dir" do
   path "#{ENV['JETTY_BASE']}/config"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
 
 directory "onboarding-be" do
   path "#{ENV['JETTY_BASE']}/config/onboarding-be"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
index e482b69..1a67839 100644 (file)
@@ -1,22 +1,22 @@
 directory "Jetty_etcdir_creation" do
        path "#{ENV['JETTY_BASE']}/etc"
-       owner 'jetty'
-       group 'jetty'
+       owner "#{ENV['JETTY_USER']}"
+       group "#{ENV['JETTY_GROUP']}"
        mode '0755'
        action :create
 end
        
 cookbook_file "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.p12" do
    source "org.onap.sdc.p12"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode 0755
 end
 
 cookbook_file "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.trust.jks" do
    source "org.onap.sdc.trust.jks"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode 0755
 end
 
index 64a02e9..9fe7478 100644 (file)
@@ -5,22 +5,17 @@ else
   http_option = "--module=http"
 end
 
-
-bash "create-jetty-modules" do
-cwd "#{ENV['JETTY_BASE']}"
-code <<-EOH
-  cd "#{ENV['JETTY_BASE']}"
-  java -jar "#{ENV['JETTY_HOME']}"/start.jar --add-to-start=deploy
-  java -jar "#{ENV['JETTY_HOME']}"/start.jar --create-startd --add-to-start=http,https,console-capture,setuid
-EOH
+execute "create-jetty-modules" do
+  command "java -jar #{ENV['JETTY_HOME']}/start.jar --add-to-start=deploy && java -jar #{ENV['JETTY_HOME']}/start.jar --create-startd --add-to-start=http,https,console-capture,setuid"
+  cwd "#{ENV['JETTY_BASE']}"
+  action :run
 end
 
-
 template "http-ini" do
   path "#{ENV['JETTY_BASE']}/start.d/http.ini"
   source "http-ini.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0755"
   variables ({
     :http_option => http_option ,
@@ -33,8 +28,8 @@ end
 template "https-ini" do
   path "#{ENV['JETTY_BASE']}/start.d/https.ini"
   source "https-ini.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0755"
   variables :https_port => "#{node['ONBOARDING_BE'][:https_port]}"
 end
@@ -43,8 +38,8 @@ end
 template "ssl-ini" do
   path "#{ENV['JETTY_BASE']}/start.d/ssl.ini"
   source "ssl-ini.erb"
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode "0755"
   variables ({
     :https_port => "#{node['ONBOARDING_BE'][:https_port]}" ,
index d767ddd..e704842 100644 (file)
@@ -1,8 +1,8 @@
 template "onboard-be-config" do
    path "#{ENV['JETTY_BASE']}/config/onboarding-be/onboarding_configuration.yaml"
    source "configuration.yaml.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
       :onboard_ip                      => node['ONBOARDING_BE_VIP'],
@@ -32,8 +32,8 @@ end
 template "VnfrepoConfiguration" do
    path "#{ENV['JETTY_BASE']}/config/onboarding-be/config-vnfrepo.yaml"
    source "vnfrepo-configuration.yaml.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
       :VNFREPO_IP   => node['VnfRepo']['vnfRepoHost'],
@@ -46,8 +46,8 @@ end
 template "ExternalTestingConfiguration" do
    path "#{ENV['JETTY_BASE']}/config/onboarding-be/externaltesting-configuration.yaml"
    source "externaltesting-configuration.yaml.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
       :EP1_CONFIG => node['EXTTEST']['ep1_config'],
index c84e660..2660eb0 100644 (file)
@@ -1,14 +1,13 @@
 cookbook_file "#{ENV['JETTY_BASE']}/resources/base_template.yaml" do
   source "base_template.yaml"
   mode 0644
-  owner "jetty"
-  group "jetty"
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
 end
+
 cookbook_file "#{ENV['JETTY_BASE']}/resources/base_template.env" do
   source "base_template.env"
   mode 0644
-  owner "jetty"
-  group "jetty"
-end
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
+end
\ No newline at end of file
index a7b0411..853fcf7 100644 (file)
@@ -28,7 +28,7 @@ cassandraConfig:
     username: <%= @cassandra_usr %>
     password: <%= @cassandra_pwd %>
     ssl: <%= @cassandra_ssl_enabled %>
-    truststorePath: /var/lib/jetty/etc/truststore
+    truststorePath: <%= node['jetty']['truststore_path'] %>
     truststorePassword: <%= @cassandra_truststore_password %>
 
 # access restriction
index bea3c34..4ca281c 100644 (file)
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
 health_check_http_code=$(curl -k --max-time 5 -o /dev/null -w '%{http_code}' -X GET --header "Accept: application/json" "<%= @protocol %>://127.0.0.1:<%= @port %>/onboarding-api/v1.0/healthcheck")
-if [[ "$health_check_http_code" -eq 200 ]]; then
+if [ "$health_check_http_code" -eq 200 ]; then
   exit 0
 else
   echo "Health check http status: $health_check_http_code"
index cf1b622..7381d50 100644 (file)
@@ -1,21 +1,18 @@
 #!/bin/sh
 
-cd /var/lib/jetty/chef-solo
-chef-solo -c solo.rb -E ${ENVNAME}
-rc=$?
-if [ $rc -ne 0 ]; then
-    echo "Chef exaction failed."
-    exit $rc;
-fi
+JAVA_OPTIONS="$JAVA_OPTIONS \
+            -Dcom.datastax.driver.USE_NATIVE_CLOCK=false \
+            -Dconfig.home=$JETTY_BASE/config \
+            -Dlog.home=$JETTY_BASE/logs \
+            -Dlogback.configurationFile=$JETTY_BASE/config/onboarding-be/logback.xml \
+            -Dconfiguration.yaml=$JETTY_BASE/config/onboarding-be/onboarding_configuration.yaml \
+            -Dconfig.location=$JETTY_BASE/config/onboarding-be/."
 
+cd $JETTY_BASE
 
-JAVA_OPTIONS=" ${JAVA_OPTIONS} \
-            -Dconfig.home=${JETTY_BASE}/config \
-            -Dlog.home=${JETTY_BASE}/logs \
-            -Dlogback.configurationFile=${JETTY_BASE}/config/onboarding-be/logback.xml \
-            -Dconfiguration.yaml=${JETTY_BASE}/config/onboarding-be/onboarding_configuration.yaml \
-            -Dconfig.location=${JETTY_BASE}/config/onboarding-be/."
+cd $JETTY_BASE/chef-solo
+chef-solo -c solo.rb -E ${ENVNAME}
 
-cd /var/lib/jetty
+cd $JETTY_HOME
 
-java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar"
+java $JAVA_OPTIONS -jar "${JETTY_HOME}/start.jar"
index 3002ff5..ce0de87 100644 (file)
                 <groupId>io.fabric8</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
                 <configuration>
-                    <apiVersion>1.23</apiVersion>
+                    <verbose>${verbose}</verbose>
+                    <apiVersion>${docker.api.version}</apiVersion>
                     <registry>${docker.registry}</registry>
                     <authConfig>
                         <pull>
index 226654d..8408d2f 100644 (file)
@@ -25,17 +25,14 @@ RUN apt-get update && apt-get install -y python-pip && \
     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 init_keyspaces.cql /home/sdc/
-
 COPY --chown=sdc:sdc init_schemas.cql /home/sdc/
-
-COPY --chown=sdc:sdc alter_tables.cql /home/sdc/ 
-
+COPY --chown=sdc:sdc alter_tables.cql /home/sdc/
 COPY --chown=sdc:sdc startup.sh /home/sdc/ 
 
 RUN chmod 770 /home/sdc/startup.sh
index 2f398b2..92bf869 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 cd /home/sdc
 
@@ -21,7 +21,7 @@ cqlsh -u $SDC_USER -p $SDC_PASSWORD -f init_keyspaces.cql $CS_HOST $CS_PORT
 rc=$?
 date;
 
-if [[ $rc != 0 ]]; then
+if [ $rc != 0 ]; then
        echo "[Error] Failed to initialize onboard keyspaces";
        exit $rc;
 fi
@@ -32,7 +32,7 @@ cqlsh -u $SDC_USER -p $SDC_PASSWORD -f init_schemas.cql $CS_HOST $CS_PORT
 rc=$?
 date;
 
-if [[ $rc != 0 ]]; then
+if [ $rc != 0 ]; then
        echo "[Error] Failed to initialize onboard schemas";
        exit $rc;
 fi
index 9ce1125..e4ea7a7 100644 (file)
@@ -59,6 +59,7 @@
                 <artifactId>docker-maven-plugin</artifactId>
 
                 <configuration>
+                    <verbose>${verbose}</verbose>
                     <apiVersion>${docker.api.version}</apiVersion>
                     <registry>nexus3.onap.org:10001</registry>
                     <authConfig>
diff --git a/pom.xml b/pom.xml
index 1babc00..00ec81f 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -176,6 +176,8 @@ Modifications copyright (c) 2018-2019 Nokia
 
         <docker.api.version>1.35</docker.api.version>
         <bouncycastle.version>1.68</bouncycastle.version>
+
+        <verbose>false</verbose>
     </properties>
 
     <dependencyManagement>
index c5d82ce..01cc295 100644 (file)
@@ -59,6 +59,7 @@
                         <groupId>io.fabric8</groupId>
                         <artifactId>docker-maven-plugin</artifactId>
                         <configuration>
+                            <verbose>${verbose}</verbose>
                             <apiVersion>${docker.api.version}</apiVersion>
                             <registry>nexus3.onap.org:10001</registry>
                             <authConfig>
index a9d7180..d3f5da6 100644 (file)
@@ -8,16 +8,16 @@ pass_changed=99
 retry_num=1
 is_up=0
 while [ $is_up -eq 0 -a $retry_num -le 100 ]; do
-   echo "exit" | cqlsh -u cassandra -p cassandra $CASSANDRA_IP $CASSANDRA_PORT > /dev/null 2>&1
+   echo "exit" | cqlsh -u cassandra -p cassandra $CASSANDRA_IP $CASSANDRA_PORT
    res1=$?
-   echo "exit" | cqlsh -u cassandra -p $CASSANDRA_PASS $CASSANDRA_IP $CASSANDRA_PORT > /dev/null 2>&1
+   echo "exit" | cqlsh -u cassandra -p $CASSANDRA_PASS $CASSANDRA_IP $CASSANDRA_PORT
    res2=$?
 
    if [ $res1 -eq 0 -o $res2 -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++"
index 0c25336..ca95ef8 100644 (file)
             <groupId>io.fabric8</groupId>
             <artifactId>docker-maven-plugin</artifactId>
             <configuration>
+              <verbose>${verbose}</verbose>
               <apiVersion>${docker.api.version}</apiVersion>
               <registry>nexus3.onap.org:10001</registry>
               <authConfig>
index 24a7dd1..31af19e 100644 (file)
@@ -1,17 +1,13 @@
-FROM jetty:9.4.31-jre11-slim
+FROM onap/integration-java11:8.0.0
 
 USER root
+ARG JETTY_FOLDER=/app/jetty
 
 # Install Chef
 RUN set -ex && \
-    apt-get update -y && \
-    apt-get install -y \
-        jq \
-        curl \
-        curl \
-        vim \
-        make \
-        gcc \
+    apk update && \
+    apk add --no-cache \
+        build-base \
         ruby \
         ruby-dev \
         libffi-dev \
@@ -23,39 +19,28 @@ RUN set -ex && \
         etc webrick \
         --no-document && \
     gem cleanup && \
-    apt-get update -y && \
-    apt-get install -y binutils jq && \
-    apt-get clean
+    apk update
 
-# Replace Jetty user ID
-ENV USER_JETTY="jetty"
-ENV GROUP_JETTY="jetty"
-ENV UID_JETTY="352070"
-ENV GID_JETTY="35953"
+ENV JETTY_HOME=$JETTY_FOLDER
+ENV JETTY_BASE=$JETTY_FOLDER
+ENV JETTY_USER=onap
+ENV JETTY_GROUP=onap
 
-# Remove user:
-RUN deluser ${USER_JETTY}
-#RUN delgroup ${GROUP_JETTY}
-RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd
-RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group
-RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow
-RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY}
-RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty
+RUN mkdir $JETTY_FOLDER && chown onap:onap $JETTY_FOLDER
 
-USER jetty
+USER onap
 
-COPY chef-solo /root/chef-solo/
+#Download jetty
+RUN wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.31.v20200723/jetty-distribution-9.4.31.v20200723.tar.gz -O $JETTY_FOLDER/jetty.tar.gz && \
+        tar xvz -C $JETTY_FOLDER -f $JETTY_FOLDER/jetty.tar.gz --strip 1 && \
+        rm -rf $JETTY_FOLDER/jetty.tar.gz
+RUN sed -i 's/"jetty"/"onap"/g' $JETTY_FOLDER/etc/jetty-setuid.xml
 
-COPY chef-repo/cookbooks /root/chef-solo/cookbooks/
+COPY --chown=onap:onap chef-solo $JETTY_FOLDER/chef-solo/
+COPY --chown=onap:onap  chef-repo/cookbooks $JETTY_FOLDER/chef-solo/cookbooks/
+ADD --chown=onap:onap WSSimulator*.war                         $JETTY_FOLDER/webapps/
+COPY --chown=onap:onap startup.sh $JETTY_FOLDER/
 
-ADD WSSimulator*.war                           ${JETTY_BASE}/webapps/
+RUN chmod 770 $JETTY_FOLDER/startup.sh
 
-USER root
-
-RUN chown -R jetty:jetty                               ${JETTY_BASE}/webapps
-
-COPY startup.sh ${JETTY_BASE}/
-
-RUN chmod 777 ${JETTY_BASE}/startup.sh
-
-ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]
+ENTRYPOINT [ "sh", "-c", "${JETTY_HOME}/startup.sh"]
index c02aa7e..a1156ee 100644 (file)
@@ -1,7 +1,7 @@
 directory "SDC_Simulator_tempdir_creation" do
   path "#{ENV['JETTY_BASE']}/temp"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
@@ -9,8 +9,8 @@ end
 
 directory "SDC_Simulator_create_config_dir" do
   path "#{ENV['JETTY_BASE']}/config"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
@@ -18,8 +18,8 @@ end
 
 directory "SDC_Simulator_create_sdc-simulator" do
   path "#{ENV['JETTY_BASE']}/config/sdc-simulator"
-  owner 'jetty'
-  group 'jetty'
+  owner "#{ENV['JETTY_USER']}"
+  group "#{ENV['JETTY_GROUP']}"
   mode '0755'
   action :create
 end
index bf859f1..3769a1f 100644 (file)
@@ -10,8 +10,8 @@ end
 template "webseal.conf" do
    path "#{ENV['JETTY_BASE']}/config/sdc-simulator/webseal.conf"
    source "SDC-Simulator-webseal.conf.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
       :fe_url  =>"#{fe_url}"
index 14f83c3..3abca7b 100644 (file)
@@ -1,7 +1,7 @@
 cookbook_file "log4j2.properties" do
    path "#{ENV['JETTY_BASE']}/config/sdc-simulator/log4j2.properties"
    source "log4j2.properties"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
 end
\ No newline at end of file
index e0b106d..4c83e79 100644 (file)
@@ -1,21 +1,21 @@
 directory "Jetty_etcdir_creation" do
        path "#{ENV['JETTY_BASE']}/etc"
-       owner 'jetty'
-       group 'jetty'
+       owner "#{ENV['JETTY_USER']}"
+       group "#{ENV['JETTY_GROUP']}"
        mode '0755'
        action :create
 end
 
 cookbook_file "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.trust.jks" do
    source "org.onap.sdc.trust.jks"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode 0755
 end
 
 cookbook_file "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.p12" do
        source "org.onap.sdc.p12"
-       owner "jetty"
-       group "jetty"
+       owner "#{ENV['JETTY_USER']}"
+       group "#{ENV['JETTY_GROUP']}"
        mode 0755
 end
index 5b67561..5e0d8eb 100644 (file)
@@ -6,22 +6,17 @@ else
    http_option = "--module=http"
 end
 
-
-bash "create-jetty-modules" do
-   cwd "#{ENV['JETTY_BASE']}"
-   code <<-EOH
-   cd "#{ENV['JETTY_BASE']}"
-   java -jar "#{ENV['JETTY_HOME']}"/start.jar --add-to-start=deploy
-   java -jar "#{ENV['JETTY_HOME']}"/start.jar --create-startd --add-to-start=http,https,console-capture,setuid
-   EOH
+execute "create-jetty-modules" do
+  command "java -jar #{ENV['JETTY_HOME']}/start.jar --add-to-start=deploy && java -jar #{ENV['JETTY_HOME']}/start.jar --create-startd --add-to-start=http,https,console-capture,setuid"
+  cwd "#{ENV['JETTY_BASE']}"
+  action :run
 end
 
-
 template "http-ini" do
    path "#{ENV['JETTY_BASE']}/start.d/http.ini"
    source "SDC-Simulator-http-ini.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
       :http_option => http_option,
@@ -33,8 +28,8 @@ end
 template "https-ini" do
    path "#{ENV['JETTY_BASE']}/start.d/https.ini"
    source "SDC-Simulator-https-ini.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
       :https_port => "8443"
@@ -46,8 +41,8 @@ end
 template "ssl-ini" do
    path "#{ENV['JETTY_BASE']}/start.d/ssl.ini"
    source "SDC-Simulator-ssl-ini.erb"
-   owner "jetty"
-   group "jetty"
+   owner "#{ENV['JETTY_USER']}"
+   group "#{ENV['JETTY_GROUP']}"
    mode "0755"
    variables({
      :https_port           => "8443",
@@ -57,10 +52,7 @@ template "ssl-ini" do
    })
 end
 
-
-bash "echo status" do
-   code <<-EOH
-      echo "DOCKER STARTED"
-   EOH
-end
-
+execute "echo status" do
+  command "echo 'DOCKER STARTED'"
+  action :run
+end
\ No newline at end of file
index 3f6e2a0..e8774be 100644 (file)
@@ -1,24 +1,19 @@
 #!/bin/sh
 
-cd /root/chef-solo
-chef-solo -c solo.rb -E ${ENVNAME}
-rc=$?
-if [ $rc -ne 0 ]; then
-    echo "Chef exaction failed."
-    exit $rc;
-fi
-
-JAVA_OPTIONS=" ${JAVA_OPTIONS} \
+JAVA_OPTIONS=" $JAVA_OPTIONS \
                -Xdebug -agentlib:jdwp=transport=dt_socket,address=5000,server=y,suspend=n -Xmx128m -Xms128m -Xss1m \
-                -Dconfig.home=${JETTY_BASE}/config/sdc-simulator \
-                -Dlog.home=${JETTY_BASE}/logs \
-                -Dlogback.configurationFile=${JETTY_BASE}/config/sdc-simulator/logback.xml \
-                -Djavax.net.ssl.trustStore=${JETTY_BASE}/etc/org.onap.sdc.trust.jks \
+                -Dconfig.home=$JETTY_BASE/config/sdc-simulator \
+                -Dlog.home=$JETTY_BASE/logs \
+                -Dlogback.configurationFile=$JETTY_BASE/config/sdc-simulator/logback.xml \
+                -Djavax.net.ssl.trustStore=$JETTY_BASE/etc/org.onap.sdc.trust.jks \
                 -Djavax.net.ssl.trustStorePassword=z+KEj;t+,KN^iimSiS89e#p0 \
-                -Djetty.console-capture.dir=${JETTY_BASE}/logs"
+                -Djetty.console-capture.dir=$JETTY_BASE/logs"
 
 
-cd /var/lib/jetty
+cd $JETTY_BASE/chef-solo
+chef-solo -c solo.rb -E ${ENVNAME}
+
+cd $JETTY_HOME
 
-java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar"
+java $JAVA_OPTIONS -jar "${JETTY_HOME}/start.jar"