blob: 2b6c006c52e4bf6cc292b31b8adbd214ef28274c [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
Instrumental94053612018-10-08 11:27:18 -050012DOCKER=${DOCKER:=docker}
13
Instrumentalbc299c02018-09-25 06:42:31 -050014echo "Building Containers for aaf components, version $VERSION"
15
Instrumental3019a282018-09-25 16:05:20 -050016# AAF_cass now needs a version...
17cd ../auth-cass/docker
Instrumental75587312018-09-25 17:30:46 -050018bash ./dbuild.sh
Instrumental3019a282018-09-25 16:05:20 -050019cd -
20
Instrumental32cdd552018-07-19 13:29:32 -050021# Create the AAF Config (Security) Images
Instrumental9ec28952018-07-12 11:14:10 -050022cd ..
23cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin
Instrumentalbc299c02018-09-25 06:42:31 -050024cp -Rf ../conf/CA sample
Instrumental32cdd552018-07-19 13:29:32 -050025
26# AAF Config image (for AAF itself)
27sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile
Instrumental94053612018-10-08 11:27:18 -050028$DOCKER build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
29$DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
30$DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/latest
Instrumental32cdd552018-07-19 13:29:32 -050031
32# AAF Agent Image (for Clients)
33sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
Instrumental94053612018-10-08 11:27:18 -050034$DOCKER build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
35$DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
36$DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest
Instrumental32cdd552018-07-19 13:29:32 -050037
38# Clean up
Instrumental9ec28952018-07-12 11:14:10 -050039rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar
Instrumentalbc299c02018-09-25 06:42:31 -050040rm -Rf sample/CA
Instrumental9ec28952018-07-12 11:14:10 -050041cd -
Instrumental365638c2018-10-01 15:26:03 -050042
Instrumental32cdd552018-07-19 13:29:32 -050043########
Instrumental9ec28952018-07-12 11:14:10 -050044# Second, build a core Docker Image
45echo Building aaf_$AAF_COMPONENT...
46# Apply currrent Properties to Docker file, and put in place.
Instrumental4ad47632018-07-13 15:49:26 -050047sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050048cd ..
Instrumental94053612018-10-08 11:27:18 -050049$DOCKER build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
50$DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
51$DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest
Instrumental9ec28952018-07-12 11:14:10 -050052rm aaf_${VERSION}/Dockerfile
53cd -
Sai Gandham66118342018-04-04 15:33:05 -050054
55if ["$1" == ""]; then
Instrumental4ad47632018-07-13 15:49:26 -050056 AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.')
Sai Gandham66118342018-04-04 15:33:05 -050057else
Instrumental4ad47632018-07-13 15:49:26 -050058 AAF_COMPONENTS=$1
Sai Gandham66118342018-04-04 15:33:05 -050059fi
60
Instrumental08e93402018-10-03 08:38:52 -050061mkdir -p ../aaf_${VERSION}/pod
62cp ../sample/bin/pod_wait.sh ../aaf_${VERSION}/pod
Sai Gandham66118342018-04-04 15:33:05 -050063for AAF_COMPONENT in ${AAF_COMPONENTS}; do
Instrumental4ad47632018-07-13 15:49:26 -050064 echo Building aaf_$AAF_COMPONENT...
65 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
66 cd ..
Instrumental94053612018-10-08 11:27:18 -050067 $DOCKER build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
68 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
69 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest
Instrumental4ad47632018-07-13 15:49:26 -050070 rm aaf_${VERSION}/Dockerfile
71 cd -
Sai Gandham66118342018-04-04 15:33:05 -050072done
Instrumental08e93402018-10-03 08:38:52 -050073rm ../aaf_${VERSION}/pod/*
74rmdir ../aaf_${VERSION}/pod