Merge "Add distribution-check in yangtools jenkins"
[releng/builder.git] / jjb / autorelease / include-raw-autorelease-release-versions.sh
1 #!/bin/bash
2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2015 The Linux Foundation and others.
5 #
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 ##############################################################################
11
12 # RELEASE_TAG=Beryllium-SR1  # Example
13 # RELEASE_BRANCH=stable/beryllium  # Example
14
15 # Directory to put git format-patches
16 PATCH_DIR=`pwd`/patches
17
18 echo $RELEASE_TAG
19 ./scripts/version.sh release $RELEASE_TAG
20 git submodule foreach "git commit -am \"Release $RELEASE_TAG\" || true"
21 git commit -am "Release $RELEASE_TAG"
22
23 mkdir patches
24 mv taglist.log $PATCH_DIR
25 modules=`xmlstarlet sel -N x=http://maven.apache.org/POM/4.0.0 -t -m '//x:modules' -v '//x:module' pom.xml`
26 for module in $modules; do
27     pushd $module
28     git format-patch --stdout origin/$RELEASE_BRANCH > $PATCH_DIR/${module//\//-}.patch
29     git bundle create $PATCH_DIR/${module//\//-}.bundle "origin/master..HEAD"
30     popd
31 done
32
33 ./scripts/fix-relativepaths.sh