blob: 56b8e99a466f6201d7c7f296b98b4807be880048 [file] [log] [blame]
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -05001#!/bin/bash
2
Paul Sokolovsky1f249f12022-11-16 20:41:05 +03003set -ex
4
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -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"
Paul Sokolovsky1f249f12022-11-16 20:41:05 +030010 unzip -q awscliv2.zip
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050011 sudo ./aws/install
12fi
13
14rm -rf fvp-dockerfiles
15git clone https://git.trustedfirmware.org/ci/fvp-dockerfiles.git
16cd fvp-dockerfiles
Paul Sokolovsky0efe6832023-04-04 16:31:12 +030017git log -1
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050018
19aws configure list
20ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com
21aws s3 cp --recursive s3://trustedfirmware-fvp/ .
22aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR
23
24
25for tarball in F*.tgz
26do
Paul Sokolovsky8bc7df22023-07-28 21:30:30 +030027 df -h
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050028 tag=$(./create-model-tag.sh $tarball)
29 mkdir -p $tag
Paul Sokolovsky1d817e22023-04-04 12:39:26 +030030 cp setup-sshd stdout-flush-wrapper*.sh $tag/
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050031 mv $tarball $tag/
32 ./create-model-dockerfile.sh $tarball $tag
33 (
34 set -ex
35 cd $tag
36 docker build --tag $ECR/fvp:$tag .
Paul Sokolovsky6110c682023-07-28 21:27:18 +030037 echo "Docker image created"
38 echo "Docker image name: fvp:${tag}"
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050039 docker push $ECR/fvp:$tag
Paul Sokolovsky040bb882023-07-28 21:49:36 +030040 # Remove image locally to free up space for the remaining images in loop
41 docker image rm $ECR/fvp:$tag
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050042 )
43
44done
45