blob: 2c4de52a5b59973be49b3069dda76c628a7e0ae9 [file] [log] [blame]
#!/bin/bash
docker --version
ON_EC2="0"
if [ -f /sys/hypervisor/uuid ] && grep -q ^ec2 /sys/hypervisor/uuid; then
ON_EC2="1"
fi
if [ "${ON_EC2}" == "1" ]; then
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 awscliv2.zip
sudo ./aws/install
fi
aws configure list
export ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com
# we are expecting private files to be kept in the dockerfiles/*
# subdirs with a matching name for the image
aws s3 cp --recursive s3://trustedfirmware-misra/dockerfiles/ .
# Get armclang toolchain
aws s3 cp --recursive s3://trustedfirmware-private/armclang/ .
find .
aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR
fi
# Test on TF-02, copy armclang and IAR toolchain to the working dir
cp /home/arthur.she/toolchain/* .
cd iar-dockerfiles
image=$(dirname $(find . -name build.sh))
test -d $image && test -f $image/build.sh && \
(
echo "=== Building image: $image ==="
set -ex
touch /tmp/dckr-img-err
cd $image
./build.sh --build-arg IAR_LIC_NR=${IAR_LICENSE_NR} --build-arg IAR_LIC_EMAIL=${IAR_LICENSE_EMAIL}
# echo "Uploading image: ${tag}"
# docker push $ECR/misra:$tag
rm -f /tmp/dckr-img-err
)
if [ -f /tmp/dckr-img-err ]; then
was_error=1
echo "ERROR building image: misra:${tag}"
fi