| #!/bin/bash |
| |
| set -ex |
| |
| docker --version |
| |
| cd iar-dockerfiles |
| |
| 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=${PRIVATE_CONTAINER_REGISTRY} |
| export IAR_ECR=${PRIVATE_CONTAINER_REGISTRY}/iar |
| # Get armclang toolchain |
| aws s3 cp --recursive s3://openci-trustedfirmware-private-${INFRA_ENV}/armclang/ . |
| # Get IAR toolchain binary |
| aws s3 cp --recursive s3://openci-trustedfirmware-iar-${INFRA_ENV}/ . |
| find . |
| aws ecr get-login-password --region eu-west-1|docker login --username AWS --password-stdin $ECR |
| |
| image=$(dirname $(find . -name build.sh)) |
| test -d $image && test -f $image/build.sh && \ |
| ( |
| echo "=== Building image: $image ===" |
| set -ex |
| cd $image |
| ./build.sh --build-arg IAR_LIC_NR=${IAR_LICENSE_NR} --build-arg IAR_LIC_EMAIL=${IAR_LICENSE_EMAIL} --build-arg IAR_PACKAGE=${IAR_PACKAGE} |
| [ -f ".docker-tag" ] && tag=$(cat .docker-tag) || (echo "Docker image built failed!"; exit 1) |
| echo "Uploading image: ${tag}" |
| docker push $tag |
| ) |