blob: ce2e29aec54957760136953a0510b99303c1b7c3 [file] [log] [blame]
Kelley Spooncd089f02024-09-12 11:25:41 -05001#!/bin/bash
2
Arthur She41115eb2024-09-18 14:48:11 -07003set -ex
4
Kelley Spooncd089f02024-09-12 11:25:41 -05005docker --version
6
Arthur She41115eb2024-09-18 14:48:11 -07007cd iar-dockerfiles
8
Kelley Spooncd089f02024-09-12 11:25:41 -05009if ! type aws
10then
11 sudo apt-get -y -qq update
12 sudo apt-get -y -qq install --no-install-recommends unzip
13 curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
14 unzip awscliv2.zip
15 sudo ./aws/install
16fi
17
Kelley Spooncd089f02024-09-12 11:25:41 -050018aws configure list
Arthur She41115eb2024-09-18 14:48:11 -070019ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com
20export IAR_ECR=987685672616.dkr.ecr.us-east-1.amazonaws.com/iar
21# Get armclang toolchain
22aws s3 cp --recursive s3://trustedfirmware-private/armclang/ .
23# Get IAR toolchain binary
24aws s3 cp --recursive s3://trustedfirmware-iar/ .
Kelley Spooncd089f02024-09-12 11:25:41 -050025find .
26aws ecr get-login-password --region us-east-1|docker login --username AWS --password-stdin $ECR
27
Arthur She41115eb2024-09-18 14:48:11 -070028image=$(dirname $(find . -name build.sh))
29test -d $image && test -f $image/build.sh && \
30(
31 echo "=== Building image: $image ==="
32 set -ex
33 cd $image
34 ./build.sh --build-arg IAR_LIC_NR=${IAR_LICENSE_NR} --build-arg IAR_LIC_EMAIL=${IAR_LICENSE_EMAIL} --build-arg IAR_PACKAGE=${IAR_PACKAGE}
35 [ -f ".docker-tag" ] && tag=$(cat .docker-tag) || (echo "Docker image built failed!"; exit 1)
36 echo "Uploading image: ${tag}"
37 docker push $tag
38)