blob: f2ee305469fb62be26fc009f69496c0031542f31 [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
Saheer Babu734d2ad2024-12-19 09:38:47 +000020export ECR=${PRIVATE_CONTAINER_REGISTRY}
21aws s3 cp --recursive s3://openci-trustedfirmware-fvp-${INFRA_ENV}/ .
22aws ecr get-login-password --region eu-west-1|docker login --username AWS --password-stdin $ECR
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050023
Arthur She9f6136a2025-07-06 22:04:42 -070024fvp_versions=$(echo ${FVP_VERSIONS} | sed -e 's/ //g' -e 's/\./\\./g' -e 's/,/|/g')
25used_fvp=$(ls F*.tgz | grep -E "${fvp_versions}")
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050026
Arthur She9f6136a2025-07-06 22:04:42 -070027for tarball in "${used_fvp}"
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050028do
Paul Sokolovsky8bc7df22023-07-28 21:30:30 +030029 df -h
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050030 tag=$(./create-model-tag.sh $tarball)
31 mkdir -p $tag
Paul Sokolovsky501520d2024-05-25 22:23:05 +030032 cp setup-sshd stdout-flush-wrapper*.sh setup-ubl $tag/
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050033 mv $tarball $tag/
Paul Sokolovsky2ab62872024-05-25 15:04:30 +030034 cp swskt-linaro-root*.lic $tag/
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050035 ./create-model-dockerfile.sh $tarball $tag
36 (
37 set -ex
38 cd $tag
39 docker build --tag $ECR/fvp:$tag .
Paul Sokolovsky6110c682023-07-28 21:27:18 +030040 echo "Docker image created"
41 echo "Docker image name: fvp:${tag}"
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050042 docker push $ECR/fvp:$tag
Paul Sokolovsky040bb882023-07-28 21:49:36 +030043 # Remove image locally to free up space for the remaining images in loop
44 docker image rm $ECR/fvp:$tag
Leonardo Sandoval9d38c8f2021-08-06 13:59:59 -050045 )
46
47done
48