diff options
author | 2017-05-22 11:49:24 -0400 | |
---|---|---|
committer | 2017-05-22 11:50:43 -0400 | |
commit | 71cdfb9453a11da6cca7b1a7828c29c37d136617 (patch) | |
tree | 5d2576c3af9be180ddab6ba25cb408c44edfd9e0 | |
parent | 9a55549bd44151c424d3033692f677d697f4f1a5 (diff) |
Update the docker entrypoint to integrate chef
Change-Id: If0f1da9bdfa907405beab879e22ece04aff0b31f
Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
-rw-r--r-- | aai-resources/src/main/resources/docker/docker-entrypoint.sh | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/aai-resources/src/main/resources/docker/docker-entrypoint.sh b/aai-resources/src/main/resources/docker/docker-entrypoint.sh index b22ab39..47ee81f 100644 --- a/aai-resources/src/main/resources/docker/docker-entrypoint.sh +++ b/aai-resources/src/main/resources/docker/docker-entrypoint.sh @@ -18,17 +18,44 @@ # ============LICENSE_END========================================================= ### -cd /opt/app/aai-resources; +cd /var/chef; -TITAN_CACHED="/opt/app/aai-resources/bundleconfig/etc/appprops/titan-cached.properties"; -TITAN_REALTIME="/opt/app/aai-resources/bundleconfig/etc/appprops/titan-realtime.properties"; -SERVER_HOST=${SERVER_HOST:-localhost}; -SERVER_TABLE=${SERVER_TABLE:-aaigraph-dev02}; +CHEF_CONFIG_REPO=${CHEF_CONFIG_REPO:-aai-config}; -sed -i 's/^storage.backend=inmemory/storage.backend=hbase/g' $TITAN_CACHED $TITAN_REALTIME; -sed -i "s/^storage.hostname=.*$/storage.hostname=${SERVER_HOST}/g" $TITAN_CACHED $TITAN_REALTIME; -sed -i "s/^storage.hbase.table=.*$/storage.hbase.table=${SERVER_TABLE}/g" $TITAN_CACHED $TITAN_REALTIME; +CHEF_GIT_URL=${CHEF_GIT_URL:-http://nexus.onap.org/r/aai}; -/opt/app/aai-resources/bin/createDBSchema.sh; +CHEF_CONFIG_GIT_URL=${CHEF_CONFIG_GIT_URL:-$CHEF_GIT_URL}; +CHEF_DATA_GIT_URL=${CHEF_DATA_GIT_URL:-$CHEF_GIT_URL}; + +if [ ! -d "aai-config" ]; then + + git clone --depth 1 -b ${CHEF_BRANCH} --single-branch ${CHEF_CONFIG_GIT_URL}/${CHEF_CONFIG_REPO}.git aai-config || { + echo "Error: Unable to clone the aai-config repo with url: ${CHEF_GIT_URL}/${CHEF_CONFIG_REPO}.git"; + exit; + } + + (cd aai-config/cookbooks/${project.artifactId}/ && \ + for f in $(ls); do mv $f ../; done && \ + cd ../ && rmdir ${project.artifactId}); +fi + +if [ ! -d "aai-data" ]; then + + git clone --depth 1 -b ${CHEF_BRANCH} --single-branch ${CHEF_DATA_GIT_URL}/aai-data.git aai-data || { + echo "Error: Unable to clone the aai-data repo with url: ${CHEF_GIT_URL}"; + exit; + } + + chef-solo \ + -c /var/chef/aai-data/chef-config/dev/.knife/solo.rb \ + -j /var/chef/aai-config/cookbooks/runlist-${project.artifactId}.json \ + -E ${AAI_CHEF_ENV}; + + /opt/app/aai-resources/bin/createDBSchema.sh || { + echo "Error: Unable to create the db schema, please check if the hbase host is configured and up"; + exit; + } + +fi 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 |