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 | |
| 12 | # Create the Config (Security) Image |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 13 | sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.config >../sample/Dockerfile |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 14 | cd .. |
| 15 | cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin |
| 16 | docker build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample |
| 17 | rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar |
| 18 | cd - |
| 19 | |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 20 | # Second, build a core Docker Image |
| 21 | echo Building aaf_$AAF_COMPONENT... |
| 22 | # Apply currrent Properties to Docker file, and put in place. |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 23 | 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] | 24 | cd .. |
| 25 | docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION} |
| 26 | rm aaf_${VERSION}/Dockerfile |
| 27 | cd - |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 28 | |
| 29 | if ["$1" == ""]; then |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 30 | AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.') |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 31 | else |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 32 | AAF_COMPONENTS=$1 |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 33 | fi |
| 34 | |
| 35 | for AAF_COMPONENT in ${AAF_COMPONENTS}; do |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 36 | echo Building aaf_$AAF_COMPONENT... |
| 37 | sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile |
| 38 | cd .. |
| 39 | docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION} |
| 40 | rm aaf_${VERSION}/Dockerfile |
| 41 | cd - |
Sai Gandham | 6611834 | 2018-04-04 15:33:05 -0500 | [diff] [blame] | 42 | done |