blob: ac888390fd85a5beb7cad30fade336ae9f0ffc4c [file] [log] [blame]
Instrumental32cdd552018-07-19 13:29:32 -05001#!/bin/bash
Instrumental7a1817b2018-11-05 11:11:15 -06002#########
3# ============LICENSE_START====================================================
4# org.onap.aaf
5# ===========================================================================
6# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
7# ===========================================================================
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19# ============LICENSE_END====================================================
20#
21
Instrumental32cdd552018-07-19 13:29:32 -050022. ./d.props
23
Instrumental94053612018-10-08 11:27:18 -050024DOCKER=${DOCKER:=docker}
Instrumentale2fa0e62019-02-07 11:09:32 -060025# if something, may not want CASS attached all the tim
26LINKS="--link $CASSANDRA_DOCKER"
27
Instrumentalab502672018-08-20 14:31:35 -050028function run_it() {
Instrumental94053612018-10-08 11:27:18 -050029 $DOCKER run $@ \
Instrumentale2fa0e62019-02-07 11:09:32 -060030 --user aaf \
Instrumental94053612018-10-08 11:27:18 -050031 -v "aaf_config:$CONF_ROOT_DIR" \
Instrumentalca788dc2018-11-03 14:38:21 -050032 -v "aaf_status:/opt/app/aaf/status" \
Instrumentale2fa0e62019-02-07 11:09:32 -060033 $LINKS \
Instrumental12414fe2019-01-22 10:27:32 -060034 --env aaf_locator_container=docker \
Instrumental27afb022019-02-07 16:36:56 -060035 --env aaf_locator_container_ns=${NAMESPACE} \
Instrumental12414fe2019-01-22 10:27:32 -060036 --env aaf_locator_fqdn=${HOSTNAME} \
37 --env aaf_locate_url=https://aaf-locate:8095 \
Instrumental27afb022019-02-07 16:36:56 -060038 --env aaf_locator_public_hostname=${HOSTNAME} \
Instrumental32cdd552018-07-19 13:29:32 -050039 --env AAF_ENV=${AAF_ENV} \
Instrumental32cdd552018-07-19 13:29:32 -050040 --env LATITUDE=${LATITUDE} \
41 --env LONGITUDE=${LONGITUDE} \
Instrumental196000b2018-10-05 19:30:59 -050042 --env CASSANDRA_CLUSTER=${CASSANDRA_CLUSTER} \
43 --env CASSANDRA_USER=${CASSANDRA_USER} \
44 --env CASSANDRA_PASSWORD=${CASSANDRA_PASSWORD} \
45 --env CASSANDRA_PORT=${CASSANDRA_PORT} \
Instrumental32cdd552018-07-19 13:29:32 -050046 --name aaf_config_$USER \
Instrumentale44d2f72018-08-16 17:22:45 -050047 $PREFIX${ORG}/${PROJECT}/aaf_config:${VERSION} \
Instrumental12414fe2019-01-22 10:27:32 -060048 bash -c "bash /opt/app/aaf_config/bin/agent.sh $PARAMS"
Instrumentalab502672018-08-20 14:31:35 -050049}
50
Instrumental12414fe2019-01-22 10:27:32 -060051PARAMS=$@
Instrumentalca788dc2018-11-03 14:38:21 -050052case "$1" in
53 bash)
Instrumental12414fe2019-01-22 10:27:32 -060054 PARAMS="&& cd /opt/app/osaaf/local && exec bash"
55 run_it -it --rm
Instrumentalca788dc2018-11-03 14:38:21 -050056 ;;
Instrumental12414fe2019-01-22 10:27:32 -060057 taillog)
Instrumentalca788dc2018-11-03 14:38:21 -050058 run_it -it --rm
59 ;;
60 *)
61 run_it --rm
62 ;;
63esac
Instrumentalab502672018-08-20 14:31:35 -050064