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>
<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>
echo '[cql]' > ~/.cassandra/cqlshrc && \
echo 'version=3.4.4' >> ~/.cassandra/cqlshrc && \
set -ex && \
- pip install cqlsh && \
apt-get install -y \
make \
gcc \
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
})
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
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
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"
})
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
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
-#!/bin/bash
+#!/bin/sh
CASSANDRA_IP=<%= @cassandra_ip %>
CASSANDRA_PORT=<%= @cassandra_port %>
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`
-#!/bin/bash
+#!/bin/sh
CASSANDRA_USER='<%= @cassandra_usr %>'
CASSANDRA_PASS='<%= @cassandra_pwd %>'
-#!/bin/bash
+#!/bin/sh
##############################
# Distribution Status Update 1707
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"
-#!/bin/bash
+#!/bin/sh
##############################
# Artifact Validator Tool #
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"
-#!/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
-#!/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.main.MigrationMenu"
-#!/bin/bash
+#!/bin/sh
#####################################
# delete all products from JanusGraph
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"
-#!/bin/bash
+#!/bin/sh
##############################
# Distribution Status Update 1707
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"
-#!/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.main.MigrationMenu"
-#!/bin/bash
+#!/bin/sh
##############################
# Distribution Status Update 1707
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"
-#!/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"
-#!/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"
-#!/bin/bash
+#!/bin/sh
##################################
# export all users from JanusGraph
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"
-#!/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.main.MigrationMenu"
-#!/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.main.MigrationMenu"
-#!/bin/bash
+#!/bin/sh
##############################
# Distribution Status Update 1707
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"
-#!/bin/bash
+#!/bin/sh
##############################
# Groups Alignment
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"
-#!/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"
-#!/bin/bash
+#!/bin/sh
##############################
# JanusGraph Schema Creation
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"
-#!/bin/bash
+#!/bin/sh
##############################
# Data Migration: fix relations after migration 1707
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"
-#!/bin/bash
+#!/bin/sh
##############################
# Data Migration 1707
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"
-#!/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.main.DataSchemaMenu"
-#!/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"
-#!/bin/bash
+#!/bin/sh
##############################
# Sdc Schema File Import #
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"
-#!/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"
-#!/bin/bash
+#!/bin/sh
##############################
# Data Migration: Upgrade Post Migration 1710
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"
-#!/bin/bash
+#!/bin/sh
##############################
# Validation Tool #
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"
-#!/bin/bash
+#!/bin/sh
##############################
# Data Migration: Adding new properties to vfModules
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"
-#!/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.main.MigrationMenu"
-#!/bin/bash
+#!/bin/sh
##############################
# Distribution Status Update 1707
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"
-#!/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.main.VrfObjectFixMenu"
<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>
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
<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>
-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
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
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
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
#!/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
-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 \
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
#+----------------------------------+
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"
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
#+----------------------------------+
# 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"
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") }
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
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
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
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
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
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({
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({
: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],
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
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
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 ,
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
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]}" ,
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}",
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'],
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']
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
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
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
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:
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 %>']}
username: user
password:
aftDme2SslEnable: true
- aftDme2ClientKeystore: /var/lib/jetty/etc/truststore
+ aftDme2ClientKeystore: <%= node['jetty']['truststore_path'] %>
aftDme2ClientKeystorePassword: ""
aftDme2ClientSslCertAlias: certman
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
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
-#!/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"
#!/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"
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
<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>
-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 \
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
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
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
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
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'],
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
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
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
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
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
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
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 ,
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
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]}" ,
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
-#!/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"
#!/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"
</dependency>
</dependencies>
<configuration>
- <verbose>true</verbose>
+ <verbose>${verbose}</verbose>
<apiVersion>${docker.api.version}</apiVersion>
<autoCreateCustomNetworks>true</autoCreateCustomNetworks>
<images>
<bind>
<volume>${it.chef.config}:/home/sdc/chef-solo/environments
</volume>
+
</bind>
</volumes>
<wait>
<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>
<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>
<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>
<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>
<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>
-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 \
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"]
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"
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
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
cookbook_file "#{ENV['JETTY_BASE']}/config/onboarding-be/logback.xml" do
source "logback.xml"
mode 0755
- owner "jetty"
- group "jetty"
+ owner "#{ENV['JETTY_USER']}"
+ group "#{ENV['JETTY_GROUP']}"
end
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 ,
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
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]}" ,
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'],
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'],
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'],
port = "#{node['ONBOARDING_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
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
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
-#!/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"
#!/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"
<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>
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
-#!/bin/bash
+#!/bin/sh
cd /home/sdc
rc=$?
date;
-if [[ $rc != 0 ]]; then
+if [ $rc != 0 ]; then
echo "[Error] Failed to initialize onboard keyspaces";
exit $rc;
fi
rc=$?
date;
-if [[ $rc != 0 ]]; then
+if [ $rc != 0 ]; then
echo "[Error] Failed to initialize onboard schemas";
exit $rc;
fi
<artifactId>docker-maven-plugin</artifactId>
<configuration>
+ <verbose>${verbose}</verbose>
<apiVersion>${docker.api.version}</apiVersion>
<registry>nexus3.onap.org:10001</registry>
<authConfig>
<docker.api.version>1.35</docker.api.version>
<bouncycastle.version>1.68</bouncycastle.version>
+
+ <verbose>false</verbose>
</properties>
<dependencyManagement>
<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>
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++"
<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>
-#!/bin/bash
+#!/bin/sh
export PREFIX=${NEXUS_DOCKER_REPO}'/onap'
PREFIX='onap'
-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 \
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"]
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
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
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
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}"
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
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
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,
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"
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",
})
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
#!/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"