blob: 39d9eb2e57216c792c5f0a6b8adfd4c4587edee0 [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
16bash dbuild.sh
17cd -
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 -
Instrumental32cdd552018-07-19 13:29:32 -050038########
Instrumental9ec28952018-07-12 11:14:10 -050039# Second, build a core Docker Image
40echo Building aaf_$AAF_COMPONENT...
41# Apply currrent Properties to Docker file, and put in place.
Instrumental4ad47632018-07-13 15:49:26 -050042sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050043cd ..
44docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
Instrumental4ecd90d2018-08-14 14:45:23 -050045docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
Instrumental9ec28952018-07-12 11:14:10 -050046rm aaf_${VERSION}/Dockerfile
47cd -
Sai Gandham66118342018-04-04 15:33:05 -050048
49if ["$1" == ""]; then
Instrumental4ad47632018-07-13 15:49:26 -050050 AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.')
Sai Gandham66118342018-04-04 15:33:05 -050051else
Instrumental4ad47632018-07-13 15:49:26 -050052 AAF_COMPONENTS=$1
Sai Gandham66118342018-04-04 15:33:05 -050053fi
54
55for AAF_COMPONENT in ${AAF_COMPONENTS}; do
Instrumental4ad47632018-07-13 15:49:26 -050056 echo Building aaf_$AAF_COMPONENT...
57 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
58 cd ..
59 docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
Instrumental567a9632018-08-14 13:55:32 -050060 docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental4ad47632018-07-13 15:49:26 -050061 rm aaf_${VERSION}/Dockerfile
62 cd -
Sai Gandham66118342018-04-04 15:33:05 -050063done