blob: a170493d341eab16cba895e9f8cfb599b0173fdf [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 ..
Instrumental9fe11532018-10-23 17:40:47 -050023cp auth-cmd/target/aaf-auth-cmd-$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
Instrumental93871ff2018-10-15 07:37:28 -050032cp ../cadi/servlet-sample/target/aaf-cadi-servlet-sample-${VERSION}-sample.jar sample/bin
Instrumental32cdd552018-07-19 13:29:32 -050033# AAF Agent Image (for Clients)
34sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
Instrumental94053612018-10-08 11:27:18 -050035$DOCKER build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
36$DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
37$DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest
Instrumental32cdd552018-07-19 13:29:32 -050038
39# Clean up
Instrumental9fe11532018-10-23 17:40:47 -050040rm sample/Dockerfile sample/bin/aaf-auth-cmd-${VERSION}-full.jar sample/bin/aaf-cadi-servlet-sample-${VERSION}-sample.jar
Instrumentalbc299c02018-09-25 06:42:31 -050041rm -Rf sample/CA
Instrumental9ec28952018-07-12 11:14:10 -050042cd -
Instrumental365638c2018-10-01 15:26:03 -050043
Instrumental32cdd552018-07-19 13:29:32 -050044########
Instrumental9ec28952018-07-12 11:14:10 -050045# Second, build a core Docker Image
46echo Building aaf_$AAF_COMPONENT...
47# Apply currrent Properties to Docker file, and put in place.
Instrumental4ad47632018-07-13 15:49:26 -050048sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
Instrumental9ec28952018-07-12 11:14:10 -050049cd ..
Instrumental94053612018-10-08 11:27:18 -050050$DOCKER build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
51$DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
52$DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest
Instrumental9ec28952018-07-12 11:14:10 -050053rm aaf_${VERSION}/Dockerfile
54cd -
Sai Gandham66118342018-04-04 15:33:05 -050055
Instrumental93871ff2018-10-15 07:37:28 -050056#######
57# Do all the Containers related to AAF Services
58#######
Sai Gandham66118342018-04-04 15:33:05 -050059if ["$1" == ""]; then
Instrumental93871ff2018-10-15 07:37:28 -050060 AAF_COMPONENTS=$(ls ../aaf_${VERSION}/bin | grep -v '\.')
Sai Gandham66118342018-04-04 15:33:05 -050061else
Instrumental4ad47632018-07-13 15:49:26 -050062 AAF_COMPONENTS=$1
Sai Gandham66118342018-04-04 15:33:05 -050063fi
64
Instrumental08e93402018-10-03 08:38:52 -050065mkdir -p ../aaf_${VERSION}/pod
66cp ../sample/bin/pod_wait.sh ../aaf_${VERSION}/pod
Sai Gandham66118342018-04-04 15:33:05 -050067for AAF_COMPONENT in ${AAF_COMPONENTS}; do
Instrumental4ad47632018-07-13 15:49:26 -050068 echo Building aaf_$AAF_COMPONENT...
69 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
70 cd ..
Instrumental94053612018-10-08 11:27:18 -050071 $DOCKER build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
72 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
73 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest
Instrumental4ad47632018-07-13 15:49:26 -050074 rm aaf_${VERSION}/Dockerfile
75 cd -
Instrumental93871ff2018-10-15 07:37:28 -050076
Sai Gandham66118342018-04-04 15:33:05 -050077done
Instrumental08e93402018-10-03 08:38:52 -050078rm ../aaf_${VERSION}/pod/*
79rmdir ../aaf_${VERSION}/pod