059ef45eb29fa20aebfe8469a02e8fd92919aa20
[oom.git] / kubernetes / config / docker / init / src / config / aai / aai-resources / docker-entrypoint.sh
1 ###
2 # ============LICENSE_START=======================================================
3 # org.openecomp.aai
4 # ================================================================================
5 # Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 # ================================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10
11 #      http://www.apache.org/licenses/LICENSE-2.0
12
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ============LICENSE_END=========================================================
19 ###
20
21 cd /var/chef;
22
23 CHEF_CONFIG_REPO=${CHEF_CONFIG_REPO:-aai-config};
24
25 CHEF_GIT_URL=${CHEF_GIT_URL:-http://nexus.onap.org/r/aai};
26
27 CHEF_CONFIG_GIT_URL=${CHEF_CONFIG_GIT_URL:-$CHEF_GIT_URL};
28 CHEF_DATA_GIT_URL=${CHEF_DATA_GIT_URL:-$CHEF_GIT_URL};
29
30 if [ ! -d "aai-config" ]; then
31
32     git clone --depth 1 -b ${CHEF_BRANCH} --single-branch ${CHEF_CONFIG_GIT_URL}/${CHEF_CONFIG_REPO}.git aai-config || {
33         echo "Error: Unable to clone the aai-config repo with url: ${CHEF_GIT_URL}/${CHEF_CONFIG_REPO}.git";
34         exit;
35     }
36
37     (cd aai-config/cookbooks/aai-resources/ && \
38         for f in $(ls); do mv $f ../; done && \
39         cd ../ && rmdir aai-resources);
40 fi
41
42
43 chef-solo \
44     -c /var/chef/aai-data/chef-config/dev/.knife/solo.rb \
45     -j /var/chef/aai-config/cookbooks/runlist-aai-resources.json \
46     -E ${AAI_CHEF_ENV};
47
48 # TODO: If this runs, startup hangs and logs errors indicating aaiGraph.dev already exists in HBASE.
49 # Commenting out until we figure out whether it is needed or not.
50 # /opt/app/aai-resources/bin/createDBSchema.sh || {
51 #     echo "Error: Unable to create the db schema, please check if the hbase host is configured and up";
52 #     exit;
53 # }
54
55
56 java -cp ${CLASSPATH}:/opt/app/commonLibs/*:/opt/app/aai-resources/etc:/opt/app/aai-resources/lib/*:/opt/app/aai-resources/extJars/logback-access-1.1.7.jar:/opt/app/aai-resources/extJars/logback-core-1.1.7.jar:/opt/app/aai-resources/extJars/aai-core-${AAI_CORE_VERSION}.jar -server -XX:NewSize=512m -XX:MaxNewSize=512m -XX:SurvivorRatio=8 -XX:+DisableExplicitGC -verbose:gc -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:-UseBiasedLocking -XX:ParallelGCThreads=4 -XX:LargePageSizeInBytes=128m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dsun.net.inetaddr.ttl=180 -XX:+HeapDumpOnOutOfMemoryError -Dhttps.protocols=TLSv1.1,TLSv1.2 -DSOACLOUD_SERVICE_VERSION=1.0.1 -DAJSC_HOME=/opt/app/aai-resources/ -DAJSC_CONF_HOME=/opt/app/aai-resources/bundleconfig -DAJSC_SHARED_CONFIG=/opt/app/aai-resources/bundleconfig -DAFT_HOME=/opt/app/aai-resources -DAAI_CORE_VERSION=${AAI_CORE_VERSION} -Daai-core.version=${AAI_CORE_VERSION} -Dlogback.configurationFile=/opt/app/aai-resources/bundleconfig/etc/logback.xml -Xloggc:/opt/app/aai-resources/logs/ajsc-jetty/gc/graph-query_gc.log com.att.ajsc.runner.Runner context=/ port=8087 sslport=8447