blob: bf319640dff31f43df821ec3317619eb45232417 [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
Kelley Spoon98518e02022-09-08 14:30:41 -050020aws s3 cp --recursive s3://trustedfirmware-misra/dockerfiles/ .
21find .
Kelley Spoon09c3f242022-08-29 06:13:12 -050022aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR
23
24
25for image in ./*
26do
Kelley Spoon98518e02022-09-08 14:30:41 -050027 tag=$(basename $image)
Paul Sokolovsky682184c2022-09-08 11:49:14 +030028 test -d $image && test -f $image/build.sh && \
Kelley Spoon09c3f242022-08-29 06:13:12 -050029 (
30 set -ex
Kelley Spoon98518e02022-09-08 14:30:41 -050031 echo "Building image: misra:${tag}"
Kelley Spoon09c3f242022-08-29 06:13:12 -050032 cd $image
33 ./build.sh
Kelley Spoon98518e02022-09-08 14:30:41 -050034 echo "Upoading image: misra:${tag}"
35 docker push $ECR/misra:$tag
Kelley Spoon09c3f242022-08-29 06:13:12 -050036 )
37done