blob: 29391597444d4329a96e3c39e58079e63b45f31a [file] [log] [blame]
Instrumental32cdd552018-07-19 13:29:32 -05001#!/bin/bash
2. ./d.props
Instrumental196000b2018-10-05 19:30:59 -05003if [ -e ./cass.props ]; then
4 . ./cass.props
5fi
Instrumental32cdd552018-07-19 13:29:32 -05006
Instrumental94053612018-10-08 11:27:18 -05007DOCKER=${DOCKER:=docker}
Instrumentalab502672018-08-20 14:31:35 -05008function run_it() {
Instrumental94053612018-10-08 11:27:18 -05009 $DOCKER run $@ \
10 -v "aaf_config:$CONF_ROOT_DIR" \
Instrumental32cdd552018-07-19 13:29:32 -050011 --add-host="$HOSTNAME:$HOST_IP" \
12 --add-host="aaf.osaaf.org:$HOST_IP" \
Instrumental54883b42018-09-25 07:56:54 -050013 --env HOSTNAME=${HOSTNAME} \
Instrumental32cdd552018-07-19 13:29:32 -050014 --env AAF_ENV=${AAF_ENV} \
15 --env AAF_REGISTER_AS=${AAF_REGISTER_AS} \
Instrumental93871ff2018-10-15 07:37:28 -050016 --env AAF_LOCATOR_AS=${AAF_LOCATOR_AS} \
Instrumental32cdd552018-07-19 13:29:32 -050017 --env LATITUDE=${LATITUDE} \
18 --env LONGITUDE=${LONGITUDE} \
Instrumental196000b2018-10-05 19:30:59 -050019 --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} \
Instrumental32cdd552018-07-19 13:29:32 -050024 --name aaf_config_$USER \
Instrumentale44d2f72018-08-16 17:22:45 -050025 $PREFIX${ORG}/${PROJECT}/aaf_config:${VERSION} \
Instrumentalab502672018-08-20 14:31:35 -050026 /bin/bash $PARAMS
27}
28
Instrumentalaeb80c82018-08-21 10:24:08 -050029function set_prop() {
Instrumental94053612018-10-08 11:27:18 -050030 $DOCKER exec -t aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP setProp "$1" "$2" "$3"
Instrumentalaeb80c82018-08-21 10:24:08 -050031}
32
Instrumentalab502672018-08-20 14:31:35 -050033function encrypt_it() {
Instrumental94053612018-10-08 11:27:18 -050034 $DOCKER exec -t aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP encrypt "$1" "$2"
Instrumentalab502672018-08-20 14:31:35 -050035}
36
Instrumentalb8a81292018-08-23 16:32:45 -050037function set_it() {
Instrumental94053612018-10-08 11:27:18 -050038 $DOCKER exec -t aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP setProp "$1" "$2"
Instrumentalb8a81292018-08-23 16:32:45 -050039}
40
Instrumentalab502672018-08-20 14:31:35 -050041PARAMS="$@"
42if [ "$PARAMS" != "" ]; then
43 run_it -it --rm
44fi
45