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 | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 12 | # Create the AAF Config (Security) Images |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 13 | cd .. |
| 14 | cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 15 | |
| 16 | # AAF Config image (for AAF itself) |
| 17 | sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 18 | docker build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample |
Instrumental | 4ecd90d | 2018-08-14 14:45:23 -0500 | [diff] [blame] | 19 | docker tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION} |
Instrumental | 479f75d | 2018-08-16 10:59:35 -0500 | [diff] [blame] | 20 | docker tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:latest |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 21 | |
| 22 | # AAF Agent Image (for Clients) |
| 23 | sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile |
| 24 | docker build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample |
Instrumental | 4ecd90d | 2018-08-14 14:45:23 -0500 | [diff] [blame] | 25 | docker tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION} |
Instrumental | 479f75d | 2018-08-16 10:59:35 -0500 | [diff] [blame] | 26 | 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] | 27 | |
| 28 | # Clean up |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 29 | rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar |
| 30 | cd - |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 31 | ######## |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 32 | # Second, build a core Docker Image |
| 33 | echo Building aaf_$AAF_COMPONENT... |
| 34 | # Apply currrent Properties to Docker file, and put in place. |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 35 | 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] | 36 | cd .. |
| 37 | docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION} |
Instrumental | 4ecd90d | 2018-08-14 14:45:23 -0500 | [diff] [blame] | 38 | docker tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION} |
Instrumental | 479f75d | 2018-08-16 10:59:35 -0500 | [diff] [blame] | 39 | 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] | 40 | rm aaf_${VERSION}/Dockerfile |
| 41 | cd - |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 42 | |
| 43 | if ["$1" == ""]; then |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 44 | AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.') |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 45 | else |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 46 | AAF_COMPONENTS=$1 |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 47 | fi |
| 48 | |
| 49 | for AAF_COMPONENT in ${AAF_COMPONENTS}; do |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 50 | 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} |
Instrumental | 567a963 | 2018-08-14 13:55:32 -0500 | [diff] [blame] | 54 | docker tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} |
Instrumental | 479f75d | 2018-08-16 10:59:35 -0500 | [diff] [blame] | 55 | 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] | 56 | rm aaf_${VERSION}/Dockerfile |
| 57 | cd - |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 58 | done |