Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 1 | #!/bin/bash |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 2 | # |
| 3 | # Docker Building Script. Reads all the components generated by install, on per-version basis |
| 4 | # |
Instrumental | 924b18d | 2018-04-05 20:17:18 -0500 | [diff] [blame] | 5 | # Pull in Variables from d.props |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 6 | if [ ! -e ./d.props ]; then |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 7 | cp d.props.init d.props |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 8 | fi |
| 9 | |
Instrumental | f482ea0 | 2018-04-10 15:03:24 -0500 | [diff] [blame] | 10 | . ./d.props |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 11 | |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 12 | DOCKER=${DOCKER:=docker} |
| 13 | |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 14 | echo "Building Containers for aaf components, version $VERSION" |
| 15 | |
Instrumental | 3019a28 | 2018-09-25 16:05:20 -0500 | [diff] [blame] | 16 | # AAF_cass now needs a version... |
| 17 | cd ../auth-cass/docker |
Instrumental | 7558731 | 2018-09-25 17:30:46 -0500 | [diff] [blame] | 18 | bash ./dbuild.sh |
Instrumental | 3019a28 | 2018-09-25 16:05:20 -0500 | [diff] [blame] | 19 | cd - |
| 20 | |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 21 | # Create the AAF Config (Security) Images |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 22 | cd .. |
| 23 | cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 24 | cp -Rf ../conf/CA sample |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 25 | |
| 26 | # AAF Config image (for AAF itself) |
| 27 | sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 28 | $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 |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 31 | |
| 32 | # AAF Agent Image (for Clients) |
| 33 | sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 34 | $DOCKER build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample |
| 35 | $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION} |
| 36 | $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 37 | |
| 38 | # Clean up |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 39 | rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 40 | rm -Rf sample/CA |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 41 | cd - |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 42 | |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 43 | ######## |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 44 | # Second, build a core Docker Image |
| 45 | echo Building aaf_$AAF_COMPONENT... |
| 46 | # Apply currrent Properties to Docker file, and put in place. |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 47 | sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 48 | cd .. |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 49 | $DOCKER build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION} |
| 50 | $DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION} |
| 51 | $DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 52 | rm aaf_${VERSION}/Dockerfile |
| 53 | cd - |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 54 | |
| 55 | if ["$1" == ""]; then |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 56 | AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.') |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 57 | else |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 58 | AAF_COMPONENTS=$1 |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 59 | fi |
| 60 | |
Instrumental | 08e9340 | 2018-10-03 08:38:52 -0500 | [diff] [blame] | 61 | mkdir -p ../aaf_${VERSION}/pod |
| 62 | cp ../sample/bin/pod_wait.sh ../aaf_${VERSION}/pod |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 63 | for AAF_COMPONENT in ${AAF_COMPONENTS}; do |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 64 | echo Building aaf_$AAF_COMPONENT... |
| 65 | sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile |
| 66 | cd .. |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 67 | $DOCKER build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION} |
| 68 | $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} |
| 69 | $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 70 | rm aaf_${VERSION}/Dockerfile |
| 71 | cd - |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 72 | done |
Instrumental | 08e9340 | 2018-10-03 08:38:52 -0500 | [diff] [blame] | 73 | rm ../aaf_${VERSION}/pod/* |
| 74 | rmdir ../aaf_${VERSION}/pod |