blob: e3d49429ef44fe59473f3fa5caca03c272da1a5f [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
Instrumental32cdd552018-07-19 13:29:32 -050012# Create the AAF Config (Security) Images
Instrumental9ec28952018-07-12 11:14:10 -050013cd ..
14cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin
Instrumental32cdd552018-07-19 13:29:32 -050015
16# AAF Config image (for AAF itself)
17sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050018docker build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
Instrumental32cdd552018-07-19 13:29:32 -050019
20# AAF Agent Image (for Clients)
21sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
22docker build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
23
24# Clean up
Instrumental9ec28952018-07-12 11:14:10 -050025rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar
26cd -
Instrumental32cdd552018-07-19 13:29:32 -050027########
Instrumental9ec28952018-07-12 11:14:10 -050028# Second, build a core Docker Image
29echo Building aaf_$AAF_COMPONENT...
30# Apply currrent Properties to Docker file, and put in place.
Instrumental4ad47632018-07-13 15:49:26 -050031sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050032cd ..
33docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
34rm aaf_${VERSION}/Dockerfile
35cd -
Sai Gandham66118342018-04-04 15:33:05 -050036
37if ["$1" == ""]; then
Instrumental4ad47632018-07-13 15:49:26 -050038 AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.')
Sai Gandham66118342018-04-04 15:33:05 -050039else
Instrumental4ad47632018-07-13 15:49:26 -050040 AAF_COMPONENTS=$1
Sai Gandham66118342018-04-04 15:33:05 -050041fi
42
43for AAF_COMPONENT in ${AAF_COMPONENTS}; do
Instrumental4ad47632018-07-13 15:49:26 -050044 echo Building aaf_$AAF_COMPONENT...
45 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
46 cd ..
47 docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
Instrumental567a9632018-08-14 13:55:32 -050048 docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental4ad47632018-07-13 15:49:26 -050049 rm aaf_${VERSION}/Dockerfile
50 cd -
Sai Gandham66118342018-04-04 15:33:05 -050051done