Instrumental | 9405361 | 2018-10-08 11:27:18 -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 | # |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 21 | # Pull in AAF Env Variables from AAF install |
| 22 | if [ -e ../../docker/d.props ]; then |
| 23 | . ../../docker/d.props |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 24 | fi |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 25 | DOCKER=${DOCKER:-docker} |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 26 | |
Instrumental | 014494d | 2018-11-02 16:08:34 -0500 | [diff] [blame] | 27 | if [ "$1" = "publish" ]; then |
| 28 | PUBLISH='--publish 9042:9042 ' |
| 29 | fi |
| 30 | |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 31 | if [ "$($DOCKER volume ls | grep aaf_cass_data)" = "" ]; then |
| 32 | $DOCKER volume create aaf_cass_data |
| 33 | echo "Created Cassandra Volume aaf_cass_data" |
| 34 | fi |
| 35 | |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 36 | # Optional mount instead of v |
| 37 | # --mount 'type=volume,src=aaf_cass_data,dst=/var/lib/cassandra,volume-driver=local' \ |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 38 | if [ "`$DOCKER ps -a | grep aaf-cass`" == "" ]; then |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 39 | echo "starting Cass from 'run'" |
| 40 | # NOTE: These HEAP Sizes are minimal. Not set for full organizations. |
Instrumental | 27afb02 | 2019-02-07 16:36:56 -0600 | [diff] [blame] | 41 | # --user ${USER} \ |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 42 | $DOCKER run \ |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 43 | --name aaf-cass \ |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 44 | -e HEAP_NEWSIZE=512M \ |
| 45 | -e MAX_HEAP_SIZE=1024M \ |
| 46 | -e CASSANDRA_DC=dc1 \ |
| 47 | -e CASSANDRA_CLUSTER_NAME=osaaf \ |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 48 | -v "aaf_cass_data:/var/lib/cassandra" \ |
Instrumental | ca788dc | 2018-11-03 14:38:21 -0500 | [diff] [blame] | 49 | -v "aaf_status:/opt/app/aaf/status" \ |
Instrumental | 014494d | 2018-11-02 16:08:34 -0500 | [diff] [blame] | 50 | $PUBLISH \ |
Instrumental | 08e9340 | 2018-10-03 08:38:52 -0500 | [diff] [blame] | 51 | -d ${PREFIX}${ORG}/${PROJECT}/aaf_cass:${VERSION} "onap" |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 52 | else |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 53 | $DOCKER start aaf-cass |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 54 | fi |