From: Thanh Ha Date: Thu, 1 Nov 2018 03:39:39 +0000 (-0400) Subject: Add job to automatically announce lf releases X-Git-Tag: v0.31.0~2^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F13269%2F6;p=releng%2Fglobal-jjb.git Add job to automatically announce lf releases This job triggers when a Gerrit tag is pushed and sends an email to lf-releng@lists.linuxfoundation.org to notifiy the release. Change-Id: I5255ac6f3afbcadfc11e9640483613bd2e84250a Signed-off-by: Thanh Ha --- diff --git a/docs/jjb/lf-release-management-jobs.rst b/docs/jjb/lf-release-management-jobs.rst new file mode 100644 index 00000000..5bf3e93f --- /dev/null +++ b/docs/jjb/lf-release-management-jobs.rst @@ -0,0 +1,20 @@ +--- +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) diff --git a/jjb/lf-release-management-jobs.yaml b/jjb/lf-release-management-jobs.yaml new file mode 100644 index 00000000..5bee4298 --- /dev/null +++ b/jjb/lf-release-management-jobs.yaml @@ -0,0 +1,56 @@ +--- +#################### +# 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/**' diff --git a/releasenotes/notes/automate-release-announcements-0b9f2c7f854198ff.yaml b/releasenotes/notes/automate-release-announcements-0b9f2c7f854198ff.yaml new file mode 100644 index 00000000..15c68a33 --- /dev/null +++ b/releasenotes/notes/automate-release-announcements-0b9f2c7f854198ff.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + New job-template **{project-name}-release-announce** for lf-releng projects + to automate release announcement emails. diff --git a/shell/release-announce.sh b/shell/release-announce.sh new file mode 100644 index 00000000..fd1afe60 --- /dev/null +++ b/shell/release-announce.sh @@ -0,0 +1,32 @@ +#!/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 ") +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