root/tools/bundleman/trunk/README.txt

Revision 51509, 20.2 kB (checked in by bdelbosc, 1 year ago)

prepare for 1.2.0

  • Property svn:keywords set to Id
Line 
1 =========
2 BundleMan
3 =========
4
5 :author: Benoit Delbosc
6
7 :address: bdelbosc _at_ nuxeo.com
8
9 :version: BundleMan/1.2.0
10
11 :revision: $Id$
12
13 :Copyright: (C) Copyright 2006 Nuxeo SAS (http://nuxeo.com).
14             This program is free software; you can redistribute it and/or
15             modify it under the terms of the GNU General Public License as
16             published by the Free Software Foundation; either version 2 of
17             the License, or (at your option) any later version.
18             This program is distributed in the hope that it will be useful,
19             but WITHOUT ANY WARRANTY; without even the implied warranty of
20             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21             General Public License for more details.
22             You should have received a copy of the GNU General Public
23             License along with this program; if not, write to the Free
24             Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25             MA 02111-1307, USA.
26
27 :abstract: This document describes the usage of the BundleMan_ tool. This tool
28     enables to release application with versioned products using subversion.
29
30 .. sectnum::    :depth: 1
31
32 .. contents:: Table of Contents
33
34
35 Introducing BundleMan
36 =====================
37
38 What is BundleMan ?
39 -------------------
40
41 BundleMan manages the release of applications built on versioned
42 products under subversion_ (aka versioned multi modules).
43
44 An application is seen as a products suite defined using subversion_
45 `svn:externals`_ property. An application is a bundle of products.
46 Products are versioned pieces of software.
47
48 Releasing an application is about taking care of tagging the source
49 repository, managing version of each products, managing CHANGELOG, creating
50 a source package archive, giving ways to maitain a release without blocking
51 the trunk development.
52
53
54 Main features:
55
56 * BundleMan is free software distributed under the `GNU GPL`_.
57
58 * It uses a recommended `trunk/branches/tags`_ repository layouts for
59   products and bundles.
60
61 * It uses standard versioning MAJOR.MINOR.BUGFIX-RELEASE for products.
62
63 * Versioning of products is done automaticly by analysing a CHANGES file.
64
65 * Enforce CHANGELOG quality by requiring a product CHANGES file.
66
67 * It Generates an application CHANGELOG.
68
69 * There is no locking of the trunk or version's conflict when patching a
70   released application.
71
72 * Can manage public, private or remote products.
73
74 * BundleMan is written in python and can be easily customized.
75
76
77 Where to find BundleMan ?
78 -------------------------
79
80 Get the latest package from python `Cheese Shop`_.
81
82 Or use the bleeding edge ::
83
84    svn co http://svn.nuxeo.org/pub/tools/bundleman/trunk bundleman
85
86
87 Installation
88 ------------
89
90 See the INSTALL_ file for requirement and installation.
91
92
93 Examples
94 --------
95
96 You can play with BundleMan in a sandbox using the unit test environment.
97
98 From the extracted archive::
99
100      $ python setup.py test
101      running test
102      ...
103      INFO: Archive: /tmp/bm-jE9JMJ/co/APP.tgz
104      ...
105      Ran 6 tests in 72.976s
106      OK
107
108 Look at the temporary folder ``/tmp/bm-{WhAtEvEr}/`` you will find a ``svn``
109 folder which contains the svn sandbox repository and a ``co`` folder with
110 working copies of an application. For example ``co/app`` is a trunk
111 bundle with 2 empty products ``foo`` and ``bar``. You can test some `bm-bundle`
112 commands from here, try ``bm-bundle -v`` then try to release this apps
113 following the use case below.
114
115
116
117 Documentation
118 -------------
119
120 This page is the main BundleMan_ documentation, there are also:
121
122 * CHANGES_ for information about distribution contents.
123 * INSTALL_ for requirement and installation.
124 * API_ documentation generated with epydoc_.
125
126
127 Use cases
128 =========
129
130 Inititialize an application to use BundleMan
131 --------------------------------------------
132
133 * Create svn `trunk/branches/tags`_ repository layouts for bundles and
134   products::
135
136     somewhere/bundles
137       AppA
138         trunk       dev bundle with svn:externals that point to products
139         branches    branches created to patch a released application
140         tags        released application
141       ...
142     somewhere-else/products
143       ProdA
144         trunk
145         branches
146         tags
147       ProdB
148         trunk
149         branches
150         tags
151       ...
152
153 * See `svn:externals`_ to setup/configure your bundle.
154
155 * BundleMan intialize
156
157   - Checkout your bundle::
158
159       svn co somewhere/bundles/AppA/trunk AppA
160
161   - Initialize all products that you want to manage with BundleMan, products
162     must be in a trunk or branch. Go into the product directory and
163     run a::
164
165       bm-product --init
166
167     This will add a CHANGES, VERSION and HISTORY files to the product and
168     add a svn property named bundleman.
169
170   - Initialize the bundle from the bundle working copy by running::
171
172       bm-bundle --init
173
174     It will create a `svn-externals` file that contains the svn externals
175     definition.
176
177
178 Working on an application
179 -------------------------
180
181 * Changing bundle definition.
182
183   You should edit the `svn-externals` file to update your bundle definition,
184   then ::
185
186       svn ps svn:externals -F svn-externals .
187       svn commit -m"udpate the bundle definition" -N svn-externals .
188
189   The `svn-externals` file is usefull to have readable `svn:externals` diff
190   and to look at the bundle contents from a trac. Be sure that all
191   developpers use this file to edit the bundle definition.
192
193 * Working on a product.
194
195   When working on a product sources, in addition to your commit message, you
196   will have to fill a CHANGES file.
197
198   The content of this file is the changes between the current dev and the
199   last product release.
200
201   This file contains 4 sections:
202
203       - Requires: things that must be done to use or install this new release.
204
205       - New features: list of new features, customer oriented.
206
207       - Bug fixes: list of bug fix.
208
209       - New internal features: list of new features, devel oriented.
210
211   CHANGES exemple::
212
213        Requires
214        ~~~~~~~~
215        - ProdC > 1.2.3
216        New features
217        ~~~~~~~~~~~~
218        - Enable customer ...
219        Bug fixes
220        ~~~~~~~~~
221        - fix #1234: Site error when...
222        New internal features
223        ~~~~~~~~~~~~~~~~~~~~~
224        - API Changes ...
225
226
227   Depending on the CHANGES content BundleMan will compute the new version of
228   the product.
229
230   When releasing, BundleMan will ask you to fill this file if it is empty while
231   you have commited sources since the last product release.
232
233   This file is reseted during product release and flush into an HISTORY file.
234
235   The HISTORY file is turn into a CHANGELOG.txt file in the release archive.
236
237   Product CHANGELOG.txt exemple::
238
239     ===========================================================
240     Package: ProdA 3.2.0
241     ===========================================================
242     First release built by: ben at: 2006-09-19T08:03:54
243     SVN Tag: path/to/products/ProdA/tags/3.2.0
244     Build from: path/to/products/ProdA/trunk@1234
245
246     Requires
247     ~~~~~~~~
248     - ProdC > 1.2.3
249     New features
250     ~~~~~~~~~~~~
251     - Enable customer ...
252     Bug fixes
253     ~~~~~~~~~
254     - fix #1234: Site error when ...
255     New internal features
256     ~~~~~~~~~~~~~~~~~~~~~
257     - API Changes ...
258
259     ===========================================================
260     Package: ProdA 3.1.0
261     ===========================================================
262     First release built by: ben at: 2006-09-17T18:03:41
263     SVN Tag: path/to/products/ProdA/tags/3.1.0
264     Build from: path/to/products/ProdA/trunk@1123
265
266     Requires
267     ~~~~~~~~
268     ....
269
270
271
272 Releasing an application
273 ------------------------
274
275 On a working copy of the trunk bundle
276
277 * Check the status of your working copy::
278
279     $ bm-bundle
280     INFO: List of actions to do:
281     ProdA                   3.2.0-1             Requires a svn update/commit.
282     ProdB                   1.0.0-1             New version: 1.1.0-1
283     ProdC                   2.0.0-1             CHANGES file must be filled !.
284     WARNING: Bundle not ready to be released.
285
286   Running `bm-bundle` without option is purely introspective.
287
288
289 * Depending on the status you may need to fill product's CHANGES file,
290   commit locally modified or svn update products.
291   Re run bm-bundle until the status is 'Ready'::
292
293     $ bm-bundle
294     INFO: List of actions to do:
295     ProdB                   1.0.0-1             New version: 1.1.0-1
296     ProdC                   2.0.0-1             Nex version: 2.0.1-1
297     INFO: Ready:  Going to release some products.
298
299 * Release the application::
300
301      $ bm-bundle --release=APPA-2006-rc1
302      INFO: Analyze all products ...
303      INFO: Tag product ProdB version 1.1.0-1
304      INFO: Tag path/to/products/ProdB/tags/1.1.0 done.
305      ....
306      INFO: Create a bundle tag APPA-2006-rc1
307      INFO: Analyze all products ...
308      INFO: Creating bundle path/to/bundles/AppA/tags/APPA-2006-rc1
309
310   Note that in addition to the new bundle tags, it created releases for
311   ProdB and ProdC products.
312
313 * Create a CHANGELOG of the application since the previous release APPA-2005::
314
315      $ bm-bundle --changelog APPA-2005:APPA-2006-rc1 > CHANGELOG.txt
316
317   You can edit, add and commit this file to the APPA-2006-rc1 tag.
318
319 * Create a tarball archive::
320
321      $ bm-bundle --archive APPA-2006-rc1 -o /tmp/
322      INFO: Analyze all products ...
323      INFO: Creating archive: APPA-2006-rc1.tgz
324      INFO: Archive: /tmp/APPA-2006-rc1.tgz
325
326   In this archive you will have a `version.txt` for the bundle (with
327   'APPA-2006-rc1' content) and for each products.
328
329
330 Patching a release
331 ------------------
332
333 You want to patch the APPA-2006-rc1 to release the rc2.
334
335 From a working copy of he trunk bundle
336
337 * Create a bundle branch::
338
339      $ bm-bundle --branch=APPA-2006-rc1
340      INFO: Branching path/to/bundles/app/tags/APPA-2006-rc1 -> path/to/bundles/app/branches/APPA-2006-rc1 hash_tag: rel1058079549.
341      INFO: Creating bundle path/to/bundles/AppA/branches/APPA-2006-rc1
342
343   This will create a branch for each versioned products and create a new
344   bundle in `bundles/AppA/branches`.
345
346   Note that the product branch is created using a hash of the RELEASE_TAG
347   because it hides the RELEASE_TAG in the case of a private bundle that uses
348   public products. This means that you will not have 'MYSECRETPROJECTrc1'
349   tag in a a product that is on a public svn.
350
351 * Either switch to the branch::
352
353      svn switch path/to/bundles/app/branches/APPA-2006-rc1
354
355   or checkout the new bundle branch::
356
357     svn co path/to/bundles/app/branches/APPA-2006-rc1
358
359 * Commit the fixes and update CHANGES in the different products
360
361 * Release:
362
363    - Check the status::
364
365        $ bm-bundle
366        INFO: List of actions to do:
367        ProdA          3.2.1-1              New version: 3.2.2-rel1058079549-1
368        INFO: Ready: Going to release some products.
369
370    - Depending on the status you may need to fill product's CHANGES file,
371      commit locally modified or svn update products.
372
373    - Release::
374
375          $ bm-bundle --release APPA-2006-rc2
376          INFO: Analyze all products ...
377          INFO: Tag product ProdA version 3.2.2-rel1058079549-1
378          INFO: Tag path/to/products/foo/tags/3.2.2-rel1058079549 done.
379          ProdB                       1.1.0-1              Already released.
380          ProdC                       2.0.1-1              Already released.
381          INFO: Create a bundle tag APPA-2006-rc2
382          INFO: Analyze all products ...
383          INFO: Creating bundle path/to/bundles/AppA/tags/APPA-2006-rc2
384
385     Note that ProdA is released with the version 3.2.2-rel1058079549-1, the
386     release tag may change for a same target release like (APPA-2006-beta,
387     APPA-2006-rc1 ...rc2 and final), using a hash we will not have a weird
388     APPA-2006-rc1 tag in the final APPA-2006 bundle.
389
390 * You can keep this branch to patch APPA-2006-rc2 and create the final
391   APPA-2006.
392
393 * Merge your patch to the trunk: `bm-bundle --merge=APPA-2006-rc2`
394   This will merge all products from bundle/App/tags/APPA-2006-rc2 to products
395   in the bundle/AppA/trunk and switch to trunk.
396
397   **NOT YET IMPLEMENTED**
398
399 * Fix eventual conflict then commit.
400
401 That's all.
402
403
404 Product release
405 ---------------
406
407 You can release a single product using `bm-product --release`
408
409 Mutliple release
410 ----------------
411
412 You can release an AppB that shares products with AppA without any version
413 conflit.
414
415
416 Verifying a package installation
417 --------------------------------
418
419 When creating an archive BundleMan adds a MD5SUMS file, so you can check that
420 a tarball installation is valid::
421
422   cd path/to/app
423   md5sum -c MD5SUMS && echo "Package verified successfully"
424
425 *Note that md5sum will not complain about new files.*
426
427
428 BundleMan commands
429 ==================
430
431 There is only 2 commands provided by BundleMan, bm-product to manage a product
432 and bm-bundle to manage the bundle (ie the application).
433
434 Default operation without options are purely introspective, zero risk.
435
436 To check what BundleMan is doing you can use the debug option `--debug` or
437 look into the log file `/tmp/bundleman.log`.
438
439
440
441 bm-product
442 ----------
443
444 Usage
445 ~~~~~
446 ::
447
448     bm-product [options] [WCPATH]
449
450     bm-product is a product release manager. See BundleMan documentation for more
451     information.
452
453     WCPATH is a svn working copy of a product.
454
455     Product follows the classic trunk/tags/branches svn tree.
456
457     Product is versioned using 3 files:
458
459     * CHANGES (not present in an archive) this file contains 4 sections:
460       - Requires: things that must be done to install this new release.
461       - New features: list of new features customer oriented.
462       - Bug fixes: list of bug fix.
463       - New internal features: list of new features devel oriented.
464       This file *MUST* be filled during devel of the product.
465       This file is reseted during product release.
466
467     * VERSION: (or version.txt in an archive) this file contains the product name,
468       product version and release number. The version format is
469       MAJOR.MINOR.BUGFIX[-branch_name].
470
471       A new version is automaticly computed using the content of the CHANGES file
472       with the following rules:
473
474        - If there is *ONLY* bug fixes increment the BUGFIX number else increment the
475          MINOR number.
476
477        - If the svn url is a branch append the branch name to the version.
478
479     * HISTORY (or CHANGELOG.txt in an archive)
480       This file contains the concatenation of all CHANGES.
481
482 Exemples
483 ~~~~~~~~
484 ::
485
486       bm-product
487                     Display status and action to be done for WCPATH.
488
489       bm-product --init
490                     Initialize the WCPATH product:
491                     * Check that the WCPATH point to a trunk svn url.
492                     * Check that tags and branches svn url exists.
493                     * If missing prompt the user to add VERSION, CHANGES
494                     and HISTORY files to the product working copy and
495                     commit them.
496
497       bm-product --release
498                    Release the WCPATH product:
499                    * Analyse the working copy:
500
501                       - Checks that WCPATH is up to date with the svn.
502                       - Parses the CHANGES file and computes the new version
503                       - If CHANGES is empty checks the that there is no diff
504                         between the WCPATH and the tagged version.
505
506                    * Create a tag using WCPATH svn revision: tags/VERSION
507                    * Fush CHANGES into HISTORY, update VERSION files and commit,
508                      in the tag and the WCPATH url.
509
510       bm-product --archive -o /tmp
511                    Create a tarball archive in the /tmp directory. The product must
512                    be released. The tarball contains a MD5SUMS file and can be
513                    verified using `md5sum -c MD5SUMS`.
514
515
516 Options
517 ~~~~~~~
518 ::
519
520     --version               show program's version number and exit
521     --help, -h              show this help message and exit
522     --status, -s            Show status and action to be done for WCPATH.
523     --init                  Initialize the WCPATH product.
524     --release               Release the product WCPATH.
525     --major                 Increment the MAJOR number instead of the MINOR number
526                             of the version.
527     --again                 Rebuild the same version, increment the release
528                             number.
529     --archive, -a           Build a targz archive.
530     --output-directory=OUTPUT_DIR, -o OUTPUT_DIR
531                             Directory to store the archive.
532     --force, -f             No prompt during --init. Replaces an existing tag
533                             during --release. Release even with locally modified
534                             files.
535     --verbose, -v           Verbose output
536     --debug, -d             Debug output
537
538
539 bm-bundle
540 ---------
541
542
543 Usage
544 ~~~~~
545 ::
546
547   bm-bundle [options] [WCPATH]
548
549   bm-bundle is a bundle release manager. See BundleMan documentation for
550   more information.
551
552   WCPATH is a svn working copy path of a bundle, using current path if not
553   specified.
554
555   A bundle is an suite of products, this suites is defined using
556   svn:externals property of the bundle folder.
557
558   A bundle follows the classic trunk/tags/branches svn tree.
559
560   Products may be versionned using bm-product tool.
561
562 Examples
563 ~~~~~~~~
564 ::
565
566   bm-bundle
567                         Display status and action to be done.
568
569   bm-bundle --init
570                         Initialize WCPATH bundle by adding svn-externals
571                         file to trunk
572
573   bm-bundle --release APPrc1
574                         Create release bundle in tags/APPrc1 that point to
575                         released products.
576
577   bm-bundle --release APPrc1 -a
578                         Create a release and a targz archive in one step.
579
580   bm-bundle --archive APPrc1 -o /tmp
581                         Create a targz archive in /tmp directory.
582                         The tarball contains a MD5SUMS file and can be
583                         verified using `md5sum -c MD5SUMS`.
584
585   bm-bundle --archive APPrc1 --archive-root-directory Products
586                         Create a targz archive of APPrc1 release with a root
587                         folder named Products.
588
589   bm-bundle --branch APPrc1
590                         Create a branch bundle in branch/APPrc1 that point to
591                         branched products.
592                         A product branch will be created for each versioned
593                         products. The branch name use a hash(APPrc1) key.
594
595   bm-bundle --changelog APPrc1:APPrc2
596                         Output a global bundle changelog between bundle tags.
597
598   bm-bundle --release APPrc2 --changelog APPrc1: -a -o /tmp --scp bar:/tmp
599                         Create a release with a global changelog, build
600                         the targz archive, scp it to bar:/tmp in one step.
601
602
603 Options
604 ~~~~~~~
605 ::
606
607   --version               show program's version number and exit
608   --help, -h              show this help message and exit
609   --status, -s            Show action to be done.
610   --init, -i              Initialize the bundle working copy.
611   --release=RELEASE_TAG   Release the bundle.
612   -a                      Build a tar gz archive, must be used with --release
613                           option.
614   --archive=RELEASE_TAG   Build a tar gz archive from an existing RELEASE_TAG.
615   --archive-root-directory=ARCHIVE_ROOT
616                           The name of the root directory in the archive, default
617                           is RELEASE_TAG.
618   --output-directory=OUTPUT_DIR, -o OUTPUT_DIR
619                           Directory to store the archive.
620   --scp=REMOTE_PATH       scp the archive to a REMOTE_PATH.
621   --branch=RELEASE_TAG    Branch the bundle release.
622   --changelog=TAG1:TAG2   Output a changelog between 2 bundle tags. If TAG2 is
623                           missing it uses the RELEASE_TAG.
624   --changelog-url=TAG1_URL:TAG2_URL
625                           Output a changelog between 2 bundle url tags.
626   --force, -f             No prompt during --init.
627   --log-file=LOG_FILE, -l LOG_FILE
628                           The log file path. Default is ~/bundleman.log.
629   --verbose, -v           Verbose output
630   --debug, -d             Debug output
631
632
633 .. _INSTALL: INSTALL.html
634 .. _CHANGES: CHANGES.html
635 .. _API: api/index.html
636 .. _BundleMan: http://public.dev.nuxeo.com/~ben/bundleman/
637 .. _epydoc: http://epydoc.sourceforge.net/
638 .. _`Cheese Shop`: http://www.python.org/pypi/bundleman/
639 .. _`svn:externals`: http://svnbook.red-bean.com/en/1.2/svn.advanced.externals.html
640 .. _subversion: http://subversion.tigris.org/
641 .. _`trunk/branches/tags`: http://svnbook.red-bean.com/en/1.2/svn.branchmerge.maint.html#svn.branchmerge.maint.layout
642 .. _`GNU GPL`: http://www.gnu.org/licenses/licenses.html
643
644
645 .. Local Variables:
646 .. mode: rst
647 .. End:
648 .. vim: set filetype=rst:
Note: See TracBrowser for help on using the browser.