aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources/src/main/swm
diff options
context:
space:
mode:
authorVenkata Harish K Kajur <vk250x@att.com>2018-01-30 13:52:34 -0500
committerVenkata Harish K Kajur <vk250x@att.com>2018-02-28 11:36:08 -0500
commit4f13d6cc64eed0ef75a31ec5f490853267447ab1 (patch)
treecb7066e12fc39038cc99b74bbeba879c9eb6ca8c /aai-resources/src/main/swm
parent73539cae6d24e352b84a6411e523da734fbc19e2 (diff)
Turn ajsc 2 to using ajsc 6 spring boot
Issue-ID: AAI-800 Change-Id: Id174ec5088ddea57f18e605d004c417bee8fbf33 Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-resources/src/main/swm')
-rw-r--r--aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/docker-compose.template.yaml41
-rw-r--r--aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/execTool.sh18
-rwxr-xr-xaai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/kill_resources.sh7
-rwxr-xr-xaai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/start_resources.sh6
-rwxr-xr-xaai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/stop_resources.sh6
-rw-r--r--aai-resources/src/main/swm/package/nix/install/postproc/post_proc4
-rw-r--r--aai-resources/src/main/swm/package/nix/install/preproc/pre_proc4
7 files changed, 86 insertions, 0 deletions
diff --git a/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/docker-compose.template.yaml b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/docker-compose.template.yaml
new file mode 100644
index 0000000..5a2712b
--- /dev/null
+++ b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/docker-compose.template.yaml
@@ -0,0 +1,41 @@
+#
+# ============LICENSE_START=======================================================
+# org.onap.aai
+# ================================================================================
+# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+#
+
+# SCLD_ENV is for the environment context for dme2
+# AAI_CHEF_ENV is used for both dme2 properites and
+# also used by chef to generate appropriate properties
+
+version: '2'
+services:
+ aai-resources:
+ image: __REGISTRY__/__NAMESPACE__/aai-resources:__IMAGE_VERSION__
+ network_mode: host
+ environment:
+ - LOCAL_USER_ID=__LOCAL_USER_ID__
+ - LOCAL_GROUP_ID=__LOCAL_GROUP_ID__
+ volumes:
+ - /opt/aai/logroot/AAI-RES:/opt/aai/logroot/AAI-RES
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "30m"
+ max-file: "5"
diff --git a/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/execTool.sh b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/execTool.sh
new file mode 100644
index 0000000..8613410
--- /dev/null
+++ b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/execTool.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+
+export WORKING_DIR="$( cd "$(dirname "$0")" ; pwd -P )/"
+
+CONTAINER_NAME=$(docker ps | grep 'aai-resources' | awk '{ print $7; }');
+
+SCRIPT_NAME=$1;
+
+shift;
+
+docker exec -u aaiadmin ${CONTAINER_NAME} ls /opt/app/aai-resources/scripts/${SCRIPT_NAME} && {
+ docker exec -u aaiadmin ${CONTAINER_NAME} /opt/app/aai-resources/scripts/${SCRIPT_NAME} "$@"
+ exit 0;
+} || {
+ echo "Unable to find the tool in the /opt/app/aai-resources/scripts";
+ exit 1;
+}
diff --git a/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/kill_resources.sh b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/kill_resources.sh
new file mode 100755
index 0000000..d8e14e5
--- /dev/null
+++ b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/kill_resources.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+. /etc/profile.d/aai.sh
+PROJECT_HOME=/opt/app/aai-resources
+
+docker-compose -f ${PROJECT_HOME}/docker-compose.yaml stop && \
+ docker-compose -f ${PROJECT_HOME}/docker-compose.yaml rm -f
diff --git a/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/start_resources.sh b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/start_resources.sh
new file mode 100755
index 0000000..e9d73ec
--- /dev/null
+++ b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/start_resources.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+. /etc/profile.d/aai.sh
+PROJECT_HOME=/opt/app/aai-resources
+
+docker-compose -f ${PROJECT_HOME}/docker-compose.yaml up -d || exit 200
diff --git a/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/stop_resources.sh b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/stop_resources.sh
new file mode 100755
index 0000000..05bd23d
--- /dev/null
+++ b/aai-resources/src/main/swm/package/nix/dist_files/opt/app/aai-resources/stop_resources.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+. /etc/profile.d/aai.sh
+PROJECT_HOME=/opt/app/aai-resources
+
+docker-compose -f ${PROJECT_HOME}/docker-compose.yaml stop || exit 200
diff --git a/aai-resources/src/main/swm/package/nix/install/postproc/post_proc b/aai-resources/src/main/swm/package/nix/install/postproc/post_proc
new file mode 100644
index 0000000..d017750
--- /dev/null
+++ b/aai-resources/src/main/swm/package/nix/install/postproc/post_proc
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd ../../common
+exec sh -x ./install_postproc.sh
diff --git a/aai-resources/src/main/swm/package/nix/install/preproc/pre_proc b/aai-resources/src/main/swm/package/nix/install/preproc/pre_proc
new file mode 100644
index 0000000..3f1b26f
--- /dev/null
+++ b/aai-resources/src/main/swm/package/nix/install/preproc/pre_proc
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd ../../common
+exec sh -x ./install_preproc.sh