blob: a73e475d344c52958f41270f69830f916e77bef7 [file] [log] [blame]
Paul Sokolovsky99466182022-12-19 22:15:36 +03001#!/bin/bash
2
3docker --version
4
5if ! 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
19export ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com
20# we are expecting private files to be kept in the dockerfiles/*
21# subdirs with a matching name for the image
22aws s3 cp --recursive s3://trustedfirmware-misra/dockerfiles/ .
23find .
24aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR
25
26
27was_error=0
28
29for image in ./*
30do
31 tag=$(basename $image)
32 test -d $image && test -f $image/build.sh && \
33 (
34 echo "=== Building image: misra:${tag} ==="
35 set -ex
36 touch /tmp/dckr-img-err
37 cd $image
38 ./build.sh
39 echo "Uploading image: misra:${tag}"
40 docker push $ECR/misra:$tag
41 rm -f /tmp/dckr-img-err
42 )
43
44 if [ -f /tmp/dckr-img-err ]; then
45 was_error=1
46 echo "ERROR building image: misra:${tag}"
47 fi
48done
49
50if [ "$was_error" == "1" ]; then
51 echo "---------------------------------"
52 echo "At least one image FAILED to build successfully. See the log above for ERRORs."
53 exit 1
54fi