blob: 0d69eed376d16885fc3719a6910d3b34e2f599f1 [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
Paul Sokolovsky026ebbb2022-09-08 12:31:57 +030021find ./misra-dockerfiles
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
Paul Sokolovsky682184c2022-09-08 11:49:14 +030027 test -d $image && test -f $image/build.sh && \
Kelley Spoon09c3f242022-08-29 06:13:12 -050028 (
29 set -ex
Paul Sokolovskyc4dcfad2022-09-08 11:53:22 +030030 echo "Building image: misra:${image}"
Kelley Spoon09c3f242022-08-29 06:13:12 -050031 cd $image
32 ./build.sh
Paul Sokolovskyc4dcfad2022-09-08 11:53:22 +030033 echo "Upoading image: misra:${image}"
34 docker push $ECR/misra:$image
Kelley Spoon09c3f242022-08-29 06:13:12 -050035 )
36done