blob: da554cc7bca866c42be7008fdecb5b73127c2109 [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:
11 days-to-keep: 90
12 num-to-keep: 200
13 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
23 description: Build Ubuntu AMI
24 - bool:
25 name: BUILD_FREEBSD_AMI
26 default: false
27 description: Build FreeBSD AMI
28 - bool:
29 name: BUILD_CUSTOM_AMI
30 default: false
31 description: Build Custom AMI
32 builders:
33 - shell: |
34 #!/bin/bash
35
36 export PACKER_LOG=1
37
38 AMI=""
39 [ ${BUILD_UBUNTU_AMI} == "true" ] && AMI="${AMI} ubuntu"
40 [ ${BUILD_FREEBSD_AMI} == "true" ] && AMI="${AMI} freebsd"
41 [ ${BUILD_CUSTOM_AMI} == "true" ] && AMI="${AMI} custom"
42
43 [ -z "${AMI}" ] && echo "Build Nothing.." && exit
44
45 rm -rf mbedtls-amis
46 git clone https://git.trustedfirmware.org/ci/aws-amis.git
47 cd mbedtls-amis
48
49 for os in ${AMI}
50 do
51 echo -e "\nBuild ${os} AMI"
52 [ ! -f "packer_${os}.json" ] && echo -e "\nERROR: Can not find packer_${os}.json" && exit -1
53 # Dump packer_config.json to job log
54 cat packer_${os}.json
55 packer build packer_${os}.json
56 done
57 publishers:
58 - email:
59 recipients: linaro-infrastructure-errors@lists.linaro.org,arthur.she@linaro.org