blob: 65250aefff3139f67a0809f53546e01a7c904e50 [file] [log] [blame]
Arthur Shef4d97ca2024-07-30 17:10:48 +08001#!/bin/bash
2
3docker --version
4
5ON_EC2="0"
6if [ -f /sys/hypervisor/uuid ] && grep -q ^ec2 /sys/hypervisor/uuid; then
7 ON_EC2="1"
8fi
9
Arthur She560798e2024-08-05 11:33:48 +080010cd iar-dockerfiles
11
Arthur Shef4d97ca2024-07-30 17:10:48 +080012if [ "${ON_EC2}" == "1" ]; then
13 if ! type aws
14 then
15 sudo apt-get -y -qq update
16 sudo apt-get -y -qq install --no-install-recommends unzip
17 curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
18 unzip awscliv2.zip
19 sudo ./aws/install
20 fi
21 aws configure list
Arthur She560798e2024-08-05 11:33:48 +080022 export ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com/iar
Arthur Shef4d97ca2024-07-30 17:10:48 +080023 # Get armclang toolchain
24 aws s3 cp --recursive s3://trustedfirmware-private/armclang/ .
Arthur Shed6ec1b62024-08-13 09:05:45 +080025 # Get IAR toolchain binary
26 aws s3 cp --recursive s3://trustedfirmware-iar/ .
Arthur Shef4d97ca2024-07-30 17:10:48 +080027 find .
28 aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR
Arthur She560798e2024-08-05 11:33:48 +080029else
30 # Test on TF-02, copy armclang and IAR toolchain to the working dir
31 ls -l
32 cp /home/arthur.she/toolchain/* .
Arthur Shef4d97ca2024-07-30 17:10:48 +080033fi
34
Arthur Shef4d97ca2024-07-30 17:10:48 +080035
Arthur Shef4d97ca2024-07-30 17:10:48 +080036
37image=$(dirname $(find . -name build.sh))
38test -d $image && test -f $image/build.sh && \
39(
40 echo "=== Building image: $image ==="
41 set -ex
42 touch /tmp/dckr-img-err
43 cd $image
44 ./build.sh --build-arg IAR_LIC_NR=${IAR_LICENSE_NR} --build-arg IAR_LIC_EMAIL=${IAR_LICENSE_EMAIL}
45# echo "Uploading image: ${tag}"
46# docker push $ECR/misra:$tag
47 rm -f /tmp/dckr-img-err
48)
49
50if [ -f /tmp/dckr-img-err ]; then
51 was_error=1
Arthur She26d2d8d2024-07-30 17:39:51 +080052 echo "ERROR building image: ${image}"
Arthur Shef4d97ca2024-07-30 17:10:48 +080053fi