Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 1 | #!/bin/bash |
Instrumental | 7a1817b | 2018-11-05 11:11:15 -0600 | [diff] [blame] | 2 | ######### |
| 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 | |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 22 | . ./d.props |
| 23 | |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 24 | DOCKER=${DOCKER:=docker} |
Instrumental | e2fa0e6 | 2019-02-07 11:09:32 -0600 | [diff] [blame] | 25 | # if something, may not want CASS attached all the tim |
| 26 | LINKS="--link $CASSANDRA_DOCKER" |
| 27 | |
Instrumental | ab50267 | 2018-08-20 14:31:35 -0500 | [diff] [blame] | 28 | function run_it() { |
Instrumental | 628b710 | 2019-02-15 19:40:04 -0600 | [diff] [blame] | 29 | if [ -n "${DUSER}" ]; then |
| 30 | USER_LINE="--user ${DUSER}" |
| 31 | fi |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 32 | $DOCKER run $@ \ |
Instrumental | 628b710 | 2019-02-15 19:40:04 -0600 | [diff] [blame] | 33 | $USER_LINE \ |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 34 | -v "aaf_config:$CONF_ROOT_DIR" \ |
Instrumental | ca788dc | 2018-11-03 14:38:21 -0500 | [diff] [blame] | 35 | -v "aaf_status:/opt/app/aaf/status" \ |
Instrumental | e2fa0e6 | 2019-02-07 11:09:32 -0600 | [diff] [blame] | 36 | $LINKS \ |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 37 | --env aaf_locator_container=docker \ |
Instrumental | 27afb02 | 2019-02-07 16:36:56 -0600 | [diff] [blame] | 38 | --env aaf_locator_container_ns=${NAMESPACE} \ |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 39 | --env aaf_locator_fqdn=${HOSTNAME} \ |
| 40 | --env aaf_locate_url=https://aaf-locate:8095 \ |
Instrumental | be7e0d1 | 2019-04-04 21:42:19 -0500 | [diff] [blame^] | 41 | --env aaf_locator_public_fqdn=${HOSTNAME} \ |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 42 | --env AAF_ENV=${AAF_ENV} \ |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 43 | --env LATITUDE=${LATITUDE} \ |
| 44 | --env LONGITUDE=${LONGITUDE} \ |
Instrumental | 196000b | 2018-10-05 19:30:59 -0500 | [diff] [blame] | 45 | --env CASSANDRA_CLUSTER=${CASSANDRA_CLUSTER} \ |
| 46 | --env CASSANDRA_USER=${CASSANDRA_USER} \ |
| 47 | --env CASSANDRA_PASSWORD=${CASSANDRA_PASSWORD} \ |
| 48 | --env CASSANDRA_PORT=${CASSANDRA_PORT} \ |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 49 | --name aaf_config_$USER \ |
Instrumental | e44d2f7 | 2018-08-16 17:22:45 -0500 | [diff] [blame] | 50 | $PREFIX${ORG}/${PROJECT}/aaf_config:${VERSION} \ |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 51 | bash -c "bash /opt/app/aaf_config/bin/agent.sh $PARAMS" |
Instrumental | ab50267 | 2018-08-20 14:31:35 -0500 | [diff] [blame] | 52 | } |
| 53 | |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 54 | PARAMS=$@ |
Instrumental | ca788dc | 2018-11-03 14:38:21 -0500 | [diff] [blame] | 55 | case "$1" in |
| 56 | bash) |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 57 | PARAMS="&& cd /opt/app/osaaf/local && exec bash" |
| 58 | run_it -it --rm |
Instrumental | ca788dc | 2018-11-03 14:38:21 -0500 | [diff] [blame] | 59 | ;; |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 60 | taillog) |
Instrumental | ca788dc | 2018-11-03 14:38:21 -0500 | [diff] [blame] | 61 | run_it -it --rm |
| 62 | ;; |
| 63 | *) |
| 64 | run_it --rm |
| 65 | ;; |
| 66 | esac |
Instrumental | ab50267 | 2018-08-20 14:31:35 -0500 | [diff] [blame] | 67 | |