Paul Sokolovsky | eb8ca08 | 2024-03-06 21:43:56 +0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | trap cleanup_exit INT TERM EXIT |
| 6 | |
| 7 | cleanup_exit() |
| 8 | { |
| 9 | rm -f *.list *.key |
| 10 | } |
| 11 | |
Nicola Mazzucato | 8ab727f | 2024-04-19 13:48:05 +0100 | [diff] [blame] | 12 | target=ci |
| 13 | |
| 14 | while [ $# -gt 0 ]; do |
| 15 | case $1 in |
| 16 | -l) |
| 17 | echo "local build config chosen" |
| 18 | target=local |
| 19 | shift |
| 20 | ;; |
| 21 | *) |
| 22 | echo "Invalid argument: only -l allowed" |
| 23 | exit 1 |
| 24 | ;; |
| 25 | esac |
| 26 | done |
| 27 | |
Paul Sokolovsky | eb8ca08 | 2024-03-06 21:43:56 +0700 | [diff] [blame] | 28 | export LANG=C |
| 29 | |
| 30 | DISTRIBUTION=$(basename ${PWD} | cut -f1 -d '-') |
| 31 | ARCHITECTURE=$(basename ${PWD} | cut -f2 -d '-') |
| 32 | PROJECT=$(basename ${PWD} | cut -f3 -d '-')-$(basename ${PWD} | cut -f4 -d '-') |
| 33 | |
| 34 | cp -a ../setup-sshd . |
| 35 | |
| 36 | # Copy armclang toolchains required for the build (previously fetched |
| 37 | # from s3://trustedfirmware-private/armclang/ by build harness). |
| 38 | cp ../ARMCompiler6.21_standalone_linux-x86_64.tar.gz . |
| 39 | |
| 40 | image=trustedfirmware/ci-${ARCHITECTURE}-${PROJECT}-ubuntu:${DISTRIBUTION}${DOCKER_SUFFIX} |
Nicola Mazzucato | 8ab727f | 2024-04-19 13:48:05 +0100 | [diff] [blame] | 41 | docker build --target=base-$target --pull --tag=$image . |
Paul Sokolovsky | eb8ca08 | 2024-03-06 21:43:56 +0700 | [diff] [blame] | 42 | echo $image > .docker-tag |