blob: 55277e036bc068d0ed42b4aadfc34142e7bd99a5 [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:
11 - build-discarder:
Paul Sokolovsky898f0312024-01-30 00:06:28 +070012 days-to-keep: 365
13 num-to-keep: 50
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030014 - authorization:
15 !include: authorization.yaml.inc
16 parameters:
17 - string:
Paul Sokolovsky633c4d92024-02-28 13:30:14 +070018 name: GERRIT_HOST
19 default: 'review.trustedfirmware.org'
20 - string:
21 name: GERRIT_PROJECT
22 default: 'TF-A/trusted-firmware-a'
23 description: |
24 TF-A Git project
25 - string:
26 name: GERRIT_BRANCH
27 default: ''
28 description: |
29 Git branch (e.g. lts-v2.8) to search for the latest tag in case of --latest is used for RELEASE_TAG
30 - string:
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030031 name: RELEASE_TAG
32 default: '--latest'
33 description: |
Paul Sokolovsky633c4d92024-02-28 13:30:14 +070034 Release git tag, e.g. 'lts-v2.8.10', or '--latest' to get latest tag in GERRIT_BRANCH
35 - bool:
36 name: SANDBOX_RUN
37 default: true
38 description: |
39 Run sandbox simulation of a release. Uncheck this only after
40 running simulation and checking that everything is correct!
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030041# triggers:
42# - gerrit:
43# silent: true
44# server-name: 'review.trustedfirmware.org'
45# projects:
46# - branches:
47# - branch-compare-type: PLAIN
48# branch-pattern: integration
49# project-compare-type: PLAIN
50# project-pattern: 'TF-A/trusted-firmware-a'
51# trigger-on:
52# - patchset-created-event
53 wrappers:
54 - timestamps
55 - timeout:
56 timeout: 5
57 fail: true
58 builders:
59 - shell: |
60 #!/bin/bash
61 set -ex
62
63 git clone https://git.trustedfirmware.org/ci/tf-a-ci-scripts.git
Paul Sokolovsky633c4d92024-02-28 13:30:14 +070064 ./tf-a-ci-scripts/lts/lts-release-mail.py --url https://${GERRIT_HOST}/${GERRIT_PROJECT} --branch "${GERRIT_BRANCH}" ${RELEASE_TAG} >email.txt
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030065 awk -F": " '/Subject:/ {print $2}' email.txt >subject.txt
66 # Remove email headers, put in a seperate file.
67 sed '0,/^$/d' email.txt >body.txt
Paul Sokolovsky633c4d92024-02-28 13:30:14 +070068
69 if [ "$SANDBOX_RUN" == "true" ]; then
Paul Sokolovskyc1946262024-03-19 17:52:54 +070070 echo "paul.sokolovsky+sandbox@linaro.org, Bipin.Ravi@arm.com, vwadekar@nvidia.com, okash@google.com, jidong@google.com, yann.gautier@st.com" >recipients.txt
Paul Sokolovsky633c4d92024-02-28 13:30:14 +070071 echo -n "[SANDBOX] " | cat - subject.txt > subject.txt.tmp
72 mv subject.txt.tmp subject.txt
73 else
Paul Sokolovsky8fccc1b2024-04-15 16:02:31 +070074 echo "tfa-lts@lists.trustedfirmware.org, tf-a@lists.trustedfirmware.org, paul.sokolovsky@linaro.org" >recipients.txt
Paul Sokolovsky633c4d92024-02-28 13:30:14 +070075 fi
76
Paul Sokolovskyf0ecdb52023-11-27 22:30:14 +030077 set +x
78 echo "======================================================================="
79 cat email.txt
80 echo "======================================================================="
81 publishers:
82 - archive:
83 artifacts: email.txt
84 latest-only: false
85 allow-empty: true
86 - conditional-publisher:
87 - condition-kind: file-exists
88 on-evaluation-failure: dont-run
89 condition-filename: email.txt
90 condition-basedir: workspace
91 action:
92 - email-ext:
93 always: true
94 subject: '${FILE, path="subject.txt"}'
95 body: '${FILE, path="body.txt"}'
Paul Sokolovsky633c4d92024-02-28 13:30:14 +070096 recipients: '${FILE, path="recipients.txt"}'