Kelley Spoon | cd089f0 | 2024-09-12 11:25:41 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Arthur She | 41115eb | 2024-09-18 14:48:11 -0700 | [diff] [blame] | 3 | set -ex |
| 4 | |
Kelley Spoon | cd089f0 | 2024-09-12 11:25:41 -0500 | [diff] [blame] | 5 | docker --version |
| 6 | |
Arthur She | 41115eb | 2024-09-18 14:48:11 -0700 | [diff] [blame] | 7 | cd iar-dockerfiles |
| 8 | |
Kelley Spoon | cd089f0 | 2024-09-12 11:25:41 -0500 | [diff] [blame] | 9 | if ! type aws |
| 10 | then |
| 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 |
| 16 | fi |
| 17 | |
Kelley Spoon | cd089f0 | 2024-09-12 11:25:41 -0500 | [diff] [blame] | 18 | aws configure list |
Saheer Babu | 734d2ad | 2024-12-19 09:38:47 +0000 | [diff] [blame] | 19 | export ECR=${PRIVATE_CONTAINER_REGISTRY} |
| 20 | export IAR_ECR=${PRIVATE_CONTAINER_REGISTRY}/iar |
Arthur She | 41115eb | 2024-09-18 14:48:11 -0700 | [diff] [blame] | 21 | # Get armclang toolchain |
Saheer Babu | 734d2ad | 2024-12-19 09:38:47 +0000 | [diff] [blame] | 22 | aws s3 cp --recursive s3://openci-trustedfirmware-private-${INFRA_ENV}/armclang/ . |
Arthur She | 41115eb | 2024-09-18 14:48:11 -0700 | [diff] [blame] | 23 | # Get IAR toolchain binary |
Saheer Babu | 734d2ad | 2024-12-19 09:38:47 +0000 | [diff] [blame] | 24 | aws s3 cp --recursive s3://openci-trustedfirmware-iar-${INFRA_ENV}/ . |
Kelley Spoon | cd089f0 | 2024-09-12 11:25:41 -0500 | [diff] [blame] | 25 | find . |
Saheer Babu | 734d2ad | 2024-12-19 09:38:47 +0000 | [diff] [blame] | 26 | aws ecr get-login-password --region eu-west-1|docker login --username AWS --password-stdin $ECR |
Kelley Spoon | cd089f0 | 2024-09-12 11:25:41 -0500 | [diff] [blame] | 27 | |
Arthur She | 41115eb | 2024-09-18 14:48:11 -0700 | [diff] [blame] | 28 | image=$(dirname $(find . -name build.sh)) |
| 29 | test -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 | ) |