remove branching scripts

These scripts are in
openstack-infra/project-config/jenkins/scripts/release-tools now.

Change-Id: I43bb89145a0e29eccf6624335926a044b1ffe009
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-02-08 15:50:15 -05:00
parent a5497966d7
commit aa79878777
6 changed files with 0 additions and 333 deletions

View File

@ -225,49 +225,6 @@ the change but leaving out the email message boilerplate. This mode
is useful for examining the list of unreleased changes in a project
to decide if a release is warranted and to pick a version number.
make_stable_branch.sh
---------------------
This script makes a stable branch from an existing tag and updates the
.gitreview file in the new branch for future submissions.
::
./make_stable_branch.sh kilo openstack/oslo.config 1.9.2
batch-stable-branches
---------------------
This command generates a series of calls to make_stable_branch.sh
using the governance repository and releases repository as inputs.
::
batch-stable-branches --tag type:library --tag release:has-stable-branches --tag release:managed -r ~/repos/openstack/releases mitaka
branch_from_yaml.sh
-------------------
This script looks at the deliverable files to decide how to create
stable branches.
::
$ branch_from_yaml.sh ~/repos/openstack/releases mitaka
$ branch_from_yaml.sh ~/repos/openstack/releases mitaka
$ branch_from_yaml.sh ~/repos/openstack/releases mitaka deliverables/_independent/openstack-ansible.yaml
make_feature_branch.sh
----------------------
Feature branches need to have "feature/" at the beginning of the name
and should have their ``.gitreview`` updated when the branch is
created.
::
./make_feature_branch.sh keystoneauth_integration python-keystoneclient 4776495adfadbf5240a9e0f169990ce139af9549
latest-deliverable-versions
---------------------------
@ -278,16 +235,6 @@ file associated with that repo.
latest-deliverable-versions -r ~/repos/openstack/releases mitaka
update_git_review.sh
--------------------
Update the .gitreview file in a specific branch of a checked out
repositories.
::
./update_git_review.sh stable/kilo ~/repos/openstack/oslo.*
launchpad-login
---------------

View File

@ -1,55 +0,0 @@
#!/bin/bash
#
# Script to create driverfixes/foo branch of a repository
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
set -e
if [[ $# -lt 3 ]]; then
echo "Usage: $0 branch-name reponame SHA"
echo
echo "Example: $0 mitaka openstack/cinder 4776495adfadbf5240a9e0f169990ce139af9549"
exit 2
fi
TOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $TOOLSDIR/functions
SERIES=$1
REPO=$2
VERSION=$3
LPROJECT="$PROJECT"
NEW_BRANCH="driverfixes/$(echo $SERIES | sed -e 's|^driverfixes/||')"
setup_temp_space driverfixes-branch-$PROJECT
clone_repo $REPO
cd $REPO
LANG=C git review -s
if $(git branch -r | grep $NEW_BRANCH > /dev/null); then
echo "A $NEW_BRANCH branch already exists !"
cd ../..
rm -rf $MYTMPDIR
exit 1
fi
title "Creating $NEW_BRANCH from $VERSION"
git branch $NEW_BRANCH $VERSION
REALSHA=`git show-ref -s $NEW_BRANCH`
git push gerrit $NEW_BRANCH
update_gitreview "$NEW_BRANCH"

View File

@ -1,57 +0,0 @@
#!/bin/bash
#
# Script to create feature/foo branch of a repository
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
set -e
if [[ $# -lt 3 ]]; then
echo "Usage: $0 branch-name projectname SHA"
echo
echo "Example: $0 keystoneauth_integration python-keystoneclient 4776495adfadbf5240a9e0f169990ce139af9549"
exit 2
fi
TOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $TOOLSDIR/functions
FEATURE=$1
PROJECT=$2
VERSION=$3
LPROJECT="$PROJECT"
REPO=$(lp_project_to_repo $PROJECT)
NEW_BRANCH="feature/$(echo $FEATURE | sed -e 's|^feature/||')"
setup_temp_space feature-branch-$PROJECT
clone_repo openstack/$REPO
cd openstack/$REPO
LANG=C git review -s
if $(git branch -r | grep $NEW_BRANCH > /dev/null); then
echo "A $NEW_BRANCH branch already exists !"
cd ../..
rm -rf $MYTMPDIR
exit 1
fi
title "Creating $NEW_BRANCH from $VERSION"
git branch $NEW_BRANCH $VERSION
REALSHA=`git show-ref -s $NEW_BRANCH`
git push gerrit $NEW_BRANCH
update_gitreview "$NEW_BRANCH"

View File

@ -1,110 +0,0 @@
#!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Generate the commands to create stable branches for a bunch of projects.
"""
from __future__ import print_function
import argparse
import glob
import os.path
from releasetools import governance
import yaml
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'--project-list',
default=governance.PROJECTS_LIST,
help='a URL pointing to a projects.yaml file, defaults to %(default)s',
)
parser.add_argument(
'--releases-repo', '-r',
default='.',
help='path to the releases repository for automatic scanning',
)
parser.add_argument(
'--team',
help='the name of the project team, such as "Nova" or "Oslo"',
)
parser.add_argument(
'--tag',
action='append',
default=[],
help='the name of a tag, such as "release:managed"',
)
parser.add_argument(
'--verbose', '-v',
action='store_true',
default=False,
help='produce detailed output',
)
parser.add_argument(
'series',
help='the name of the release series to work on'
)
args = parser.parse_args()
team_data = governance.get_team_data()
if args.verbose:
print('# Filtering on team: {}'.format(args.team))
print('# Filtering on tags: {}'.format(args.tag))
filtered_repos = {
r.name
for r in governance.get_repositories(team_data=team_data,
team_name=args.team,
tags=args.tag,
code_only=True)
}
pattern = os.path.join(args.releases_repo, 'deliverables',
args.series, '*.yaml')
deliverable_files = sorted(glob.glob(pattern))
for filename in deliverable_files:
if args.verbose:
print('\n# {}'.format(filename))
with open(filename, 'r') as f:
deliverable_data = yaml.safe_load(f)
releases = deliverable_data.get('releases')
if not releases:
if args.verbose:
print('# no releases')
continue
latest_release = releases[-1]
projects = latest_release.get('projects')
if not projects:
if args.verbose:
print('# no projects')
continue
for project in projects:
repo = project['repo']
if repo in filtered_repos:
print('make_stable_branch.sh {series} {repo} {version}'.format(
series=args.series,
repo=repo,
version=latest_release['version'],
))
elif args.verbose:
print('# {} does not match search criteria'.format(repo))
return 0
if __name__ == '__main__':
main()

View File

@ -34,7 +34,6 @@ console_scripts =
milestone-checkup = releasetools.cmds.milestone_checkup:main
launchpad-login = releasetools.cmds.launchpad_login:main
send-mail = releasetools.cmds.mail:main
batch-stable-branches = releasetools.cmds.batch_create_stable_branches:main
update-reviews = releasetools.cmds.update_reviews:main
latest-deliverable-versions = releasetools.cmds.latest_deliverable_versions:main
ptl = releasetools.cmds.ptl:main

View File

@ -1,57 +0,0 @@
#!/bin/bash
#
# Update the .gitreview file in a specific branch of a checked out
# repository. Use oslo-incubator/tools/clone_openstack.sh to check out
# all of the projects under openstack/*
#
# Usage: $0 $branch <dir> [<dir>...]
NEW_BRANCH=$1
shift
dirs="$@"
set -x
function update_one {
grcontents="$(echo -n "$(cat .gitreview)")
defaultbranch=$NEW_BRANCH"
echo "$grcontents" > .gitreview
git add .gitreview
git commit -m "Update .gitreview for $NEW_BRANCH"
git show
git review
}
restore=$(pwd)
for d in $dirs; do
# Reset the working directory, in case the logic below was
# shortcut.
cd $restore
cd $d
echo $d
# Make sure the repository is current
git checkout master
git remote update
# Only update the branch if the origin version exists
if ! $(git branch -r | grep -q "origin/$NEW_BRANCH")
then
echo "No origin/$NEW_BRANCH for $(pwd)"
continue
fi
# Create a local branch if none exists
if ! $(git branch -r | grep -q " $NEW_BRANCH")
then
git branch $NEW_BRANCH origin/$NEW_BRANCH
fi
git checkout $NEW_BRANCH || continue
if ! $(grep -q "defaultbranch=$NEW_BRANCH" .gitreview)
then
update_one
fi
done