diff options
Diffstat (limited to 'aai-resources/src/main/swm/package/nix/dist_files/opt')
5 files changed, 78 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 |