Sai Gandham | 67a6d89 | 2018-10-10 04:31:59 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | . ./d.props |
| 3 | if [ -e ./cass.props ]; then |
| 4 | . ./cass.props |
| 5 | fi |
| 6 | |
| 7 | DOCKER=${DOCKER:=docker} |
| 8 | function run_it() { |
| 9 | $DOCKER run $@ \ |
| 10 | -v "aaf_config:$CONF_ROOT_DIR" \ |
| 11 | --add-host="$HOSTNAME:$HOST_IP" \ |
| 12 | --add-host="aaf.osaaf.org:$HOST_IP" \ |
| 13 | --env HOSTNAME=${HOSTNAME} \ |
| 14 | --env AAF_ENV=${AAF_ENV} \ |
| 15 | --env AAF_REGISTER_AS=${AAF_REGISTER_AS} \ |
| 16 | --env LATITUDE=${LATITUDE} \ |
| 17 | --env LONGITUDE=${LONGITUDE} \ |
| 18 | --env CASS_HOST=${CASS_HOST} \ |
| 19 | --env CASSANDRA_CLUSTER=${CASSANDRA_CLUSTER} \ |
| 20 | --env CASSANDRA_USER=${CASSANDRA_USER} \ |
| 21 | --env CASSANDRA_PASSWORD=${CASSANDRA_PASSWORD} \ |
| 22 | --env CASSANDRA_PORT=${CASSANDRA_PORT} \ |
| 23 | --name aaf_config_$USER \ |
| 24 | $PREFIX${ORG}/${PROJECT}/aaf_config:${VERSION} \ |
| 25 | /bin/bash $PARAMS |
| 26 | } |
| 27 | |
| 28 | function set_prop() { |
Sai Gandham | 971334d | 2018-10-11 14:07:45 -0500 | [diff] [blame] | 29 | $DOCKER exec -d aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP setProp "$1" "$2" "$3" |
Sai Gandham | 67a6d89 | 2018-10-10 04:31:59 -0500 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | function encrypt_it() { |
Sai Gandham | 971334d | 2018-10-11 14:07:45 -0500 | [diff] [blame] | 33 | $DOCKER exec -d aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP encrypt "$1" "$2" |
Sai Gandham | 67a6d89 | 2018-10-10 04:31:59 -0500 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | function set_it() { |
Sai Gandham | 971334d | 2018-10-11 14:07:45 -0500 | [diff] [blame] | 37 | $DOCKER exec -d aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP setProp "$1" "$2" |
Sai Gandham | 67a6d89 | 2018-10-10 04:31:59 -0500 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | PARAMS="$@" |
| 41 | if [ "$PARAMS" != "" ]; then |
Sai Gandham | bdaf445 | 2018-10-12 12:21:01 -0500 | [diff] [blame] | 42 | run_it -d --rm |
Sai Gandham | 67a6d89 | 2018-10-10 04:31:59 -0500 | [diff] [blame] | 43 | fi |
| 44 | |