blob: e0a866a0efd3408a3b356934f90c560bf058e032 [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}
Instrumental08e93402018-10-03 08:38:52 -050028docker tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/latest
Instrumental32cdd552018-07-19 13:29:32 -050029
30# AAF Agent Image (for Clients)
31sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
32docker build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
Instrumental4ecd90d2018-08-14 14:45:23 -050033docker tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
Instrumental08e93402018-10-03 08:38:52 -050034docker tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest
Instrumental32cdd552018-07-19 13:29:32 -050035
36# Clean up
Instrumental9ec28952018-07-12 11:14:10 -050037rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar
Instrumentalbc299c02018-09-25 06:42:31 -050038rm -Rf sample/CA
Instrumental9ec28952018-07-12 11:14:10 -050039cd -
Instrumental365638c2018-10-01 15:26:03 -050040
Instrumental32cdd552018-07-19 13:29:32 -050041########
Instrumental9ec28952018-07-12 11:14:10 -050042# Second, build a core Docker Image
43echo Building aaf_$AAF_COMPONENT...
44# Apply currrent Properties to Docker file, and put in place.
Instrumental4ad47632018-07-13 15:49:26 -050045sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050046cd ..
47docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
Instrumental4ecd90d2018-08-14 14:45:23 -050048docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
Instrumental08e93402018-10-03 08:38:52 -050049docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest
Instrumental9ec28952018-07-12 11:14:10 -050050rm aaf_${VERSION}/Dockerfile
51cd -
Sai Gandham66118342018-04-04 15:33:05 -050052
53if ["$1" == ""]; then
Instrumental4ad47632018-07-13 15:49:26 -050054 AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.')
Sai Gandham66118342018-04-04 15:33:05 -050055else
Instrumental4ad47632018-07-13 15:49:26 -050056 AAF_COMPONENTS=$1
Sai Gandham66118342018-04-04 15:33:05 -050057fi
58
Instrumental08e93402018-10-03 08:38:52 -050059mkdir -p ../aaf_${VERSION}/pod
60cp ../sample/bin/pod_wait.sh ../aaf_${VERSION}/pod
Sai Gandham66118342018-04-04 15:33:05 -050061for AAF_COMPONENT in ${AAF_COMPONENTS}; do
Instrumental4ad47632018-07-13 15:49:26 -050062 echo Building aaf_$AAF_COMPONENT...
63 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
64 cd ..
65 docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
Instrumental567a9632018-08-14 13:55:32 -050066 docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental08e93402018-10-03 08:38:52 -050067 docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest
Instrumental4ad47632018-07-13 15:49:26 -050068 rm aaf_${VERSION}/Dockerfile
69 cd -
Sai Gandham66118342018-04-04 15:33:05 -050070done
Instrumental08e93402018-10-03 08:38:52 -050071rm ../aaf_${VERSION}/pod/*
72rmdir ../aaf_${VERSION}/pod