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 | |
---|
32 | # |
---|
33 | # This is the top level RTEMS release script. Supply the version and and the |
---|
34 | # release. |
---|
35 | # |
---|
36 | |
---|
37 | echo "RTEMS Release, v0.1" |
---|
38 | |
---|
39 | # |
---|
40 | # Global release top path. |
---|
41 | # |
---|
42 | export release_top=${PWD} |
---|
43 | |
---|
44 | # |
---|
45 | # Defaults. |
---|
46 | # |
---|
47 | . ${release_top}/rtems-release-defaults |
---|
48 | |
---|
49 | # |
---|
50 | # The user, version and revision. |
---|
51 | # |
---|
52 | if [ $# -ne 3 ]; then |
---|
53 | echo "error: must be 3 arguments, your git user name, the release and version." |
---|
54 | exit 1 |
---|
55 | fi |
---|
56 | user=$1 |
---|
57 | version=$2 |
---|
58 | revision=$3 |
---|
59 | |
---|
60 | release=${version}.${revision} |
---|
61 | |
---|
62 | # |
---|
63 | # Enable to push. |
---|
64 | # |
---|
65 | push=yes |
---|
66 | |
---|
67 | # |
---|
68 | # Repositories to tag. |
---|
69 | # |
---|
70 | rtems_repos="${rtems_repos} rtems-release.git" |
---|
71 | rtems_repos="${rtems_repos} rtems-source-builder.git" |
---|
72 | rtems_repos="${rtems_repos} rtems-tools.git" |
---|
73 | rtems_repos="${rtems_repos} rtems.git" |
---|
74 | rtems_repos="${rtems_repos} rtems-docs.git" |
---|
75 | rtems_repos="${rtems_repos} rtems-libbsd.git" |
---|
76 | rtems_repos="${rtems_repos} examples-v2.git" |
---|
77 | |
---|
78 | # |
---|
79 | # The tagging workspace. |
---|
80 | # |
---|
81 | ws_tag=${release}-tagged |
---|
82 | |
---|
83 | # |
---|
84 | # Version configuration. Overrides defaults. |
---|
85 | # |
---|
86 | if [ -f rtems-release-${version}-conf ]; then |
---|
87 | rtems_release_conf=rtems-release-${version}-conf |
---|
88 | . rtems-release-${version}-conf |
---|
89 | fi |
---|
90 | |
---|
91 | # |
---|
92 | # Clean the tagging directory away. |
---|
93 | # |
---|
94 | rm -rf ${ws_tag} |
---|
95 | mkdir ${ws_tag} |
---|
96 | |
---|
97 | # |
---|
98 | # Clone and tag the repositories. |
---|
99 | # |
---|
100 | cd ${ws_tag} |
---|
101 | for r in ${rtems_repos} |
---|
102 | do |
---|
103 | ref=origin/${version} |
---|
104 | # |
---|
105 | # We tag master for the rtems-release.git repo. No branchs. |
---|
106 | # |
---|
107 | if [ ${r} = rtems-release.git ]; then |
---|
108 | ref=master |
---|
109 | fi |
---|
110 | echo "git clone ssh://${user}@dispatch.rtems.org/data/git/${r} ${r}" |
---|
111 | git clone ssh://${user}@dispatch.rtems.org/data/git/${r} ${r} |
---|
112 | cd ${r} |
---|
113 | echo "git tag ${release} ${ref}" |
---|
114 | git tag ${release} ${ref} |
---|
115 | cd .. |
---|
116 | done |
---|
117 | |
---|
118 | if [ ${push} = yes ]; then |
---|
119 | for r in ${rtems_repos} |
---|
120 | do |
---|
121 | cd ${r} |
---|
122 | echo "git push origin ${release}" |
---|
123 | git push origin ${release} |
---|
124 | cd .. |
---|
125 | done |
---|
126 | fi |
---|
127 | cd .. |
---|
128 | |
---|
129 | exit 0 |
---|