--- /dev/null
+---
+Job Templates
+=============
+
+.. _release-announce:
+
+Release Announce
+----------------
+
+Job for lf-releng projects to automate release announcement emails.
+
+:Template Names:
+ - {project-name}-release-announce
+ - gerrit-release-announce
+
+:Required parameters:
+
+ :build-node: The node to run build on.
+ :jenkins-ssh-credential: Credential to use for SSH. (Configured in
+ defaults.yaml)
--- /dev/null
+---
+####################
+# Release Announce #
+####################
+
+- lf_release_announce: &lf_release_announce
+ name: lf-release-announce
+
+ ######################
+ # Default parameters #
+ ######################
+
+ build-days-to-keep: 7
+ build-timeout: 15
+ disable-job: false
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ project-type: freestyle
+ node: '{build-node}'
+ disabled: '{disable-job}'
+
+ properties:
+ - lf-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+
+ builders:
+ - shell: !include-raw-escape: ../shell/release-announce.sh
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ publishers:
+ - lf-infra-publish
+
+
+- job-template:
+ name: '{project-name}-release-announce'
+ id: gerrit-release-announce
+ <<: *lf_release_announce
+
+ triggers:
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on:
+ - ref-updated-event
+ projects:
+ - project-compare-type: 'ANT'
+ project-pattern: '{project-pattern}'
+ branches:
+ - branch-compare-type: 'ANT'
+ branch-pattern: 'refs/tags/**'
--- /dev/null
+---
+features:
+ - |
+ New job-template **{project-name}-release-announce** for lf-releng projects
+ to automate release announcement emails.
--- /dev/null
+#!/bin/bash
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+
+PROJECT="${GERRIT_PROJECT#releng/}" # For releng projects strip the prefix
+TAG_NAME="${GERRIT_REFNAME#refs/tags/}"
+
+set -eux -o pipefail
+
+mail_opts=()
+mail_opts+=("-r" "LF Releng <lf-releng@lists.linuxfoundation.org>")
+mail_opts+=("-s" "$PROJECT $TAG_NAME released")
+mail_opts+=("lf-releng@lists.linuxfoundation.org")
+
+mail "${mail_opts[@]}" << EOF
+Hi Everyone,
+
+$PROJECT $TAG_NAME is released. Thanks to everyone who contributed
+to this release. Release notes are available online at:
+
+https://docs.releng.linuxfoundation.org/projects/$PROJECT/en/latest/release-notes.html#${TAG_NAME}
+
+Cheers,
+LF Releng
+EOF