tools/release
Dean Troyer 8dc7f193ef Add release scripts build-context.py and branch-repo.sh
These scripts replace the earlier branch-stx.sh and getrepo.sh
and are more generally useful in that the assumptions regarding
branch and tag naming have all been removed.

build-context.py pulls repo information from a manifest file
and optionally adds the specific context SHAs from the build
output script CONTEXT.sh.  By default it processes all repos
from the all remotes in the manifest.  Use --remote to select
one or more remotes (repeat option for more than one remote).

The result can be fed into branch-repo.sh to create new branches
and/or tags corresponding to a specific build context.

For example, to fetch only the starlingx remote repos:
release/build-context.py \
    --remote starlingx \
    --context http://mirror.starlingx.cengn.ca/mirror/starlingx/master/centos/latest_green_build/outputs/CONTEXT.sh \
    https://opendev.org/starlingx/manifest/raw/branch/master/default.xml | \
release/branch-repo.sh -b r/stx.2.0 -t v2.0.0.rc0

branch-repo.sh makes a number of small assumption changes from branch-stx.sh
in the branch_repo() function.  It corrects a stray merge commit being introduced
when attempting to only tag a branch that has not been pushed to the origin
yet.  This might occur during a series of local tests using --dry-run.
It also allows passing in a path value rather than just assuming the
repo name.

Change-Id: I3d6a510cc2c37d10c468ac273178b3bad8e42c01
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-08-07 17:32:05 -05:00
..
README.rst Add release scripts build-context.py and branch-repo.sh 2019-08-07 17:32:05 -05:00
branch-repo.sh Add release scripts build-context.py and branch-repo.sh 2019-08-07 17:32:05 -05:00
branch-stx.sh Remove default value of TAG from branch-stx.sh 2019-02-27 14:57:30 -06:00
build-context.py Add release scripts build-context.py and branch-repo.sh 2019-08-07 17:32:05 -05:00
getrepo.sh Add release tools 2018-07-19 17:51:24 -05:00

README.rst

Release Tools

A set of tools used in the StarlingX release process past, current and future...

branch-repo.sh - Derived from the older branch-stx.sh to support reading a list of repos, paths and SHAs from stdin, usually the output of build-context.py. This simplifies the creation of branching based on a specific build using the CONTEXT.sh file generated by the build system.

build-context.py - Takes a manifest file and an optional CONTEXT.sh file to produce a list of repositories and their paths and SHAs that represent a specific build. This can be fed directly into branch-repo.sh to create branches corresponding to that specific build. (This is in Python completely due to combining XML and the joys of dict-like manipulation in shell.)

Examples

Here is an example of creating a new branch named 'r/stx.2.0' and tag 'v2.0.0.rc0' from the lastest green build context at the time:

release/build-context.py \
    --remote starlingx \
    --context http://mirror.starlingx.cengn.ca/mirror/starlingx/master/centos/latest_green_build/outputs/CONTEXT.sh \
    https://opendev.org/starlingx/manifest/raw/branch/master/default.xml | \
release/branch-repo.sh -b r/stx.2.0 -t v2.0.0.rc0

Older Scripts

branch-stx.sh - Shell script previously used to create release and milestone branches. This has a number of assumptions baked in regarding branch and tag names.

get-repo.sh - Called from branch-stx.sh to read the XML manifest and extract repo names from specific remotes. This has totally been absorbed into build-context.py.