blob: 9a301b8a0fa7e4aeb8abb428f95536360199ded7 [file] [log] [blame]
Arthur Shedb8680f2023-10-28 20:48:35 -07001- job:
2 name: build-aws-amis
3 project-type: freestyle
4 defaults: global
5 properties:
6 - authorization:
7 anonymous:
8 - job-read
9 - job-extended-read
10 - build-discarder:
Paul Sokolovskyd662a562024-11-07 17:24:16 +070011 days-to-keep: 365
12 num-to-keep: 20
Arthur Shedb8680f2023-10-28 20:48:35 -070013 disabled: false
14 node: build-amd64-private
15 concurrent: false
16 display-name: 'Build AWS AMI'
17 wrappers:
18 - timestamps
19 parameters:
20 - bool:
21 name: BUILD_UBUNTU_AMI
22 default: true
Kelley Spoond64e64f2024-10-27 23:51:03 -050023 description: Build Ubuntu AMD64 AMI
24 - bool:
25 name: BUILD_UBUNTU_AARCH64_AMI
26 default: false
27 description: Build Ubuntu AARCH64 AMI
Arthur Shedb8680f2023-10-28 20:48:35 -070028 - bool:
29 name: BUILD_FREEBSD_AMI
30 default: false
31 description: Build FreeBSD AMI
32 - bool:
33 name: BUILD_CUSTOM_AMI
34 default: false
35 description: Build Custom AMI
36 builders:
37 - shell: |
38 #!/bin/bash
39
40 export PACKER_LOG=1
41
42 AMI=""
43 [ ${BUILD_UBUNTU_AMI} == "true" ] && AMI="${AMI} ubuntu"
Kelley Spoond64e64f2024-10-27 23:51:03 -050044 [ ${BUILD_UBUNTU_AARCH64_AMI} == "true" ] && AMI="${AMI} aarch64"
Arthur Shedb8680f2023-10-28 20:48:35 -070045 [ ${BUILD_FREEBSD_AMI} == "true" ] && AMI="${AMI} freebsd"
46 [ ${BUILD_CUSTOM_AMI} == "true" ] && AMI="${AMI} custom"
47
48 [ -z "${AMI}" ] && echo "Build Nothing.." && exit
49
Arthur She345c9282023-10-28 20:59:19 -070050 [ -d "aws-amis" ] && rm -rf aws-amis
Arthur Shedb8680f2023-10-28 20:48:35 -070051 git clone https://git.trustedfirmware.org/ci/aws-amis.git
Arthur She345c9282023-10-28 20:59:19 -070052 cd aws-amis
Arthur Shedb8680f2023-10-28 20:48:35 -070053
54 for os in ${AMI}
55 do
56 echo -e "\nBuild ${os} AMI"
57 [ ! -f "packer_${os}.json" ] && echo -e "\nERROR: Can not find packer_${os}.json" && exit -1
58 # Dump packer_config.json to job log
59 cat packer_${os}.json
60 packer build packer_${os}.json
61 done
62 publishers:
63 - email:
64 recipients: linaro-infrastructure-errors@lists.linaro.org,arthur.she@linaro.org