mbedtls-amis.yaml: Support to build multi OS AMI
Build AMI by parameters
Signed-off-by: Arthur She <arthur.she@linaro.org>
Change-Id: If69e1c6a8e5517332c47bcf99725e4e3db32e3a6
diff --git a/mbedtls-amis/builders.sh b/mbedtls-amis/builders.sh
old mode 100644
new mode 100755
index 95747b2..2dcd4e7
--- a/mbedtls-amis/builders.sh
+++ b/mbedtls-amis/builders.sh
@@ -1,11 +1,21 @@
#!/bin/bash
+AMI=""
+[ ${BUILD_UBUNTU_AMI} == "true" ] && AMI="${AMI} ubuntu"
+[ ${BUILD_FREEBSD_AMI} == "true" ] && AMI="${AMI} freebsd"
+
+[ -z "${AMI}" ] && echo "Build Nothing.." && exit
+
rm -rf mbedtls-amis
git clone https://git.trustedfirmware.org/next/ci/mbedtls-amis.git
cd mbedtls-amis
-# Dump packer_config.json to job log
-cat packer_config.json
-
-packer build packer_config.json
+for os in ${AMI}
+do
+ echo -e "\nBuild ${os} AMI"
+ [ ! -f "packer_${os}.json" ] && echo -e "\nERROR: Can not find packer_${os}.json" && exit -1
+ # Dump packer_config.json to job log
+ cat packer_${os}.json
+ packer build packer_${os}.json
+done