blob: 6f2be64083788dfd646c75c970018bc6e737b659 [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
Instrumental32cdd552018-07-19 13:29:32 -050014# Create the AAF Config (Security) Images
Instrumental9ec28952018-07-12 11:14:10 -050015cd ..
16cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin
Instrumentalbc299c02018-09-25 06:42:31 -050017cp -Rf ../conf/CA sample
Instrumental32cdd552018-07-19 13:29:32 -050018
19# AAF Config image (for AAF itself)
20sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050021docker build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
Instrumental4ecd90d2018-08-14 14:45:23 -050022docker tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
Instrumental32cdd552018-07-19 13:29:32 -050023
24# AAF Agent Image (for Clients)
25sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
26docker build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
Instrumental4ecd90d2018-08-14 14:45:23 -050027docker tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
Instrumental32cdd552018-07-19 13:29:32 -050028
29# Clean up
Instrumental9ec28952018-07-12 11:14:10 -050030rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar
Instrumentalbc299c02018-09-25 06:42:31 -050031rm -Rf sample/CA
Instrumental9ec28952018-07-12 11:14:10 -050032cd -
Instrumental32cdd552018-07-19 13:29:32 -050033########
Instrumental9ec28952018-07-12 11:14:10 -050034# Second, build a core Docker Image
35echo Building aaf_$AAF_COMPONENT...
36# Apply currrent Properties to Docker file, and put in place.
Instrumental4ad47632018-07-13 15:49:26 -050037sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050038cd ..
39docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
Instrumental4ecd90d2018-08-14 14:45:23 -050040docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
Instrumental9ec28952018-07-12 11:14:10 -050041rm aaf_${VERSION}/Dockerfile
42cd -
Sai Gandham66118342018-04-04 15:33:05 -050043
44if ["$1" == ""]; then
Instrumental4ad47632018-07-13 15:49:26 -050045 AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.')
Sai Gandham66118342018-04-04 15:33:05 -050046else
Instrumental4ad47632018-07-13 15:49:26 -050047 AAF_COMPONENTS=$1
Sai Gandham66118342018-04-04 15:33:05 -050048fi
49
50for AAF_COMPONENT in ${AAF_COMPONENTS}; do
Instrumental4ad47632018-07-13 15:49:26 -050051 echo Building aaf_$AAF_COMPONENT...
52 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
53 cd ..
54 docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
Instrumental567a9632018-08-14 13:55:32 -050055 docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental4ad47632018-07-13 15:49:26 -050056 rm aaf_${VERSION}/Dockerfile
57 cd -
Sai Gandham66118342018-04-04 15:33:05 -050058done