summaryrefslogtreecommitdiffstats
path: root/auth/docker
diff options
context:
space:
mode:
Diffstat (limited to 'auth/docker')
-rw-r--r--auth/docker/aaf.sh11
-rw-r--r--auth/docker/agent.sh11
-rw-r--r--auth/docker/dbash.sh3
-rw-r--r--auth/docker/dbounce.sh1
-rwxr-xr-xauth/docker/dbuild.sh26
-rw-r--r--auth/docker/dclean.sh11
-rw-r--r--auth/docker/dpush.sh3
-rw-r--r--auth/docker/drun.sh9
-rw-r--r--auth/docker/dstart.sh4
-rw-r--r--auth/docker/dstop.sh3
10 files changed, 47 insertions, 35 deletions
diff --git a/auth/docker/aaf.sh b/auth/docker/aaf.sh
index 5757051f..7301c50e 100644
--- a/auth/docker/aaf.sh
+++ b/auth/docker/aaf.sh
@@ -4,9 +4,10 @@ if [ -e ./cass.props ]; then
. ./cass.props
fi
+DOCKER=${DOCKER:=docker}
function run_it() {
- docker run $@ \
- --mount 'type=volume,src=aaf_config,dst='$CONF_ROOT_DIR',volume-driver=local' \
+ $DOCKER run $@ \
+ -v "aaf_config:$CONF_ROOT_DIR" \
--add-host="$HOSTNAME:$HOST_IP" \
--add-host="aaf.osaaf.org:$HOST_IP" \
--env HOSTNAME=${HOSTNAME} \
@@ -25,15 +26,15 @@ function run_it() {
}
function set_prop() {
-docker exec -t aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP setProp "$1" "$2" "$3"
+ $DOCKER exec -t aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP setProp "$1" "$2" "$3"
}
function encrypt_it() {
- docker exec -t aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP encrypt "$1" "$2"
+ $DOCKER exec -t aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP encrypt "$1" "$2"
}
function set_it() {
- docker exec -t aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP setProp "$1" "$2"
+ $DOCKER exec -t aaf_config_$USER /bin/bash /opt/app/aaf_config/bin/agent.sh NOOP setProp "$1" "$2"
}
PARAMS="$@"
diff --git a/auth/docker/agent.sh b/auth/docker/agent.sh
index 38b1070d..af04cf29 100644
--- a/auth/docker/agent.sh
+++ b/auth/docker/agent.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-CADI_VERSION=2.1.2-SNAPSHOT
# Fill out "aaf.props" if not filled out already
if [ ! -e aaf.props ]; then
@@ -9,6 +8,8 @@ fi
. ./aaf.props
+DOCKER=${DOCKER:=docker}
+CADI_VERSION=${CADI_VERSION:=2.1.2-SNAPSHOT}
for V in VERSION DOCKER_REPOSITORY AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do
if [ "$(grep $V ./aaf.props)" = "" ]; then
@@ -53,9 +54,9 @@ done
. ./aaf.props
# Make sure Container Volume exists
-if [ "$(docker volume ls | grep ${VOLUME})" = "" ]; then
+if [ "$($DOCKER volume ls | grep ${VOLUME})" = "" ]; then
echo -n "Creating Volume: "
- docker volume create -d ${DRIVER} ${VOLUME}
+ $DOCKER volume create -d ${DRIVER} ${VOLUME}
fi
if [ -n "$DOCKER_REPOSITORY" ]; then
@@ -64,10 +65,10 @@ else
PREFIX=""
fi
-docker run \
+$DOCKER run \
-it \
--rm \
- --mount 'type=volume,src='${VOLUME}',dst=/opt/app/osaaf,volume-driver='${DRIVER} \
+ -v "${VOLUME}:/opt/app/osaaf" \
--add-host="$AAF_FQDN:$AAF_FQDN_IP" \
--env AAF_FQDN=${AAF_FQDN} \
--env DEPLOY_FQI=${DEPLOY_FQI} \
diff --git a/auth/docker/dbash.sh b/auth/docker/dbash.sh
index 42caa592..9f84427a 100644
--- a/auth/docker/dbash.sh
+++ b/auth/docker/dbash.sh
@@ -1,2 +1,3 @@
#!/bin/bash
-docker exec -it aaf_$1 bash
+. ./d.props
+${DOCKER:=docker} exec -it aaf_$1 bash
diff --git a/auth/docker/dbounce.sh b/auth/docker/dbounce.sh
index 82aedd0c..dde83897 100644
--- a/auth/docker/dbounce.sh
+++ b/auth/docker/dbounce.sh
@@ -1,4 +1,3 @@
#!/bin/bash
-
bash ./dstop.sh "$@"
bash ./dstart.sh "$@"
diff --git a/auth/docker/dbuild.sh b/auth/docker/dbuild.sh
index e0a866a0..2b6c006c 100755
--- a/auth/docker/dbuild.sh
+++ b/auth/docker/dbuild.sh
@@ -9,6 +9,8 @@ fi
. ./d.props
+DOCKER=${DOCKER:=docker}
+
echo "Building Containers for aaf components, version $VERSION"
# AAF_cass now needs a version...
@@ -23,15 +25,15 @@ cp -Rf ../conf/CA sample
# AAF Config image (for AAF itself)
sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile
-docker build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
-docker tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
-docker tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/latest
+$DOCKER build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
+$DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
+$DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/latest
# AAF Agent Image (for Clients)
sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
-docker build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
-docker tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
-docker tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest
+$DOCKER build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
+$DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
+$DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest
# Clean up
rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar
@@ -44,9 +46,9 @@ echo Building aaf_$AAF_COMPONENT...
# Apply currrent Properties to Docker file, and put in place.
sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
cd ..
-docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
-docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
-docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest
+$DOCKER build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
+$DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
+$DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest
rm aaf_${VERSION}/Dockerfile
cd -
@@ -62,9 +64,9 @@ for AAF_COMPONENT in ${AAF_COMPONENTS}; do
echo Building aaf_$AAF_COMPONENT...
sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
cd ..
- docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
- docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
- docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest
+ $DOCKER build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
+ $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
+ $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest
rm aaf_${VERSION}/Dockerfile
cd -
done
diff --git a/auth/docker/dclean.sh b/auth/docker/dclean.sh
index f8550674..b943d08a 100644
--- a/auth/docker/dclean.sh
+++ b/auth/docker/dclean.sh
@@ -1,6 +1,7 @@
#!/bin/bash
# Pull in Variables from d.props
. ./d.props
+DOCKER=${DOCKER:=docker}
if [ "$1" == "" ]; then
AAF_COMPONENTS="$(cat components) config core agent"
@@ -8,12 +9,12 @@ else
AAF_COMPONENTS="$@"
fi
-echo "Y" | docker container prune
+echo "Y" | $DOCKER container prune
for AAF_COMPONENT in ${AAF_COMPONENTS}; do
- docker image rm $ORG/$PROJECT/aaf_$AAF_COMPONENT:${VERSION}
+ $DOCKER image rm $ORG/$PROJECT/aaf_$AAF_COMPONENT:${VERSION}
if [ ! "$PREFIX" = "" ]; then
- docker image rm $DOCKER_REPOSITORY/$ORG/$PROJECT/aaf_$AAF_COMPONENT:${VERSION}
- docker image rm $DOCKER_REPOSITORY/$ORG/$PROJECT/aaf_$AAF_COMPONENT:latest
+ $DOCKER image rm $DOCKER_REPOSITORY/$ORG/$PROJECT/aaf_$AAF_COMPONENT:${VERSION}
+ $DOCKER image rm $DOCKER_REPOSITORY/$ORG/$PROJECT/aaf_$AAF_COMPONENT:latest
fi
done
-echo "Y" | docker image prune
+echo "Y" | $DOCKER image prune
diff --git a/auth/docker/dpush.sh b/auth/docker/dpush.sh
index 5e9403da..f29b4c91 100644
--- a/auth/docker/dpush.sh
+++ b/auth/docker/dpush.sh
@@ -3,11 +3,12 @@
#
# Pull in Variables from d.props
. ./d.props
+DOCKER=${DOCKER:=docker}
AAF_COMPONENTS="config agent core cass $(cat components) "
for AAF_COMPONENT in ${AAF_COMPONENTS}; do
# docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${OLD_VERSION}
- docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
+ $DOCKER push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
# docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${NEW_VERSION}
done
diff --git a/auth/docker/drun.sh b/auth/docker/drun.sh
index 96405f24..be6795be 100644
--- a/auth/docker/drun.sh
+++ b/auth/docker/drun.sh
@@ -6,10 +6,13 @@
if [ ! -e ./cass.props ]; then
cp cass.props.init cass.props
fi
+. ./cass.props
+
+DOCKER=${DOCKER:=docker}
CASS_IS_SET="$(grep '<Cass IP>' cass.props)"
if [ -n "$CASS_IS_SET" ]; then
- CASS_IP="$(docker container inspect aaf_cass | grep \"IPAddress\": -m 1 | cut -d '"' -f 4)"
+ CASS_IP="$($DOCKER container inspect aaf_cass | grep \"IPAddress\": -m 1 | cut -d '"' -f 4)"
if [ -n "$CASS_IP" ]; then
sed -i -e "s/\(^.*:\).*/\1$CASS_IP/" cass.props
else
@@ -69,7 +72,7 @@ for AAF_COMPONENT in ${AAF_COMPONENTS}; do
ADD_HOST="$ADD_HOST --add-host=$A:$HOST_IP"
done
- docker run \
+ $DOCKER run \
-d \
--name aaf_$AAF_COMPONENT \
--hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
@@ -80,6 +83,6 @@ for AAF_COMPONENT in ${AAF_COMPONENTS}; do
--env LATITUDE=${LATITUDE} \
--env LONGITUDE=${LONGITUDE} \
--publish $PORTMAP \
- --mount 'type=volume,src=aaf_config,dst='$CONF_ROOT_DIR',volume-driver=local' \
+ -v "aaf_config:$CONF_ROOT_DIR" \
${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
done
diff --git a/auth/docker/dstart.sh b/auth/docker/dstart.sh
index 6a297854..6ca4baee 100644
--- a/auth/docker/dstart.sh
+++ b/auth/docker/dstart.sh
@@ -2,6 +2,8 @@
# Pull in Props
. ./d.props
+DOCKER=${DOCKER:=docker}
+
if [ "$1" == "" ]; then
AAF_COMPONENTS=$(cat components)
else
@@ -9,5 +11,5 @@ else
fi
for AAF_COMPONENT in ${AAF_COMPONENTS}; do
- docker start aaf_$AAF_COMPONENT
+ $DOCKER start aaf_$AAF_COMPONENT
done
diff --git a/auth/docker/dstop.sh b/auth/docker/dstop.sh
index acec6c76..85e6f285 100644
--- a/auth/docker/dstop.sh
+++ b/auth/docker/dstop.sh
@@ -2,6 +2,7 @@
# Pull in Properties
. ./d.props
+DOCKER=${DOCKER:=docker}
if [ "$1" == "" ]; then
AAF_COMPONENTS=$(cat components)
else
@@ -9,5 +10,5 @@ else
fi
for AAF_COMPONENT in ${AAF_COMPONENTS}; do
- docker stop aaf_$AAF_COMPONENT
+ $DOCKER stop aaf_$AAF_COMPONENT
done