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 # AAF Base version - set the core image, etc
40 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
41 -e 's/${DUSER}/'${DUSER}'/g' \
42 Dockerfile.base > Dockerfile
43 $DOCKER build -t ${ORG}/${PROJECT}/aaf_base:${VERSION} .
44 $DOCKER tag ${ORG}/${PROJECT}/aaf_base:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_base:${VERSION}
45 $DOCKER tag ${ORG}/${PROJECT}/aaf_base:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_base:latest
48 # Create the AAF Config (Security) Images
50 cp auth-cmd/target/aaf-auth-cmd-$VERSION-full.jar sample/bin
51 cp auth-batch/target/aaf-auth-batch-$VERSION-full.jar sample/bin
52 cp -Rf ../conf/CA sample
55 # AAF Config image (for AAF itself)
56 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
57 -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \
58 -e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \
59 -e 's/${DUSER}/'${DUSER}'/g' \
60 docker/Dockerfile.config > sample/Dockerfile
61 $DOCKER build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
62 $DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
63 $DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:latest
65 cp ../cadi/servlet-sample/target/aaf-cadi-servlet-sample-${VERSION}-sample.jar sample/bin
66 # AAF Agent Image (for Clients)
67 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
68 -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \
69 -e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \
70 -e 's/${DUSER}/'${DUSER}'/g' \
71 docker/Dockerfile.client > sample/Dockerfile
72 $DOCKER build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
73 $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
74 $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest
77 rm sample/Dockerfile sample/bin/aaf-*-${VERSION}-full.jar sample/bin/aaf-cadi-servlet-sample-${VERSION}-sample.jar
82 # Second, build a core Docker Image
83 echo Building aaf_$AAF_COMPONENT...
84 # Apply currrent Properties to Docker file, and put in place.
85 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
86 -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \
87 -e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \
88 -e 's/${DUSER}/'${DUSER}'/g' \
89 Dockerfile.core >../aaf_${VERSION}/Dockerfile
91 $DOCKER build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
92 $DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
93 $DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest
94 rm aaf_${VERSION}/Dockerfile
98 # Do all the Containers related to AAF Services
100 if ["$1" == ""]; then
101 AAF_COMPONENTS=$(ls ../aaf_${VERSION}/bin | grep -v '\.')
106 cp ../sample/bin/pod_wait.sh ../aaf_${VERSION}/bin
107 for AAF_COMPONENT in ${AAF_COMPONENTS}; do
108 echo Building aaf_$AAF_COMPONENT...
109 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
110 -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \
111 -e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \
112 -e 's/${DUSER}/'${DUSER}'/g' \
113 Dockerfile.ms >../aaf_${VERSION}/Dockerfile
115 $DOCKER build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
116 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
117 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest
118 rm aaf_${VERSION}/Dockerfile
122 rm ../aaf_${VERSION}/bin/pod_wait.sh