summaryrefslogtreecommitdiffstats
path: root/auth/docker/agent.sh
diff options
context:
space:
mode:
authorSai Gandham <sai.gandham@att.com>2019-02-21 13:32:25 +0000
committerGerrit Code Review <gerrit@onap.org>2019-02-21 13:32:25 +0000
commit8da0163b75076832417ee9b255f63b4c789e3c12 (patch)
tree95c9d5ddea36f775a18883dab47f1dcb1a9b002f /auth/docker/agent.sh
parent2b5103e038a7727734097a671d331db9aaab77ba (diff)
parentce76c7dc637edba5f606c1657b056bb3ef4addd9 (diff)
Merge "CSIT and non-container Agent"
Diffstat (limited to 'auth/docker/agent.sh')
-rw-r--r--auth/docker/agent.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/auth/docker/agent.sh b/auth/docker/agent.sh
index 7340d30d..7e7d08c0 100644
--- a/auth/docker/agent.sh
+++ b/auth/docker/agent.sh
@@ -125,6 +125,28 @@ function run_it() {
bash -c "bash /opt/app/aaf_config/bin/agent.sh $PARAMS"
}
+function sso {
+ if [ -n "$2" ]; then
+ echo "$1=$2" >> ~/.aaf/sso.props
+ fi
+}
+
+function reset_sso {
+ mkdir -p ~/.aaf
+ > ~/.aaf/sso.props
+ sso aaf_locate_url "https://$AAF_FQDN:8095"
+ sso cadi_latitude "$LATITUDE"
+ sso cadi_longitude "$LONGITUDE"
+ sso cadi_loglevel "DEBUG"
+ TRUSTSTORE="$(ls truststore*.jks | tail -1)"
+ if [ -z "$TRUSTSTORE" ]; then
+ echo "Place a truststore*.jar which has YOUR CA in it here"
+ exit
+ fi
+ sso cadi_truststore "${PWD}/${TRUSTSTORE}"
+ sso cadi_truststore_password changeit
+}
+
PARAMS=$@
case "$1" in
bash)
@@ -134,6 +156,42 @@ case "$1" in
taillog)
run_it -it --rm
;;
+ aafcli)
+ shift
+ reset_sso
+ if [ -f aaf-auth-cmd-$VERSION*-full.jar ]; then
+ java -Dcadi_prop_files="~\/.aaf\/sso.props" -jar aaf-auth-cmd-$VERSION*-full.jar $@
+ else
+ echo "For local use, you need to have 'aaf-cadi-aaf-$VERSION*-full.jar' (or newer)"
+ fi
+ ;;
+ local)
+ shift
+ CMD="$1"
+ if [ -z "$2" ]; then
+ CMD="$CMD $APP_FQI $APP_FQDN"
+ else
+ if [ "-" = "$2" ]; then
+ CMD="$CMD $APP_FQI"
+ else
+ CMD="$CMD $2"
+ fi
+ if [ "-" = "$3" ]; then
+ CMD="$CMD $APP_FQDN"
+ else
+ CMD="$CMD $3"
+ fi
+ fi
+ reset_sso
+ sso aaf_id "$DEPLOY_FQI"
+ sso aaf_password "$DEPLOY_PASSWORD"
+ if [ -f aaf-auth-cmd-$VERSION*-full.jar ]; then
+ mkdir -p $APP_FQDN
+ java -Dcadi_prop_files="~\/.aaf\/sso.props" -cp aaf-auth-cmd-$VERSION*-full.jar org.onap.aaf.cadi.configure.Agent $CMD
+ else
+ echo "For local use, you need to have 'aaf-cadi-aaf-$VERSION*-full.jar' (or newer)"
+ fi
+ ;;
*)
run_it --rm
;;