source: rtems-release/rtems-release-tag

5
Last change on this file was 9fe4518, checked in by Chris Johns <chrisj@…>, on 10/30/19 at 05:08:58

Stop of error (set -e)

  • Property mode set to 100755
File size: 3.2 KB
Line 
1#! /bin/sh
2#
3# RTEMS Tools Project (http://www.rtems.org/)
4# Copyright 2016 Chris Johns (chrisj@rtems.org)
5# All rights reserved.
6#
7# This file is part of the RTEMS Tools package in 'rtems-tools'.
8#
9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions are met:
11#
12# 1. Redistributions of source code must retain the above copyright notice,
13# this list of conditions and the following disclaimer.
14#
15# 2. Redistributions in binary form must reproduce the above copyright notice,
16# this list of conditions and the following disclaimer in the documentation
17# and/or other materials provided with the distribution.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30#
31
32set -e
33
34#
35# This is the top level RTEMS release script. Supply the version and and the
36# release.
37#
38. ./rtems-release-version
39echo "RTEMS Release, v${rtems_release_version}"
40
41#
42# Global release top path.
43#
44export release_top=${PWD}
45
46#
47# Defaults.
48#
49. ${release_top}/rtems-release-defaults
50
51#
52# The user, version and revision.
53#
54if [ $# -ne 3 ]; then
55 echo "error: must be 3 arguments, your git user name, the release and version."
56 exit 1
57fi
58user=$1
59version=$2
60revision=$3
61
62release=${version}.${revision}
63
64#
65# Enable to push.
66#
67push=yes
68
69#
70# Repositories to tag.
71#
72rtems_repos="${rtems_repos} rtems-release.git"
73rtems_repos="${rtems_repos} rtems-source-builder.git"
74rtems_repos="${rtems_repos} rtems-tools.git"
75rtems_repos="${rtems_repos} rtems.git"
76rtems_repos="${rtems_repos} rtems-docs.git"
77rtems_repos="${rtems_repos} rtems-libbsd.git"
78rtems_repos="${rtems_repos} examples-v2.git"
79
80#
81# The tagging workspace.
82#
83ws_tag=${release}-tagged
84
85#
86# Version configuration. Overrides defaults.
87#
88if [ -f rtems-release-${version}-conf ]; then
89 rtems_release_conf=rtems-release-${version}-conf
90 . rtems-release-${version}-conf
91fi
92
93#
94# Clean the tagging directory away.
95#
96rm -rf ${ws_tag}
97mkdir ${ws_tag}
98
99#
100# Clone and tag the repositories.
101#
102cd ${ws_tag}
103 for r in ${rtems_repos}
104 do
105  ref=origin/${version}
106  #
107  # We tag master for the rtems-release.git repo. No branchs.
108  #
109  if [ ${r} = rtems-release.git ]; then
110   ref=master
111  fi
112  echo "git clone ssh://${user}@dispatch.rtems.org/data/git/${r} ${r}"
113  git clone ssh://${user}@dispatch.rtems.org/data/git/${r} ${r}
114  cd ${r}
115   echo "git tag ${release} ${ref}"
116   git  tag ${release} ${ref}
117   cd ..
118 done
119
120 if [ ${push} = yes ]; then
121  for r in ${rtems_repos}
122  do
123   cd ${r}
124    echo "git push origin ${release}"
125    git push origin ${release}
126    cd ..
127  done
128 fi
129 cd ..
130
131exit 0
Note: See TracBrowser for help on using the repository browser.