3 # ============LICENSE_START====================================================
5 # ===========================================================================
6 # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
7 # ===========================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END====================================================
21 # Docker Building Script. Reads all the components generated by install, on per-version basis
23 # Pull in Variables from d.props
24 if [ ! -e ./d.props ]; then
25 cp d.props.init d.props
30 DOCKER=${DOCKER:=docker}
32 echo "Building Containers for aaf components, version $VERSION"
34 # AAF_cass now needs a version...
35 cd ../auth-cass/docker
39 # Create the AAF Config (Security) Images
41 cp auth-cmd/target/aaf-auth-cmd-$VERSION-full.jar sample/bin
42 cp -Rf ../conf/CA sample
44 # AAF Config image (for AAF itself)
45 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile
46 $DOCKER build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
47 $DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
48 $DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/latest
50 cp ../cadi/servlet-sample/target/aaf-cadi-servlet-sample-${VERSION}-sample.jar sample/bin
51 # AAF Agent Image (for Clients)
52 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
53 $DOCKER build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
54 $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
55 $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest
58 rm sample/Dockerfile sample/bin/aaf-auth-cmd-${VERSION}-full.jar sample/bin/aaf-cadi-servlet-sample-${VERSION}-sample.jar
63 # Second, build a core Docker Image
64 echo Building aaf_$AAF_COMPONENT...
65 # Apply currrent Properties to Docker file, and put in place.
66 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
68 $DOCKER build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
69 $DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
70 $DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest
71 rm aaf_${VERSION}/Dockerfile
75 # Do all the Containers related to AAF Services
78 AAF_COMPONENTS=$(ls ../aaf_${VERSION}/bin | grep -v '\.')
83 mkdir -p ../aaf_${VERSION}/pod
84 cp ../sample/bin/pod_wait.sh ../aaf_${VERSION}/pod
85 for AAF_COMPONENT in ${AAF_COMPONENTS}; do
86 echo Building aaf_$AAF_COMPONENT...
87 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
89 $DOCKER build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
90 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
91 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest
92 rm aaf_${VERSION}/Dockerfile
96 rm ../aaf_${VERSION}/pod/*
97 rmdir ../aaf_${VERSION}/pod