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