blob: e60d868e2691cecf84a50bc412a9181834669c72 [file] [log] [blame]
#!/bin/bash
set -ex
if ! type aws
then
sudo apt-get -y -qq update
sudo apt-get -y -qq install --no-install-recommends unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install
fi
rm -rf fvp-dockerfiles
git clone https://git.trustedfirmware.org/ci/fvp-dockerfiles.git
cd fvp-dockerfiles
git log -1
aws configure list
export ECR=${PRIVATE_CONTAINER_REGISTRY}
aws s3 cp --recursive s3://openci-trustedfirmware-fvp-${INFRA_ENV}/ .
aws ecr get-login-password --region eu-west-1|docker login --username AWS --password-stdin $ECR
fvp_versions=$(echo ${FVP_VERSIONS} | sed -e 's/ //g' -e 's/\./\\./g' -e 's/,/|/g')
used_fvp=$(ls F*.tgz | grep -E "${fvp_versions}")
for tarball in ${used_fvp}
do
df -h
tag=$(./create-model-tag.sh $tarball)
mkdir -p $tag
cp setup-sshd stdout-flush-wrapper*.sh setup-ubl $tag/
mv $tarball $tag/
cp swskt-linaro-root*.lic $tag/
./create-model-dockerfile.sh $tarball $tag
(
set -ex
cd $tag
docker build --tag $ECR/fvp:$tag .
echo "Docker image created"
echo "Docker image name: fvp:${tag}"
docker push $ECR/fvp:$tag
# Remove image locally to free up space for the remaining images in loop
docker image rm $ECR/fvp:$tag
)
done