blob: dbe5884b49d4ca39a48c39fa61e6d8cfb5f1df9d [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
Instrumental4ecd90d2018-08-14 14:45:23 -050019docker tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
Instrumental479f75d2018-08-16 10:59:35 -050020docker tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:latest
Instrumental32cdd552018-07-19 13:29:32 -050021
22# AAF Agent Image (for Clients)
23sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
24docker build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
Instrumental4ecd90d2018-08-14 14:45:23 -050025docker tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
Instrumental479f75d2018-08-16 10:59:35 -050026docker tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest
Instrumental32cdd552018-07-19 13:29:32 -050027
28# Clean up
Instrumental9ec28952018-07-12 11:14:10 -050029rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar
30cd -
Instrumental32cdd552018-07-19 13:29:32 -050031########
Instrumental9ec28952018-07-12 11:14:10 -050032# Second, build a core Docker Image
33echo Building aaf_$AAF_COMPONENT...
34# Apply currrent Properties to Docker file, and put in place.
Instrumental4ad47632018-07-13 15:49:26 -050035sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050036cd ..
37docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
Instrumental4ecd90d2018-08-14 14:45:23 -050038docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
Instrumental479f75d2018-08-16 10:59:35 -050039docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest
Instrumental9ec28952018-07-12 11:14:10 -050040rm aaf_${VERSION}/Dockerfile
41cd -
Sai Gandham66118342018-04-04 15:33:05 -050042
43if ["$1" == ""]; then
Instrumental4ad47632018-07-13 15:49:26 -050044 AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.')
Sai Gandham66118342018-04-04 15:33:05 -050045else
Instrumental4ad47632018-07-13 15:49:26 -050046 AAF_COMPONENTS=$1
Sai Gandham66118342018-04-04 15:33:05 -050047fi
48
49for AAF_COMPONENT in ${AAF_COMPONENTS}; do
Instrumental4ad47632018-07-13 15:49:26 -050050 echo Building aaf_$AAF_COMPONENT...
51 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
52 cd ..
53 docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
Instrumental567a9632018-08-14 13:55:32 -050054 docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental479f75d2018-08-16 10:59:35 -050055 docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest
Instrumental4ad47632018-07-13 15:49:26 -050056 rm aaf_${VERSION}/Dockerfile
57 cd -
Sai Gandham66118342018-04-04 15:33:05 -050058done