Move tools to release-tools

Move highest_semver.py, list_oslo_projects.py, and
list_unreleased_changes.sh to openstack-infra/release-tools where they
are more reusable.

Change-Id: I5f44d848080db5cd1f3a52d7ae6df5b670bc32f0
This commit is contained in:
Doug Hellmann 2015-04-30 21:10:19 +00:00
parent ebe7e3629e
commit 3996c3aec4
3 changed files with 0 additions and 154 deletions

View File

@ -1,57 +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.
"""Read a list of version tags from stdin and pick the one with the
highest semver value.
"""
from __future__ import print_function
import fileinput
import sys
def try_int(val):
try:
return int(val)
except ValueError:
return val
tags = []
for line in fileinput.input(sys.argv[1:]):
line = line.strip()
if not line:
continue
parts = line.split('.')
v = tuple(try_int(val) for val in parts)
if len(v) == 3:
v = v + ('zzz',) # artifically sort the value higher than alphas
# Ignore versions where the beginning doesn't look like a number,
# such as 'havana-eol'
if not isinstance(v[0], int):
continue
# Ignore date-based entries
if v[0] > 100:
continue
tags.append(v)
if tags:
# We only want to print something if we actually have any tags to
# pick from. Otherwise we probably have a library that has never
# been released, so there is no valid version.
version = max(tags)
if version[-1] == 'zzz':
version = version[:-1]
print('.'.join(str(t) for t in version))

View File

@ -1,45 +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.
"""Print a list of the oslo project repository names.
"""
from __future__ import print_function
import os
import oslo_tool_config as cfg
import yaml
def main():
conf = cfg.get_config_parser()
cfg.parse_arguments(conf)
gov_repo = os.path.expanduser(os.path.join(conf.repo_root,
'openstack/governance'))
project_input = os.path.join(gov_repo, 'reference/projects.yaml')
with open(project_input, 'r') as f:
project = yaml.load(f.read())
repos = [p['repo'] for p in project['Oslo']['projects']]
for r in sorted(repos):
print(r)
if __name__ == '__main__':
import sys
sys.exit(main())

View File

@ -1,52 +0,0 @@
#!/bin/bash
#
# 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.
#
# Provide a list of the unreleased changes in the oslo libraries.
bindir=$(cd $(dirname $0) && pwd)
repodir=$(cd $bindir/../../.. && pwd)
release_tools=$repodir/openstack-infra/release-tools
# Make sure no pager is configured so the output is not blocked
export PAGER=
if [ -z "$*" ]
then
libs=$($bindir/list_oslo_projects.py | egrep -v -e '(oslo-specs|cookiecutter|incubator)')
else
libs="$*"
fi
function get_last_tag {
git for-each-ref --sort=taggerdate --format '%(refname)' refs/tags \
| sed -e 's|refs/tags/||' \
| ${bindir}/highest_semver.py
}
# Show the unreleased changes for each library.
for lib in $libs
do
echo
cd $repodir/$lib
prev_tag=$(get_last_tag)
if [ -z "$prev_tag" ]
then
echo "$lib has not yet been released"
else
$release_tools/release_notes.py \
--show-dates \
--changes-only \
$repodir/$lib $prev_tag origin/master
fi
done