blob: 396e62cd0c2426731ef74d8902032b89cb2925e6 [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
Paul Sokolovskyaafb3322022-09-27 14:40:17 +030031 echo "============================"
Kelley Spoon98518e02022-09-08 14:30:41 -050032 echo "Building image: misra:${tag}"
Kelley Spoon09c3f242022-08-29 06:13:12 -050033 cd $image
34 ./build.sh
Kelley Spoon98518e02022-09-08 14:30:41 -050035 echo "Upoading image: misra:${tag}"
36 docker push $ECR/misra:$tag
Kelley Spoon09c3f242022-08-29 06:13:12 -050037 )
38done