2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2015, 2017 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
12 # RELEASE_TAG=Beryllium-SR1 # Example
13 # RELEASE_BRANCH=stable/beryllium # Example
15 # Set release tag as $STREAM, when no release tag is passed
16 RELEASE_TAG="${RELEASE_TAG:-${STREAM^}}"
17 # Ensure that the first letter of RELEASE_TAG is uppercase.
18 RELEASE_TAG="${RELEASE_TAG^}"
20 # Directory to put git format-patches
21 PATCH_DIR="$WORKSPACE/patches"
24 lftools version release "$RELEASE_TAG"
25 git submodule foreach "git commit -am \"Release $RELEASE_TAG\" || true"
26 git commit -am "Release $RELEASE_TAG"
29 # TODO: Fix this workaround so that scripts will ensure that taglist.log exists and archived.
30 mv taglist.log "$PATCH_DIR" || true
31 modules=$(xmlstarlet sel -N x=http://maven.apache.org/POM/4.0.0 -t -m '//x:modules' -v '//x:module' pom.xml)
32 for module in $modules; do
34 git format-patch --stdout "origin/$RELEASE_BRANCH" > "$PATCH_DIR/${module//\//-}.patch"
35 git bundle create "$PATCH_DIR/${module//\//-}.bundle" "origin/master..HEAD"
39 tar cvzf patches.tar.gz -C "$WORKSPACE" patches
40 rm "$PATCH_DIR"/*.bundle