blob: 2c4de52a5b59973be49b3069dda76c628a7e0ae9 [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
10if [ "${ON_EC2}" == "1" ]; then
11 if ! type aws
12 then
13 sudo apt-get -y -qq update
14 sudo apt-get -y -qq install --no-install-recommends unzip
15 curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
16 unzip awscliv2.zip
17 sudo ./aws/install
18 fi
19 aws configure list
20 export ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com
21 # we are expecting private files to be kept in the dockerfiles/*
22 # subdirs with a matching name for the image
23 aws s3 cp --recursive s3://trustedfirmware-misra/dockerfiles/ .
24 # Get armclang toolchain
25 aws s3 cp --recursive s3://trustedfirmware-private/armclang/ .
26 find .
27 aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR
28fi
29
30# Test on TF-02, copy armclang and IAR toolchain to the working dir
31cp /home/arthur.she/toolchain/* .
32
33cd iar-dockerfiles
34
35image=$(dirname $(find . -name build.sh))
36test -d $image && test -f $image/build.sh && \
37(
38 echo "=== Building image: $image ==="
39 set -ex
40 touch /tmp/dckr-img-err
41 cd $image
42 ./build.sh --build-arg IAR_LIC_NR=${IAR_LICENSE_NR} --build-arg IAR_LIC_EMAIL=${IAR_LICENSE_EMAIL}
43# echo "Uploading image: ${tag}"
44# docker push $ECR/misra:$tag
45 rm -f /tmp/dckr-img-err
46)
47
48if [ -f /tmp/dckr-img-err ]; then
49 was_error=1
50 echo "ERROR building image: misra:${tag}"
51fi