Paul Sokolovsky | f0ecdb5 | 2023-11-27 22:30:14 +0300 | [diff] [blame] | 1 | - 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 Sokolovsky | d9f65b5 | 2024-10-22 13:50:58 +0700 | [diff] [blame^] | 8 | description: | |
Paul Sokolovsky | f0ecdb5 | 2023-11-27 22:30:14 +0300 | [diff] [blame] | 9 | Render TF-A LTS release email template. |
| 10 | properties: |
| 11 | - build-discarder: |
Paul Sokolovsky | 898f031 | 2024-01-30 00:06:28 +0700 | [diff] [blame] | 12 | days-to-keep: 365 |
| 13 | num-to-keep: 50 |
Paul Sokolovsky | f0ecdb5 | 2023-11-27 22:30:14 +0300 | [diff] [blame] | 14 | - authorization: |
| 15 | !include: authorization.yaml.inc |
| 16 | parameters: |
| 17 | - string: |
Paul Sokolovsky | 633c4d9 | 2024-02-28 13:30:14 +0700 | [diff] [blame] | 18 | 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 Sokolovsky | f0ecdb5 | 2023-11-27 22:30:14 +0300 | [diff] [blame] | 31 | name: RELEASE_TAG |
| 32 | default: '--latest' |
| 33 | description: | |
Paul Sokolovsky | 633c4d9 | 2024-02-28 13:30:14 +0700 | [diff] [blame] | 34 | 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 Sokolovsky | f0ecdb5 | 2023-11-27 22:30:14 +0300 | [diff] [blame] | 41 | # 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 Sokolovsky | 633c4d9 | 2024-02-28 13:30:14 +0700 | [diff] [blame] | 64 | ./tf-a-ci-scripts/lts/lts-release-mail.py --url https://${GERRIT_HOST}/${GERRIT_PROJECT} --branch "${GERRIT_BRANCH}" ${RELEASE_TAG} >email.txt |
Paul Sokolovsky | f0ecdb5 | 2023-11-27 22:30:14 +0300 | [diff] [blame] | 65 | 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 Sokolovsky | 633c4d9 | 2024-02-28 13:30:14 +0700 | [diff] [blame] | 68 | |
| 69 | if [ "$SANDBOX_RUN" == "true" ]; then |
Paul Sokolovsky | c194626 | 2024-03-19 17:52:54 +0700 | [diff] [blame] | 70 | 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 Sokolovsky | 633c4d9 | 2024-02-28 13:30:14 +0700 | [diff] [blame] | 71 | echo -n "[SANDBOX] " | cat - subject.txt > subject.txt.tmp |
| 72 | mv subject.txt.tmp subject.txt |
| 73 | else |
Paul Sokolovsky | 8fccc1b | 2024-04-15 16:02:31 +0700 | [diff] [blame] | 74 | echo "tfa-lts@lists.trustedfirmware.org, tf-a@lists.trustedfirmware.org, paul.sokolovsky@linaro.org" >recipients.txt |
Paul Sokolovsky | 633c4d9 | 2024-02-28 13:30:14 +0700 | [diff] [blame] | 75 | fi |
| 76 | |
Paul Sokolovsky | f0ecdb5 | 2023-11-27 22:30:14 +0300 | [diff] [blame] | 77 | 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 Sokolovsky | 633c4d9 | 2024-02-28 13:30:14 +0700 | [diff] [blame] | 96 | recipients: '${FILE, path="recipients.txt"}' |