blob: a6636f6a53b45fc2ce00183852b5d4786fc8da91 [file] [log] [blame]
Kelley Spoon09c3f242022-08-29 06:13:12 -05001#!/bin/bash
2
Paul Sokolovsky8d0747b2022-09-27 15:13:01 +03003docker --version
4
Kelley Spoon09c3f242022-08-29 06:13:12 -05005if ! type aws
6then
7 sudo apt-get -y -qq update
8 sudo apt-get -y -qq install --no-install-recommends unzip
9 curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
10 unzip awscliv2.zip
11 sudo ./aws/install
12fi
13
14rm -rf misra-dockerfiles
15git clone https://git.trustedfirmware.org/ci/misra-dockerfiles.git
16cd misra-dockerfiles
17
18aws configure list
Paul Sokolovskyc4b1a1f2022-09-08 11:55:19 +030019export ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com
Kelley Spoon09c3f242022-08-29 06:13:12 -050020# we are expecting private files to be kept in the dockerfiles/*
21# subdirs with a matching name for the image
Kelley Spoon98518e02022-09-08 14:30:41 -050022aws s3 cp --recursive s3://trustedfirmware-misra/dockerfiles/ .
23find .
Kelley Spoon09c3f242022-08-29 06:13:12 -050024aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR
25
26
27for image in ./*
28do
Kelley Spoon98518e02022-09-08 14:30:41 -050029 tag=$(basename $image)
Paul Sokolovsky682184c2022-09-08 11:49:14 +030030 test -d $image && test -f $image/build.sh && \
Kelley Spoon09c3f242022-08-29 06:13:12 -050031 (
32 set -ex
Paul Sokolovskyaafb3322022-09-27 14:40:17 +030033 echo "============================"
Kelley Spoon98518e02022-09-08 14:30:41 -050034 echo "Building image: misra:${tag}"
Kelley Spoon09c3f242022-08-29 06:13:12 -050035 cd $image
36 ./build.sh
Kelley Spoon98518e02022-09-08 14:30:41 -050037 echo "Upoading image: misra:${tag}"
38 docker push $ECR/misra:$tag
Kelley Spoon09c3f242022-08-29 06:13:12 -050039 )
40done