blob: c212cddf580de83bc4bf3ec9b41622053b519735 [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
Saheer Babu734d2ad2024-12-19 09:38:47 +000019export ECR=${PRIVATE_CONTAINER_REGISTRY}
20export IAR_ECR=${PRIVATE_CONTAINER_REGISTRY}/iar
Arthur She41115eb2024-09-18 14:48:11 -070021# Get armclang toolchain
Saheer Babu734d2ad2024-12-19 09:38:47 +000022aws s3 cp --recursive s3://openci-trustedfirmware-private-${INFRA_ENV}/armclang/ .
Arthur She41115eb2024-09-18 14:48:11 -070023# Get IAR toolchain binary
Saheer Babu734d2ad2024-12-19 09:38:47 +000024aws s3 cp --recursive s3://openci-trustedfirmware-iar-${INFRA_ENV}/ .
Kelley Spooncd089f02024-09-12 11:25:41 -050025find .
Saheer Babu734d2ad2024-12-19 09:38:47 +000026aws ecr get-login-password --region eu-west-1|docker login --username AWS --password-stdin $ECR
Kelley Spooncd089f02024-09-12 11:25:41 -050027
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)