blob: 9ec5c0c62943b258b5dfb56ac612ab3693e06ceb [file] [log] [blame]
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +03001- job:
2 name: tf-a-lts-release-mail
3 node: docker-amd64-tf-a-jammy
4 project-type: freestyle
5 concurrent: true
6 disabled: false
7 defaults: global
Paul Sokolovskyd9f65b52024-10-22 13:50:58 +07008 description: |
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +03009 Render TF-A LTS release email template.
10 properties:
Chris Kay675db4f2025-06-24 14:14:34 +010011 - build-discarder:
12 days-to-keep: 365
13 num-to-keep: 50
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030014 parameters:
Chris Kay675db4f2025-06-24 14:14:34 +010015 - string:
16 name: GERRIT_HOST
17 default: review.trustedfirmware.org
18 - string:
19 name: GERRIT_PROJECT
20 default: TF-A/trusted-firmware-a
21 description: |
22 TF-A Git project
23 - string:
24 name: GERRIT_BRANCH
25 default: ""
26 description: |
27 Git branch (e.g. lts-v2.8) to search for the latest tag in case of --latest is used for RELEASE_TAG
28 - string:
29 name: RELEASE_TAG
30 default: --latest
31 description: |
32 Release git tag, e.g. 'lts-v2.8.10', or '--latest' to get latest tag in GERRIT_BRANCH
33 - bool:
34 name: SANDBOX_RUN
35 default: true
36 description: |
37 Run sandbox simulation of a release. Uncheck this only after
38 running simulation and checking that everything is correct!
39 # triggers:
40 # - gerrit:
41 # silent: true
42 # server-name: 'review.trustedfirmware.org'
43 # projects:
44 # - branches:
45 # - branch-compare-type: PLAIN
46 # branch-pattern: integration
47 # project-compare-type: PLAIN
48 # project-pattern: 'TF-A/trusted-firmware-a'
49 # trigger-on:
50 # - patchset-created-event
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030051 wrappers:
Chris Kay675db4f2025-06-24 14:14:34 +010052 - timestamps
53 - timeout:
54 timeout: 5
55 fail: true
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030056 builders:
Chris Kay675db4f2025-06-24 14:14:34 +010057 - shell: |
58 #!/bin/bash
59 set -ex
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030060
Chris Kay675db4f2025-06-24 14:14:34 +010061 git clone https://git.trustedfirmware.org/ci/tf-a-ci-scripts.git
62 ./tf-a-ci-scripts/lts/lts-release-mail.py --url https://${GERRIT_HOST}/${GERRIT_PROJECT} --branch "${GERRIT_BRANCH}" ${RELEASE_TAG} >email.txt
63 awk -F": " '/Subject:/ {print $2}' email.txt >subject.txt
64 # Remove email headers, put in a seperate file.
65 sed '0,/^$/d' email.txt >body.txt
Paul Sokolovsky633c4d92024-02-28 13:30:14 +070066
Chris Kay675db4f2025-06-24 14:14:34 +010067 if [ "$SANDBOX_RUN" == "true" ]; then
68 echo "Bipin.Ravi@arm.com, vwadekar@nvidia.com, yann.gautier@st.com, jidong@google.com, govindraj.raja@arm.com" >recipients.txt
69 echo -n "[SANDBOX] " | cat - subject.txt > subject.txt.tmp
70 mv subject.txt.tmp subject.txt
71 else
72 echo "tfa-lts@lists.trustedfirmware.org, tf-a@lists.trustedfirmware.org" >recipients.txt
73 fi
Paul Sokolovsky633c4d92024-02-28 13:30:14 +070074
Chris Kay675db4f2025-06-24 14:14:34 +010075 set +x
76 echo "======================================================================="
77 cat email.txt
78 echo "======================================================================="
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030079 publishers:
Chris Kay675db4f2025-06-24 14:14:34 +010080 - archive:
81 artifacts: email.txt
82 latest-only: false
83 allow-empty: true
84 - conditional-publisher:
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030085 - condition-kind: file-exists
86 on-evaluation-failure: dont-run
87 condition-filename: email.txt
88 condition-basedir: workspace
89 action:
Chris Kay675db4f2025-06-24 14:14:34 +010090 - email-ext:
91 always: true
92 subject: ${FILE, path="subject.txt"}
93 body: ${FILE, path="body.txt"}
94 recipients: ${FILE, path="recipients.txt"}