blob: 94fc7f46b702ffc9a4bdb155ec3b76ccb16cde81 [file] [log] [blame]
Instrumental4ad47632018-07-13 15:49:26 -05001#!/bin/bash
Sai Gandham66118342018-04-04 15:33:05 -05002#
3# Docker Building Script. Reads all the components generated by install, on per-version basis
4#
Instrumental924b18d2018-04-05 20:17:18 -05005# Pull in Variables from d.props
Instrumental9ec28952018-07-12 11:14:10 -05006if [ ! -e ./d.props ]; then
Instrumental4ad47632018-07-13 15:49:26 -05007 cp d.props.init d.props
Instrumental9ec28952018-07-12 11:14:10 -05008fi
9
Instrumentalf482ea02018-04-10 15:03:24 -050010. ./d.props
Instrumental9ec28952018-07-12 11:14:10 -050011
Instrumentalbc299c02018-09-25 06:42:31 -050012echo "Building Containers for aaf components, version $VERSION"
13
Instrumental3019a282018-09-25 16:05:20 -050014# AAF_cass now needs a version...
15cd ../auth-cass/docker
Instrumental75587312018-09-25 17:30:46 -050016bash ./dbuild.sh
Instrumental3019a282018-09-25 16:05:20 -050017cd -
18
Instrumental32cdd552018-07-19 13:29:32 -050019# Create the AAF Config (Security) Images
Instrumental9ec28952018-07-12 11:14:10 -050020cd ..
21cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin
Instrumentalbc299c02018-09-25 06:42:31 -050022cp -Rf ../conf/CA sample
Instrumental32cdd552018-07-19 13:29:32 -050023
24# AAF Config image (for AAF itself)
25sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050026docker build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
Instrumental4ecd90d2018-08-14 14:45:23 -050027docker tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
Instrumental32cdd552018-07-19 13:29:32 -050028
29# AAF Agent Image (for Clients)
30sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
31docker build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
Instrumental4ecd90d2018-08-14 14:45:23 -050032docker tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
Instrumental32cdd552018-07-19 13:29:32 -050033
34# Clean up
Instrumental9ec28952018-07-12 11:14:10 -050035rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar
Instrumentalbc299c02018-09-25 06:42:31 -050036rm -Rf sample/CA
Instrumental9ec28952018-07-12 11:14:10 -050037cd -
Instrumental365638c2018-10-01 15:26:03 -050038
Instrumental32cdd552018-07-19 13:29:32 -050039########
Instrumental9ec28952018-07-12 11:14:10 -050040# Second, build a core Docker Image
41echo Building aaf_$AAF_COMPONENT...
42# Apply currrent Properties to Docker file, and put in place.
Instrumental4ad47632018-07-13 15:49:26 -050043sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050044cd ..
45docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
Instrumental4ecd90d2018-08-14 14:45:23 -050046docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
Instrumental9ec28952018-07-12 11:14:10 -050047rm aaf_${VERSION}/Dockerfile
48cd -
Sai Gandham66118342018-04-04 15:33:05 -050049
50if ["$1" == ""]; then
Instrumental4ad47632018-07-13 15:49:26 -050051 AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.')
Sai Gandham66118342018-04-04 15:33:05 -050052else
Instrumental4ad47632018-07-13 15:49:26 -050053 AAF_COMPONENTS=$1
Sai Gandham66118342018-04-04 15:33:05 -050054fi
55
56for AAF_COMPONENT in ${AAF_COMPONENTS}; do
Instrumental4ad47632018-07-13 15:49:26 -050057 echo Building aaf_$AAF_COMPONENT...
58 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
59 cd ..
60 docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
Instrumental567a9632018-08-14 13:55:32 -050061 docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental4ad47632018-07-13 15:49:26 -050062 rm aaf_${VERSION}/Dockerfile
63 cd -
Sai Gandham66118342018-04-04 15:33:05 -050064done