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 |
Paul Sokolovsky | c4b1a1f | 2022-09-08 11:55:19 +0300 | [diff] [blame] | 17 | export ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com |
Kelley Spoon | 09c3f24 | 2022-08-29 06:13:12 -0500 | [diff] [blame] | 18 | # we are expecting private files to be kept in the dockerfiles/* |
| 19 | # subdirs with a matching name for the image |
Kelley Spoon | 98518e0 | 2022-09-08 14:30:41 -0500 | [diff] [blame^] | 20 | aws s3 cp --recursive s3://trustedfirmware-misra/dockerfiles/ . |
| 21 | find . |
Kelley Spoon | 09c3f24 | 2022-08-29 06:13:12 -0500 | [diff] [blame] | 22 | aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR |
| 23 | |
| 24 | |
| 25 | for image in ./* |
| 26 | do |
Kelley Spoon | 98518e0 | 2022-09-08 14:30:41 -0500 | [diff] [blame^] | 27 | tag=$(basename $image) |
Paul Sokolovsky | 682184c | 2022-09-08 11:49:14 +0300 | [diff] [blame] | 28 | test -d $image && test -f $image/build.sh && \ |
Kelley Spoon | 09c3f24 | 2022-08-29 06:13:12 -0500 | [diff] [blame] | 29 | ( |
| 30 | set -ex |
Kelley Spoon | 98518e0 | 2022-09-08 14:30:41 -0500 | [diff] [blame^] | 31 | echo "Building image: misra:${tag}" |
Kelley Spoon | 09c3f24 | 2022-08-29 06:13:12 -0500 | [diff] [blame] | 32 | cd $image |
| 33 | ./build.sh |
Kelley Spoon | 98518e0 | 2022-09-08 14:30:41 -0500 | [diff] [blame^] | 34 | echo "Upoading image: misra:${tag}" |
| 35 | docker push $ECR/misra:$tag |
Kelley Spoon | 09c3f24 | 2022-08-29 06:13:12 -0500 | [diff] [blame] | 36 | ) |
| 37 | done |