root/build-tools/branching
Scott Little d06b9aa763 Branch and tag tools converted from wrgit to repo
Update branching and tagging tools, used by patching, to do things
the 'repo' way.  Repo has replaced wrgit.

This is complicated by ...

1) Not all repos are under our control, and so can't be branched or
tagged by us.  The tools now accepts arguments that list 'remotes' or
'projects' to which branches or tags are to be applied

2) The manifest requires an update to reference the new branch or tag
as it applies to affected projects.  Non-affected projects can
optionally be locked down by converting the revision to a sha.
The tools must now try to generate that manifest.  It might be
sub-optimal.  i.e. a revision is explicitly added to each project,
rather than using the 'default' mechanism.  Perhaps something to address
in a future update.

ORIGINATING_BRANCH=master
ORIGINATING_BUILD=20200220T023000Z
NEW_BRANCH=r/stx.4.0
STX_REMOTES="starlingx"

repo init -u https://opendev.org/starlingx/manifest -b $ORIGINATING_BRANCH
repo sync --force-sync

curl http://mirror.starlingx.cengn.ca/mirror/starlingx/${ORIGINATING_BRANCH}/centos/${ORIGINATING_BUILD}/outputs/CONTEXT.sh > ${ORIGINATING_BUILD}.context

source ${ORIGINATING_BUILD}.context
create_branches_and_tags.sh --branch=$NEW_BRANCH --remotes=$STX_REMOTES --manifest --lockdown
push_branches_tags.sh --branch=$NEW_BRANCH --remotes=$STX_REMOTES --manifest

ORIGINATING_BRANCH=r/stx.4.0
ORIGINATING_BUILD=20200220T023000Z
NEW_STX_TAG=4.0.0
NEW_GIT_HUB_TAG=stx.4.0.0
STX_REMOTES="starlingx"
GIT_HUB_REMOTES="stx-staging"

repo init -u https://opendev.org/starlingx/manifest -b $ORIGINATING_BRANCH
repo sync --force-sync

curl http://mirror.starlingx.cengn.ca/mirror/starlingx/${ORIGINATING_BRANCH}/centos/${ORIGINATING_BUILD}/outputs/CONTEXT.sh > ${ORIGINATING_BUILD}.context

source ${ORIGINATING_BUILD}.context
TAG=TEST_19.10_PATCH_0000
create_tags.sh --tag=$NEW_STX_TAG --remotes=$STX_REMOTES,$GIT_HUB_REMOTES --manifest --manifest-prefix=stx. --lock-down
create_tags.sh --tag=$NEW_GIT_HUB_TAG --remotes=$GIT_HUB_REMOTES
push_tags.sh --tag=$NEW_STX_TAG --remotes=$STX_REMOTES
push_tags.sh --tag=$NEW_GIT_HUB_TAG --remotes=$STX_REMOTES
cd .repo/manifests
git mv $TAG-default.xml stx.$TAG.xml

vi stx.$TAG.xml
   # set revision for all stx-staging projects to refs/tags/stx.4.0.0
   <project remote="stx-staging" ... revision="refs/tags/stx.4.0.0" .

vi stx.$TAG.xml
   # set default revision
   <default remote="starlingx" revision="refs/tags/4.0.0"/>

   # delete 'revision' for all starlingx projects

git add stx.$TAG.xml
git commit -s --amend
    # set title to
    Locked down manifest for StarlingX $TAG

git tag -d $TAG
git review
git tag -s -m "Tag $TAG" $TAG
git push gerrit $TAG

Change-Id: I5ac0c3e44ffda262edb416e877d46c9036cd6e92
Signed-off-by: Scott Little <scott.little@windriver.com>
2020-04-03 17:02:38 -04:00
..
create_branches_and_tags.sh Branch and tag tools converted from wrgit to repo 2020-04-03 17:02:38 -04:00
create_tags.sh Branch and tag tools converted from wrgit to repo 2020-04-03 17:02:38 -04:00
push_branches_tags.sh Branch and tag tools converted from wrgit to repo 2020-04-03 17:02:38 -04:00
push_tags.sh Branch and tag tools converted from wrgit to repo 2020-04-03 17:02:38 -04:00