Project

General

Profile

Tagging » History » Version 15

Herbert Greenlee, 04/29/2015 04:41 PM

1 5 Herbert Greenlee
{{toc}}
2 2 Herbert Greenlee
3 14 Herbert Greenlee
h1. Preparing a release from the develop branch (git flow release method)
4 1 Herbert Greenlee
5 15 Herbert Greenlee
Make an mrb development area corresponding to the base release of larsoft you are using.
6 11 Herbert Greenlee
<pre>
7 11 Herbert Greenlee
export MRB_PROJECT=larsoft
8 11 Herbert Greenlee
mrb newDev -v v04_03_01 -q e7:prof ...
9 11 Herbert Greenlee
cd $MRB_TOP
10 11 Herbert Greenlee
source localProducts*/setup
11 11 Herbert Greenlee
</pre>
12 1 Herbert Greenlee
13 11 Herbert Greenlee
If necessary, check out uboonecode and dependent packages that are not part of larsoft (ubutil).
14 1 Herbert Greenlee
<pre>
15 11 Herbert Greenlee
cd $MRB_SOURCE
16 11 Herbert Greenlee
mrb g uboonecode
17 11 Herbert Greenlee
mrb g ubutil
18 11 Herbert Greenlee
</pre>
19 11 Herbert Greenlee
20 11 Herbert Greenlee
Make sure your local copies of develop and master branches up to date with the main repository.  Do this for each checked out package.
21 11 Herbert Greenlee
<pre>
22 2 Herbert Greenlee
cd $MRB_SOURCE/<package>
23 2 Herbert Greenlee
git checkout develop
24 2 Herbert Greenlee
git pull
25 1 Herbert Greenlee
git checkout master
26 1 Herbert Greenlee
git pull
27 2 Herbert Greenlee
</pre>
28 1 Herbert Greenlee
29 11 Herbert Greenlee
Use git flow to create a release branch in your local repository.  Git flow always creates the release branch from the head of develop.  
30 10 Herbert Greenlee
<pre>
31 15 Herbert Greenlee
git flow release start <version>
32 4 Herbert Greenlee
</pre>
33 4 Herbert Greenlee
34 15 Herbert Greenlee
This command creates a new branch off of the head of the develop branch called @release/<version>@.  After this command, the newly created release branch will be the checked out branch.  At this point, you can make further changes to your release branch, including the version number of the package being tagged and version numbers of dependent products.  In particular, you may with to edit the following files.
35 2 Herbert Greenlee
36 2 Herbert Greenlee
* ups/product_deps
37 1 Herbert Greenlee
38 1 Herbert Greenlee
After making all updates, it is a good idea to do a full test build, including tests.
39 2 Herbert Greenlee
<pre>
40 1 Herbert Greenlee
cd $MRB_BUILDDIR
41 1 Herbert Greenlee
mrb i -j4
42 1 Herbert Greenlee
mrb t -j4
43 1 Herbert Greenlee
</pre>  
44 11 Herbert Greenlee
When you are done updating the release branch, commit updates to your local repository for each package.
45 1 Herbert Greenlee
<pre>
46 1 Herbert Greenlee
cd $MRB_SOURCE/<package>
47 11 Herbert Greenlee
git commit -a
48 1 Herbert Greenlee
</pre>
49 1 Herbert Greenlee
50 11 Herbert Greenlee
Use git flow to "finish" the release branch.
51 11 Herbert Greenlee
52 1 Herbert Greenlee
<pre>
53 14 Herbert Greenlee
git flow release finish
54 1 Herbert Greenlee
</pre>
55 13 Herbert Greenlee
This git flow command does the following actions.
56 1 Herbert Greenlee
57 11 Herbert Greenlee
* Merges release branch to master.
58 11 Herbert Greenlee
* Merges release branch to develop.
59 11 Herbert Greenlee
* Creates a tag on the master branch.
60 11 Herbert Greenlee
* Deletes the release branch.
61 11 Herbert Greenlee
* Checks out the develop branch.
62 11 Herbert Greenlee
63 12 Herbert Greenlee
Note that when you merge the release branch into master, you are also merging any updates originally from develop into master.
64 12 Herbert Greenlee
65 11 Herbert Greenlee
Now push everything up to main repository.
66 1 Herbert Greenlee
<pre>
67 1 Herbert Greenlee
git push origin develop master
68 15 Herbert Greenlee
git push --tags
69 1 Herbert Greenlee
</pre>
70 1 Herbert Greenlee
71 1 Herbert Greenlee
h1. Preparing a hotfix release (git flow hotfix method)
72 1 Herbert Greenlee
73 15 Herbert Greenlee
Prepare your development area as in the previous section, up to the "@git flow release start@" command.  Instead, issue the following command.
74 15 Herbert Greenlee
<pre>
75 15 Herbert Greenlee
git flow hotfix start <version>
76 15 Herbert Greenlee
</pre>
77 1 Herbert Greenlee
78 11 Herbert Greenlee
h1. Tagging a branch for release (manual method)
79 1 Herbert Greenlee
80 11 Herbert Greenlee
Releases are built from the @master@ branch.  This recipe shows how to create a tag on the @master@ branch of a git repository.
81 11 Herbert Greenlee
82 11 Herbert Greenlee
Make a new mrb development area corresponding to the base release of larsoft you are using.
83 5 Herbert Greenlee
<pre>
84 11 Herbert Greenlee
export MRB_PROJECT=larsoft
85 11 Herbert Greenlee
mrb newDev -v v04_03_01 -q e7:prof ...
86 11 Herbert Greenlee
cd $MRB_TOP
87 11 Herbert Greenlee
source localProducts*/setup
88 11 Herbert Greenlee
</pre>
89 11 Herbert Greenlee
90 11 Herbert Greenlee
If necessary, check out uboonecode and dependent packages that are not part of larsoft (ubutil).
91 11 Herbert Greenlee
<pre>
92 11 Herbert Greenlee
cd $MRB_SOURCE
93 11 Herbert Greenlee
mrb g uboonecode
94 11 Herbert Greenlee
mrb g ubutil
95 11 Herbert Greenlee
</pre>
96 11 Herbert Greenlee
97 11 Herbert Greenlee
Get your local copies of develop and master branches up to date with the main repository.
98 11 Herbert Greenlee
<pre>
99 5 Herbert Greenlee
cd $MRB_SOURCE/<package>
100 1 Herbert Greenlee
git checkout develop
101 1 Herbert Greenlee
git pull
102 1 Herbert Greenlee
git checkout master
103 1 Herbert Greenlee
git pull
104 1 Herbert Greenlee
</pre>
105 1 Herbert Greenlee
106 11 Herbert Greenlee
Update the master branch with changes from develop.
107 5 Herbert Greenlee
<pre>
108 11 Herbert Greenlee
git merge develop
109 5 Herbert Greenlee
</pre>
110 5 Herbert Greenlee
111 11 Herbert Greenlee
At this point, you can make further changes to your master branch, including the version number of the package being tagged and version numbers of dependent products.  In particular, you may with to edit the following files.
112 5 Herbert Greenlee
113 5 Herbert Greenlee
* ups/product_deps
114 5 Herbert Greenlee
115 5 Herbert Greenlee
After making all updates, it is a good idea to do a full test build, including tests.
116 5 Herbert Greenlee
<pre>
117 5 Herbert Greenlee
cd $MRB_BUILDDIR
118 5 Herbert Greenlee
mrb i -j4
119 5 Herbert Greenlee
mrb t -j4
120 5 Herbert Greenlee
</pre>  
121 11 Herbert Greenlee
When you are done updating master, commit and push your changes to the main repository.
122 6 Herbert Greenlee
<pre>
123 5 Herbert Greenlee
cd $MRB_SOURCE/<package>
124 11 Herbert Greenlee
git commit -a
125 11 Herbert Greenlee
git push origin master
126 1 Herbert Greenlee
</pre>
127 6 Herbert Greenlee
128 11 Herbert Greenlee
Now make the actual tag and push the tag to the main repository.
129 5 Herbert Greenlee
<pre>
130 11 Herbert Greenlee
git tag -a -m"v04_03_01" v04_03_01   # Annotated tag.
131 11 Herbert Greenlee
git push origin v04_03_01            # Or git push --tags
132 6 Herbert Greenlee
</pre>
133 11 Herbert Greenlee
If you want to move an existing tag, you need to add option @-f@ or @--force@ to the last two commands.
134 1 Herbert Greenlee
135 11 Herbert Greenlee
If you made changes directly on the master branch, like updating the version number in product_deps, you should merge these back into the develop branch.
136 1 Herbert Greenlee
<pre>
137 11 Herbert Greenlee
git checkout develop
138 11 Herbert Greenlee
git merge master
139 11 Herbert Greenlee
git push origin develop
140 1 Herbert Greenlee
</pre>