blob: e8a2f0ca13a36bd713ed60b39099bc5d8fa0679a [file] [log] [blame]
- job:
name: build-aws-amis
project-type: freestyle
defaults: global
properties:
- authorization:
anonymous:
- job-read
- job-extended-read
- build-discarder:
days-to-keep: 365
num-to-keep: 20
disabled: false
node: build-amd64-private
concurrent: false
display-name: 'Build AWS AMI'
wrappers:
- timestamps
parameters:
- bool:
name: BUILD_UBUNTU_AMI
default: true
description: Build Ubuntu AMD64 AMI
- bool:
name: BUILD_UBUNTU_AARCH64_AMI
default: false
description: Build Ubuntu AARCH64 AMI
- bool:
name: BUILD_FREEBSD_AMI
default: false
description: Build FreeBSD AMI
- bool:
name: BUILD_CUSTOM_AMI
default: false
description: Build Custom AMI
- string:
name: AMI_REPO_BRANCH
default: master
description: Branch to use when cloning git.trustedfirmware.org/ci/aws-amis.git
builders:
- shell: |
#!/bin/bash
export PACKER_LOG=1
AMI=""
[ ${BUILD_UBUNTU_AMI} == "true" ] && AMI="${AMI} ubuntu"
[ ${BUILD_UBUNTU_AARCH64_AMI} == "true" ] && AMI="${AMI} aarch64"
[ ${BUILD_FREEBSD_AMI} == "true" ] && AMI="${AMI} freebsd"
[ ${BUILD_CUSTOM_AMI} == "true" ] && AMI="${AMI} custom"
[ -z "${AMI}" ] && echo "Build Nothing.." && exit
[ -d "aws-amis" ] && rm -rf aws-amis
git clone https://git.trustedfirmware.org/ci/aws-amis.git -b $AMI_REPO_BRANCH
cd aws-amis
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
publishers:
- email:
recipients: linaro-infrastructure-errors@lists.linaro.org,arthur.she@linaro.org