Kelley Spoon | 09c3f24 | 2022-08-29 06:13:12 -0500 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | if ! type aws |
| 4 | then |
| 5 | sudo apt-get -y -qq update |
| 6 | sudo apt-get -y -qq install --no-install-recommends unzip |
| 7 | curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" |
| 8 | unzip awscliv2.zip |
| 9 | sudo ./aws/install |
| 10 | fi |
| 11 | |
| 12 | rm -rf misra-dockerfiles |
| 13 | git clone https://git.trustedfirmware.org/ci/misra-dockerfiles.git |
| 14 | cd misra-dockerfiles |
| 15 | |
| 16 | aws configure list |
| 17 | ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com |
| 18 | # we are expecting private files to be kept in the dockerfiles/* |
| 19 | # subdirs with a matching name for the image |
| 20 | aws s3 cp --recursive s3://trustedfirmware-misra/dockerfiles/ ./misra-dockerfiles |
| 21 | aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR |
| 22 | |
| 23 | |
| 24 | for image in ./* |
| 25 | do |
| 26 | test [ -d $image ] && test [ -f $image/build.sh ] && \ |
| 27 | ( |
| 28 | set -ex |
| 29 | echo "Building image: misra:$${image}" |
| 30 | cd $image |
| 31 | ./build.sh |
| 32 | echo "Upoading image: misra:$${image}" |
| 33 | docker push $ECR/misra:image$ |
| 34 | ) |
| 35 | done |