blob: 232323d16dedc804149f73fa97bc2aef381dc561 [file] [log] [blame]
Kelley Spoon09c3f242022-08-29 06:13:12 -05001#!/bin/bash
2
3if ! type aws
4then
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
10fi
11
12rm -rf misra-dockerfiles
13git clone https://git.trustedfirmware.org/ci/misra-dockerfiles.git
14cd misra-dockerfiles
15
16aws configure list
Paul Sokolovskyc4b1a1f2022-09-08 11:55:19 +030017export ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com
Kelley Spoon09c3f242022-08-29 06:13:12 -050018# we are expecting private files to be kept in the dockerfiles/*
19# subdirs with a matching name for the image
20aws s3 cp --recursive s3://trustedfirmware-misra/dockerfiles/ ./misra-dockerfiles
21aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR
22
23
24for image in ./*
25do
Paul Sokolovsky682184c2022-09-08 11:49:14 +030026 test -d $image && test -f $image/build.sh && \
Kelley Spoon09c3f242022-08-29 06:13:12 -050027 (
28 set -ex
Paul Sokolovskyc4dcfad2022-09-08 11:53:22 +030029 echo "Building image: misra:${image}"
Kelley Spoon09c3f242022-08-29 06:13:12 -050030 cd $image
31 ./build.sh
Paul Sokolovskyc4dcfad2022-09-08 11:53:22 +030032 echo "Upoading image: misra:${image}"
33 docker push $ECR/misra:$image
Kelley Spoon09c3f242022-08-29 06:13:12 -050034 )
35done