mirror of https://github.com/ansible/ansible.git
2.6 changelog gen/version/root dir cleanup (#40421)
* patched in changelog gen stuff from stable-2.5 * Makefile updates * release.py as single-source-of-truth * Remove obsolete ansible-core-sitemap.xml file. * Move ROADMAP.rst into README.rst. * dynamic rpm changelog, zap old deb/rpm changelogs * fix changelog in MANIFEST.in * Remove obsolete hacking/update.sh script. * Remove ref to deleted authors script. * Remove ref to removed module-formatter script. * Update headings to match script names. * MANIFEST.in cleanup * removed RELEASES.txt and versions.yml * removed obsolete release generation playbook/bits (not used since 2.5) * misc Makefile cleanup * speculative changes to DEB versioning * allow override of DEB_VERSION/DEB_RELEASEpull/39930/head
parent
eb818df1ec
commit
e4edb2842a
File diff suppressed because it is too large
Load Diff
@ -1,88 +0,0 @@
|
|||||||
Ansible Releases at a Glance
|
|
||||||
============================
|
|
||||||
|
|
||||||
VERSION RELEASE CODE NAME
|
|
||||||
++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
2.5.0 TBD "Kashmir"
|
|
||||||
2.4.3 01-31.2018 "Dancing Days"
|
|
||||||
2.4.2 11-29-2017 "Dancing Days"
|
|
||||||
2.4.1 10-25-2017 "Dancing Days"
|
|
||||||
2.4.0 09-19-2017 "Dancing Days"
|
|
||||||
2.3.2 2017-08-04 "Ramble On"
|
|
||||||
2.3.1 2017-06-01 "Ramble On"
|
|
||||||
2.3.0 2017-04-12 "Ramble On"
|
|
||||||
2.2.3 2017-05-09 "The Battle of Evermore"
|
|
||||||
2.2.2 2017-03-27 "The Battle of Evermore"
|
|
||||||
2.2.1 2017-01-16 "The Battle of Evermore"
|
|
||||||
2.2.0 2016-11-01 "The Battle of Evermore"
|
|
||||||
2.1.6 2017-06-01 "The Song Remains the Same"
|
|
||||||
2.1.5 2017-03-27 "The Song Remains the Same"
|
|
||||||
2.1.4 2017-01-16 "The Song Remains the Same"
|
|
||||||
2.1.3 2016-11-04 "The Song Remains the Same"
|
|
||||||
2.1.2 2016-09-29 "The Song Remains the Same"
|
|
||||||
2.1.1 2016-07-28 "The Song Remains the Same"
|
|
||||||
2.1.0 2016-05-25 "The Song Remains the Same"
|
|
||||||
2.0.2 2016-04-19 "Over the Hills and Far Away"
|
|
||||||
2.0.1 2016-02-24 "Over the Hills and Far Away"
|
|
||||||
2.0.0 2016-01-12 "Over the Hills and Far Away"
|
|
||||||
1.9.6 2016-04-15 "Dancing In the Streets"
|
|
||||||
1.9.5 2016-03-21 "Dancing In the Streets"
|
|
||||||
1.9.4 2015-10-09 "Dancing In the Streets"
|
|
||||||
1.9.3 2015-09-03 "Dancing In the Streets"
|
|
||||||
1.9.2 2015-06-24 "Dancing In the Streets"
|
|
||||||
1.9.1 2015-04-27 "Dancing In the Streets"
|
|
||||||
1.9.0 2015-03-25 "Dancing In the Streets"
|
|
||||||
1.8.4 2015-02-19 "You Really Got Me"
|
|
||||||
1.8.3 2015-02-17 "You Really Got Me"
|
|
||||||
1.8.2 2014-12-04 "You Really Got Me"
|
|
||||||
1.8.1 2014-11-26 "You Really Got Me"
|
|
||||||
1.8.0 2014-11-25 "You Really Got Me"
|
|
||||||
1.7.2 2014-09-24 "Summer Nights"
|
|
||||||
1.7.1 2014-08-14 "Summer Nights"
|
|
||||||
1.7.0 2014-08-06 "Summer Nights"
|
|
||||||
1.6.10 2014-07-25 "The Cradle Will Rock"
|
|
||||||
1.6.9 2014-07-24 "The Cradle Will Rock"
|
|
||||||
1.6.8 2014-07-22 "The Cradle Will Rock"
|
|
||||||
1.6.7 2014-07-21 "The Cradle Will Rock"
|
|
||||||
1.6.6 2014-07-01 "The Cradle Will Rock"
|
|
||||||
1.6.5 2014-06-25 "The Cradle Will Rock"
|
|
||||||
1.6.4 2014-06-25 "The Cradle Will Rock"
|
|
||||||
1.6.3 2014-06-09 "The Cradle Will Rock"
|
|
||||||
1.6.2 2014-05-23 "The Cradle Will Rock"
|
|
||||||
1.6.1 2014-05-07 "The Cradle Will Rock"
|
|
||||||
1.6.0 2014-05-05 "The Cradle Will Rock"
|
|
||||||
1.5.5 2014-04-18 "Love Walks In"
|
|
||||||
1.5.4 2014-04-01 "Love Walks In"
|
|
||||||
1.5.3 2014-03-13 "Love Walks In"
|
|
||||||
1.5.2 2014-03-11 "Love Walks In"
|
|
||||||
1.5.1 2014-03-10 "Love Walks In"
|
|
||||||
1.5.0 2014-02-28 "Love Walks In"
|
|
||||||
1.4.5 2014-02-12 "Could This Be Magic?"
|
|
||||||
1.4.4 2014-01-06 "Could This Be Magic?"
|
|
||||||
1.4.3 2013-12-20 "Could This Be Magic?"
|
|
||||||
1.4.2 2013-12-18 "Could This Be Magic?"
|
|
||||||
1.4.1 2013-11-27 "Could This Be Magic?"
|
|
||||||
1.4.0 2013-11-21 "Could This Be Magic?"
|
|
||||||
1.3.4 2013-10-29 "Top of the World"
|
|
||||||
1.3.3 2013-10-09 "Top of the World"
|
|
||||||
1.3.2 2013-09-19 "Top of the World"
|
|
||||||
1.3.1 2013-09-16 "Top of the World"
|
|
||||||
1.3.0 2013-09-13 "Top of the World"
|
|
||||||
1.2.3 2013-08-21 "Right Now"
|
|
||||||
1.2.2 2013-07-05 "Right Now"
|
|
||||||
1.2.1 2013-07-04 "Right Now"
|
|
||||||
1.2.0 2013-06-10 "Right Now"
|
|
||||||
1.1.0 2013-04-02 "Mean Street"
|
|
||||||
1.0.0 2013-02-01 "Eruption"
|
|
||||||
0.9.0 2012-11-30 "Dreams"
|
|
||||||
0.8.0 2012-10-19 "Cathedral"
|
|
||||||
0.7.0 2012-09-06 "Panama"
|
|
||||||
0.6.0 2012-08-06 "Cabo"
|
|
||||||
0.5.0 2012-07-04 "Amsterdam"
|
|
||||||
0.4.0 2012-05-23 "Unchained"
|
|
||||||
0.3.0 2012-04-23 "Baluchitherium"
|
|
||||||
0.2.0 ? "Untitled"
|
|
||||||
0.1.0 ? "Untitled"
|
|
||||||
0.0.2 ? "Untitled"
|
|
||||||
0.0.1 ? "Untitled"
|
|
@ -1,17 +0,0 @@
|
|||||||
*******************************
|
|
||||||
Roadmap For Ansible by Red Hat
|
|
||||||
*******************************
|
|
||||||
This document is now the location for published Ansible Core roadmaps.
|
|
||||||
|
|
||||||
The roadmap will be updated by version. Based on team and community feedback, an initial roadmap will be published for a major or minor version (2.0, 2.1). Subminor versions will generally not have roadmaps published.
|
|
||||||
|
|
||||||
2.1 was the first time Ansible has published this and asked for feedback in this manner. So feedback on the roadmap and the new process is quite welcome. The team is aiming for further transparency and better inclusion of both community desires and submissions.
|
|
||||||
|
|
||||||
These roadmaps are the team's *best guess* roadmaps based on the Ansible team's experience and are also based on requests and feedback from the community. There are things that may not make it on due to time constraints, lack of community maintainers, etc. And there may be things that got missed, so each roadmap is published both as an idea of what is upcoming in Ansible, and as a medium for seeking further feedback from the community. Here are the good places for you to submit feedback:
|
|
||||||
|
|
||||||
- Add to the agenda of a `Core IRC Meetings <https://github.com/ansible/community/blob/master/meetings/README.md>`_ (preferred)
|
|
||||||
- Ansible's google-group: ansible-devel
|
|
||||||
- AnsibleFest conferences.
|
|
||||||
- IRC Freenode channel: #ansible-devel (this one may have things lost in lots of conversation, so a caution).
|
|
||||||
|
|
||||||
Ansible Roadmaps can be found `here <https://docs.ansible.com/ansible/devel/roadmap/>`_.
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
release_tag_re: '(v(?:[\d.ab\-]|rc)+)'
|
||||||
|
pre_release_tag_re: '(?P<pre_release>(?:[ab]|rc)+\d*)$'
|
||||||
|
notesdir: fragments
|
||||||
|
prelude_section_name: release_summary
|
||||||
|
sections:
|
||||||
|
- ['major_changes', 'Major Changes']
|
||||||
|
- ['minor_changes', 'Minor Changes']
|
||||||
|
- ['deprecated_features', 'Deprecated Features']
|
||||||
|
- ['removed_features', 'Removed Features (previously deprecated)']
|
||||||
|
- ['new_lookup_plugins', 'New Lookup Plugins']
|
||||||
|
- ['new_callback_plugins', 'New Callback Plugins']
|
||||||
|
- ['new_connection_plugins', 'New Connection Plugins']
|
||||||
|
- ['new_test_plugins', 'New Test Plugins']
|
||||||
|
- ['new_filter_plugins', 'New Filter Plugins']
|
||||||
|
- ['new_modules', 'New Modules']
|
||||||
|
- ['bugfixes', 'Bugfixes']
|
||||||
|
- ['known_issues', 'Known Issues']
|
@ -0,0 +1 @@
|
|||||||
|
{}
|
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# script from http://stackoverflow.com/questions/12133583
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Get a list of authors ordered by number of commits
|
|
||||||
# and remove the commit count column
|
|
||||||
AUTHORS=$(git --no-pager shortlog -nse --no-merges | cut -f 2- )
|
|
||||||
if [ -z "$AUTHORS" ] ; then
|
|
||||||
echo "Authors list was empty"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Display the authors list and write it to the file
|
|
||||||
echo "$AUTHORS" | tee "$(git rev-parse --show-toplevel)/AUTHORS.TXT"
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
git pull --rebase
|
|
||||||
git submodule update --init --recursive
|
|
@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
# long version of this one liner: python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < yamltest.txt
|
|
||||||
import yaml
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
|
||||||
check_file = open(sys.argv[1])
|
|
||||||
else:
|
|
||||||
check_file = sys.stdin
|
|
||||||
|
|
||||||
try:
|
|
||||||
yaml.safe_load(check_file)
|
|
||||||
except yaml.scanner.ScannerError as e:
|
|
||||||
sys.exit('Invalid YAML:\n%s' % str(e))
|
|
||||||
|
|
||||||
print('valid YAML')
|
|
@ -1,210 +0,0 @@
|
|||||||
- hosts: localhost
|
|
||||||
gather_facts: no
|
|
||||||
vars_files:
|
|
||||||
- vars/versions.yml
|
|
||||||
vars:
|
|
||||||
release_dir: "./ansible_release"
|
|
||||||
release_date: "{{lookup('pipe', 'date +\"%m-%d-%Y\"')}}"
|
|
||||||
rpm_spec_line: |
|
|
||||||
|
|
||||||
* {{lookup('pipe', 'date +"%a %b %d %Y"')}} Ansible, Inc. <info@ansible.com> - {{ansible_release_version}}-{{ansible_release_string}}
|
|
||||||
- Release {{ansible_release_version}}-{{ansible_release_string}}
|
|
||||||
deb_changelog_line: |
|
|
||||||
|
|
||||||
ansible ({{ansible_release_version}}) unstable; urgency=low
|
|
||||||
|
|
||||||
* {{ansible_release_version}}
|
|
||||||
|
|
||||||
-- Ansible, Inc. <info@ansible.com> {{lookup('pipe', 'date -R')}}
|
|
||||||
|
|
||||||
vars_prompt:
|
|
||||||
- name: ansible_release_branch
|
|
||||||
prompt: "Enter the release branch"
|
|
||||||
private: no
|
|
||||||
- name: ansible_release_version
|
|
||||||
prompt: "Enter the release version"
|
|
||||||
private: no
|
|
||||||
- name: ansible_release_string
|
|
||||||
prompt: "Enter the release string (ie. 0.1.beta1, or just 1 for final releases)"
|
|
||||||
private: no
|
|
||||||
#- name: ansible_release_codename
|
|
||||||
# prompt: "Enter the release code name (only used if doing a final release)"
|
|
||||||
# default: ""
|
|
||||||
# private: no
|
|
||||||
- name: has_submodules
|
|
||||||
prompt: "Does this branch have git submodules?"
|
|
||||||
default: "no"
|
|
||||||
private: no
|
|
||||||
- name: is_final
|
|
||||||
prompt: "Is this a final release (not a beta/rc)?"
|
|
||||||
default: "no"
|
|
||||||
private: no
|
|
||||||
- name: do_push
|
|
||||||
prompt: "Push repositories upstream when done?"
|
|
||||||
default: "no"
|
|
||||||
private: no
|
|
||||||
tasks:
|
|
||||||
- pause:
|
|
||||||
prompt: "Has the CHANGELOG.md, versions.yml, release_and_maintenance.rst, and any other files been updated and are ready to go?"
|
|
||||||
when: is_final|bool
|
|
||||||
|
|
||||||
- name: create a combined version string from the specified values
|
|
||||||
set_fact:
|
|
||||||
new_version: "v{{ansible_release_version}}-{{ansible_release_string}}"
|
|
||||||
|
|
||||||
- name: assert certain variables are defined
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- ansible_release_branch is defined
|
|
||||||
- ansible_release_version is defined
|
|
||||||
- ansible_release_string is defined
|
|
||||||
|
|
||||||
- name: Remove ansible_release (if it exists)
|
|
||||||
file:
|
|
||||||
path: "{{release_dir}}/"
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Clone the official repo
|
|
||||||
git:
|
|
||||||
#repo: "git@github.com:ansible/ansible.git"
|
|
||||||
repo: "https://github.com/ansible/ansible.git"
|
|
||||||
dest: "{{release_dir}}"
|
|
||||||
version: "{{ansible_release_branch}}"
|
|
||||||
recursive: yes
|
|
||||||
|
|
||||||
- name: get the latest version
|
|
||||||
shell:
|
|
||||||
_raw_params: git tag | tail -1
|
|
||||||
chdir: "{{release_dir}}"
|
|
||||||
register: latest_version
|
|
||||||
|
|
||||||
- name: "assert the specified version ({{new_version}}) is greater than the latest version ({{latest_version.stdout}})"
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- new_version is version(latest_version.stdout, "gt")
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: Update the VERSION file for the main repo
|
|
||||||
copy:
|
|
||||||
dest: "{{release_dir}}/VERSION"
|
|
||||||
content: "{{ansible_release_version}} {{ansible_release_string}}\n"
|
|
||||||
|
|
||||||
- name: Update the library version
|
|
||||||
lineinfile:
|
|
||||||
dest: "{{release_dir}}/lib/ansible/release.py"
|
|
||||||
regexp: "^__version__ ="
|
|
||||||
line: "__version__ = '{{ansible_release_version}}'"
|
|
||||||
|
|
||||||
- block:
|
|
||||||
- name: Update the spec file release list
|
|
||||||
lineinfile:
|
|
||||||
dest: "{{release_dir}}/packaging/rpm/ansible.spec"
|
|
||||||
regexp: "^- Release {{ansible_release_version}}-{{ansible_release_string}}"
|
|
||||||
line: "{{rpm_spec_line.rstrip()}}"
|
|
||||||
insertafter: "^%changelog"
|
|
||||||
- name: Update the deb changelog file
|
|
||||||
lineinfile:
|
|
||||||
dest: "{{release_dir}}/packaging/debian/changelog"
|
|
||||||
regexp: "^ansible ({{ansible_release_version}})"
|
|
||||||
line: "{{deb_changelog_line}}"
|
|
||||||
insertafter: "-- Ansible, Inc. <info@ansible.com> %DATE%"
|
|
||||||
- name: Update RELEASES.txt
|
|
||||||
template:
|
|
||||||
dest: "{{release_dir}}/RELEASES.txt"
|
|
||||||
src: "templates/RELEASES.tmpl"
|
|
||||||
when: is_final|bool
|
|
||||||
|
|
||||||
- name: "Make sure modules are checked out to {{ansible_release_branch}}"
|
|
||||||
shell:
|
|
||||||
_raw_params: "git checkout {{ansible_release_branch}}"
|
|
||||||
chdir: "{{release_dir}}/lib/ansible/modules/{{item}}/"
|
|
||||||
with_items:
|
|
||||||
- core
|
|
||||||
- extras
|
|
||||||
when: has_submodules|bool
|
|
||||||
|
|
||||||
- name: Update the VERSION file for the modules
|
|
||||||
copy:
|
|
||||||
dest: "{{release_dir}}/lib/ansible/modules/{{item}}/VERSION"
|
|
||||||
content: "{{ansible_release_version}} {{ansible_release_string}}\n"
|
|
||||||
with_items:
|
|
||||||
- core
|
|
||||||
- extras
|
|
||||||
when: has_submodules|bool
|
|
||||||
|
|
||||||
- name: Add and commit the updated files for the core modules
|
|
||||||
shell:
|
|
||||||
_raw_params: "git add ./ && git commit -m 'New release {{new_version}}'"
|
|
||||||
chdir: "{{release_dir}}/lib/ansible/modules/{{item}}/"
|
|
||||||
with_items:
|
|
||||||
- core
|
|
||||||
- extras
|
|
||||||
when: has_submodules|bool
|
|
||||||
|
|
||||||
- name: Add and commit the updated files for the main repo
|
|
||||||
shell:
|
|
||||||
_raw_params: "git add ./ && git commit -m 'New release {{new_version}}'"
|
|
||||||
chdir: "{{release_dir}}/"
|
|
||||||
|
|
||||||
- name: Tag the release
|
|
||||||
shell:
|
|
||||||
_raw_params: "git tag -fa {{new_version}} -m 'New release {{new_version}}'"
|
|
||||||
chdir: "{{release_dir}}/"
|
|
||||||
|
|
||||||
- name: update git config for the main repo
|
|
||||||
lineinfile:
|
|
||||||
dest: "{{release_dir}}/.git/config"
|
|
||||||
regexp: "upstream"
|
|
||||||
line: |
|
|
||||||
[remote "upstream"]
|
|
||||||
url = git@github.com:ansible/ansible.git
|
|
||||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
||||||
|
|
||||||
- name: update git config for submodules
|
|
||||||
lineinfile:
|
|
||||||
dest: "{{release_dir}}/.git/modules/lib/ansible/modules/{{item}}/config"
|
|
||||||
regexp: "submodule_upstream"
|
|
||||||
line: |
|
|
||||||
[remote "submodule_upstream"]
|
|
||||||
url = git@github.com:ansible/ansible-modules-{{item}}.git
|
|
||||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
||||||
with_items:
|
|
||||||
- core
|
|
||||||
- extras
|
|
||||||
when: has_submodules|bool
|
|
||||||
|
|
||||||
- name: create the dist tar.gz
|
|
||||||
command:
|
|
||||||
_raw_params: make sdist
|
|
||||||
chdir: "{{release_dir}}/"
|
|
||||||
environment:
|
|
||||||
OFFICIAL: yes
|
|
||||||
|
|
||||||
- name: rename the dist tar.gz to include the full release
|
|
||||||
command:
|
|
||||||
_raw_params: "mv dist/ansible-{{ansible_release_version}}.tar.gz dist/ansible-{{ansible_release_version}}-{{ansible_release_string}}.tar.gz"
|
|
||||||
chdir: "{{release_dir}}/"
|
|
||||||
|
|
||||||
- name: generate the SHA file for the tar.gz
|
|
||||||
shell:
|
|
||||||
_raw_params: "sha256sum dist/ansible-{{ansible_release_version}}-{{ansible_release_string}}.tar.gz > dist/ansible-{{ansible_release_version}}-{{ansible_release_string}}.tar.gz.sha"
|
|
||||||
chdir: "{{release_dir}}/"
|
|
||||||
|
|
||||||
- block:
|
|
||||||
- pause:
|
|
||||||
prompt: "Ready to push, this is the last chance to abort..."
|
|
||||||
|
|
||||||
- name: Push the submodule repos
|
|
||||||
shell:
|
|
||||||
_raw_params: "git push submodule_upstream {{ansible_release_branch}}"
|
|
||||||
chdir: "{{release_dir}}/lib/ansible/modules/{{item}}/"
|
|
||||||
with_items:
|
|
||||||
- core
|
|
||||||
- extras
|
|
||||||
when: has_submodules|bool
|
|
||||||
|
|
||||||
- name: Push the updates and/or tag
|
|
||||||
shell:
|
|
||||||
_raw_params: "git push --tags upstream {{ansible_release_branch}}"
|
|
||||||
chdir: "{{release_dir}}/lib/ansible/modules/{{item}}/"
|
|
||||||
when: do_push|bool
|
|
@ -1,16 +0,0 @@
|
|||||||
Ansible Releases at a Glance
|
|
||||||
============================
|
|
||||||
|
|
||||||
VERSION RELEASE CODE NAME
|
|
||||||
++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
{% for version in versions %}
|
|
||||||
{% for vkey, vdata in version.items() %}
|
|
||||||
{% for release in vdata.releases %}
|
|
||||||
{% for rkey, rdata in release.items() %}
|
|
||||||
{% set major_minor = vkey + "." + rkey %}
|
|
||||||
{{"%-8s"|format(major_minor)}} {{"%-10s"|format(rdata)}} "{{vdata.code_name}}"
|
|
||||||
{% endfor %}
|
|
||||||
{% endfor %}
|
|
||||||
{% endfor %}
|
|
||||||
{% endfor %}
|
|
@ -0,0 +1,42 @@
|
|||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from packaging.version import InvalidVersion
|
||||||
|
from versionhelper.version_helper import AnsibleVersionMunger
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('version,revision,codename,output_propname,expected', [
|
||||||
|
('2.5.0dev1', None, None, 'raw', '2.5.0dev1'),
|
||||||
|
('2.5.0', None, None, 'raw', '2.5.0'),
|
||||||
|
('2.5.0dev1', None, None, 'major_version', '2.5'),
|
||||||
|
('2.5.0', None, None, 'major_version', '2.5'),
|
||||||
|
('2.5.0dev1', None, None, 'base_version', '2.5.0'),
|
||||||
|
('2.5.0', None, None, 'base_version', '2.5.0'),
|
||||||
|
('2.5.0dev1', None, None, 'deb_version', '2.5.0~dev1'),
|
||||||
|
('2.5.0b1', None, None, 'deb_version', '2.5.0~b1'),
|
||||||
|
('2.5.0', None, None, 'deb_version', '2.5.0'),
|
||||||
|
('2.5.0dev1', None, None, 'deb_release', '1'),
|
||||||
|
('2.5.0b1', 2, None, 'deb_release', '2'),
|
||||||
|
('2.5.0dev1', None, None, 'rpm_release', '0.1.dev1'),
|
||||||
|
('2.5.0a1', None, None, 'rpm_release', '0.101.a1'),
|
||||||
|
('2.5.0b1', None, None, 'rpm_release', '0.201.b1'),
|
||||||
|
('2.5.0rc1', None, None, 'rpm_release', '0.1001.rc1'),
|
||||||
|
('2.5.0rc1', '0.99', None, 'rpm_release', '0.99.rc1'),
|
||||||
|
('2.5.0.rc.1', None, None, 'rpm_release', '0.1001.rc.1'),
|
||||||
|
('2.5.0', None, None, 'rpm_release', '1'),
|
||||||
|
('2.5.0', 2, None, 'rpm_release', '2'),
|
||||||
|
('2.5.0', None, None, 'codename', 'UNKNOWN'),
|
||||||
|
('2.5.0', None, 'LedZeppelinSongHere', 'codename', 'LedZeppelinSongHere'),
|
||||||
|
('2.5.0x1', None, None, None, InvalidVersion)
|
||||||
|
])
|
||||||
|
def test_output_values(version, revision, codename, output_propname, expected):
|
||||||
|
try:
|
||||||
|
v = AnsibleVersionMunger(version, revision, codename)
|
||||||
|
assert getattr(v, output_propname) == expected
|
||||||
|
except Exception as ex:
|
||||||
|
if isinstance(expected, type):
|
||||||
|
assert isinstance(ex, expected)
|
||||||
|
else:
|
||||||
|
raise
|
@ -1,167 +0,0 @@
|
|||||||
versions:
|
|
||||||
- "2.6":
|
|
||||||
code_name: "Heartbreaker"
|
|
||||||
releases:
|
|
||||||
- "0": TBD
|
|
||||||
- "2.5":
|
|
||||||
code_name: "Kashmir"
|
|
||||||
releases:
|
|
||||||
- "0": TBD
|
|
||||||
- "2.4":
|
|
||||||
code_name: "Dancing Days"
|
|
||||||
releases:
|
|
||||||
- "4": "04-04-2018"
|
|
||||||
- "3": "01-31.2018"
|
|
||||||
- "2": "11-29-2017"
|
|
||||||
- "1": "10-25-2017"
|
|
||||||
- "0": "09-19-2017"
|
|
||||||
- "2.3":
|
|
||||||
code_name: "Ramble On"
|
|
||||||
releases:
|
|
||||||
- "3": "12-20-2017"
|
|
||||||
- "2": "08-04-2017"
|
|
||||||
- "1": "06-01-2017"
|
|
||||||
- "0": "04-12-2017"
|
|
||||||
- "2.2":
|
|
||||||
code_name: "The Battle of Evermore"
|
|
||||||
releases:
|
|
||||||
- "3": "05-09-2017"
|
|
||||||
- "2": "03-27-2017"
|
|
||||||
- "1": "01-16-2017"
|
|
||||||
- "0": "11-01-2016"
|
|
||||||
- "2.1":
|
|
||||||
code_name: "The Song Remains the Same"
|
|
||||||
releases:
|
|
||||||
- "6": "06-01-2017"
|
|
||||||
- "5": "03-27-2017"
|
|
||||||
- "4": "01-16-2017"
|
|
||||||
- "3": "11-04-2016"
|
|
||||||
- "2": "09-29-2016"
|
|
||||||
- "1": "07-28-2016"
|
|
||||||
- "0": "05-25-2016"
|
|
||||||
- "2.0":
|
|
||||||
code_name: "Over the Hills and Far Away"
|
|
||||||
releases:
|
|
||||||
- '2': "04-19-2016"
|
|
||||||
- '1': "02-24-2016"
|
|
||||||
- '0': "01-12-2016"
|
|
||||||
- "1.9":
|
|
||||||
code_name: "Dancing In the Streets"
|
|
||||||
releases:
|
|
||||||
- '6': "04-15-2016"
|
|
||||||
- '5': "03-21-2016"
|
|
||||||
- '4': "10-09-2015"
|
|
||||||
- '3': "09-03-2015"
|
|
||||||
- '2': "06-24-2015"
|
|
||||||
- '1': "04-27-2015"
|
|
||||||
- '0': "03-25-2015"
|
|
||||||
- "1.8":
|
|
||||||
code_name: "You Really Got Me"
|
|
||||||
releases:
|
|
||||||
- '4': "02-19-2015"
|
|
||||||
- '3': "02-17-2015"
|
|
||||||
- '2': "12-04-2014"
|
|
||||||
- '1': "11-26-2014"
|
|
||||||
- '0': "11-25-2014"
|
|
||||||
- "1.7":
|
|
||||||
code_name: "Summer Nights"
|
|
||||||
releases:
|
|
||||||
- '2': "09-24-2014"
|
|
||||||
- '1': "08-14-2014"
|
|
||||||
- '0': "08-06-2014"
|
|
||||||
- "1.6":
|
|
||||||
code_name: "The Cradle Will Rock"
|
|
||||||
releases:
|
|
||||||
- '10': "07-25-2014"
|
|
||||||
- '9': "07-24-2014"
|
|
||||||
- '8': "07-22-2014"
|
|
||||||
- '7': "07-21-2014"
|
|
||||||
- '6': "07-01-2014"
|
|
||||||
- '5': "06-25-2014"
|
|
||||||
- '4': "06-25-2014"
|
|
||||||
- '3': "06-09-2014"
|
|
||||||
- '2': "05-23-2014"
|
|
||||||
- '1': "05-07-2014"
|
|
||||||
- '0': "05-05-2014"
|
|
||||||
- "1.5":
|
|
||||||
code_name: "Love Walks In"
|
|
||||||
releases:
|
|
||||||
- '5': "04-18-2014"
|
|
||||||
- '4': "04-01-2014"
|
|
||||||
- '3': "03-13-2014"
|
|
||||||
- '2': "03-11-2014"
|
|
||||||
- '1': "03-10-2014"
|
|
||||||
- '0': "02-28-2014"
|
|
||||||
- "1.4":
|
|
||||||
code_name: "Could This Be Magic?"
|
|
||||||
releases:
|
|
||||||
- '5': "02-12-2014"
|
|
||||||
- '4': "01-06-2014"
|
|
||||||
- '3': "12-20-2013"
|
|
||||||
- '2': "12-18-2013"
|
|
||||||
- '1': "11-27-2013"
|
|
||||||
- '0': "11-21-2013"
|
|
||||||
- "1.3":
|
|
||||||
code_name: "Top of the World"
|
|
||||||
releases:
|
|
||||||
- '4': "10-29-2013"
|
|
||||||
- '3': "10-09-2013"
|
|
||||||
- '2': "09-19-2013"
|
|
||||||
- '1': "09-16-2013"
|
|
||||||
- '0': "09-13-2013"
|
|
||||||
- "1.2":
|
|
||||||
code_name: "Right Now"
|
|
||||||
releases:
|
|
||||||
- '3': "08-21-2013"
|
|
||||||
- '2': "07-05-2013"
|
|
||||||
- '1': "07-04-2013"
|
|
||||||
- '0': "06-10-2013"
|
|
||||||
- "1.1":
|
|
||||||
code_name: "Mean Street"
|
|
||||||
releases:
|
|
||||||
- '0': "04-02-2013"
|
|
||||||
- "1.0":
|
|
||||||
code_name: "Eruption"
|
|
||||||
releases:
|
|
||||||
- '0': "02-01-2013"
|
|
||||||
- "0.9":
|
|
||||||
code_name: "Dreams"
|
|
||||||
releases:
|
|
||||||
- '0': "11-30-2012"
|
|
||||||
- "0.8":
|
|
||||||
code_name: "Cathedral"
|
|
||||||
releases:
|
|
||||||
- '0': "10-19-2012"
|
|
||||||
- "0.7":
|
|
||||||
code_name: "Panama"
|
|
||||||
releases:
|
|
||||||
- '0': "09-06-2012"
|
|
||||||
- "0.6":
|
|
||||||
code_name: "Cabo"
|
|
||||||
releases:
|
|
||||||
- '0': "08-06-2012"
|
|
||||||
- "0.5":
|
|
||||||
code_name: "Amsterdam"
|
|
||||||
releases:
|
|
||||||
- '0': "07-04-2012"
|
|
||||||
- "0.4":
|
|
||||||
code_name: "Unchained"
|
|
||||||
releases:
|
|
||||||
- '0': "05-23-2012"
|
|
||||||
- "0.3":
|
|
||||||
code_name: "Baluchitherium"
|
|
||||||
releases:
|
|
||||||
- '0': "04-23-2012"
|
|
||||||
- "0.2":
|
|
||||||
code_name: "Untitled"
|
|
||||||
releases:
|
|
||||||
- '0': "?"
|
|
||||||
- "0.1":
|
|
||||||
code_name: "Untitled"
|
|
||||||
releases:
|
|
||||||
- '0': "?"
|
|
||||||
- "0.0":
|
|
||||||
code_name: "Untitled"
|
|
||||||
releases:
|
|
||||||
- '2': "?"
|
|
||||||
- '1': "?"
|
|
@ -0,0 +1,182 @@
|
|||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from packaging.version import Version, VERSION_PATTERN
|
||||||
|
|
||||||
|
|
||||||
|
class AnsibleVersionMunger(object):
|
||||||
|
tag_offsets = dict(
|
||||||
|
dev=0,
|
||||||
|
a=100,
|
||||||
|
b=200,
|
||||||
|
rc=1000
|
||||||
|
)
|
||||||
|
|
||||||
|
# TODO: allow overrides here for packaging bump etc
|
||||||
|
def __init__(self, raw_version, revision=None, codename=None):
|
||||||
|
self._raw_version = raw_version
|
||||||
|
self._revision = revision
|
||||||
|
self._parsed_version = Version(raw_version)
|
||||||
|
self._codename = codename
|
||||||
|
self._parsed_regex_match = re.match(VERSION_PATTERN, raw_version, re.VERBOSE | re.IGNORECASE)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def deb_version(self):
|
||||||
|
v = self._parsed_version
|
||||||
|
|
||||||
|
match = self._parsed_regex_match
|
||||||
|
|
||||||
|
if v.is_prerelease:
|
||||||
|
if match.group('pre'):
|
||||||
|
tag_value = match.group('pre')
|
||||||
|
tag_type = match.group('pre_l')
|
||||||
|
tag_ver = match.group('pre_n')
|
||||||
|
elif match.group('dev'):
|
||||||
|
tag_type = "dev"
|
||||||
|
tag_value = match.group('dev')
|
||||||
|
tag_ver = match.group('dev_n')
|
||||||
|
else:
|
||||||
|
raise Exception("unknown prerelease type for version {0}".format(self._raw_version))
|
||||||
|
|
||||||
|
elif v.is_postrelease:
|
||||||
|
raise Exception("post-release identifiers are not supported")
|
||||||
|
else:
|
||||||
|
tag_type = None
|
||||||
|
tag_value = ''
|
||||||
|
tag_ver = 0
|
||||||
|
|
||||||
|
# not a pre/post/dev release, just return base version
|
||||||
|
if not tag_type:
|
||||||
|
return '{base_version}'.format(base_version=self.base_version)
|
||||||
|
|
||||||
|
# it is a pre/dev release, include the tag value with a ~
|
||||||
|
return '{base_version}~{tag_value}'.format(base_version=self.base_version, tag_value=tag_value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def deb_release(self):
|
||||||
|
return '1' if self._revision is None else str(self._revision)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rpm_release(self):
|
||||||
|
v = self._parsed_version
|
||||||
|
match = self._parsed_regex_match
|
||||||
|
|
||||||
|
if v.is_prerelease:
|
||||||
|
if match.group('pre'):
|
||||||
|
tag_value = match.group('pre')
|
||||||
|
tag_type = match.group('pre_l')
|
||||||
|
tag_ver = match.group('pre_n')
|
||||||
|
elif match.group('dev'):
|
||||||
|
tag_type = "dev"
|
||||||
|
tag_value = match.group('dev')
|
||||||
|
tag_ver = match.group('dev_n')
|
||||||
|
else:
|
||||||
|
raise Exception("unknown prerelease type for version {0}".format(self._raw_version))
|
||||||
|
|
||||||
|
elif v.is_postrelease:
|
||||||
|
raise Exception("post-release identifiers are not supported")
|
||||||
|
else:
|
||||||
|
tag_type = None
|
||||||
|
tag_value = ''
|
||||||
|
tag_ver = 0
|
||||||
|
|
||||||
|
# not a pre/post/dev release, just append revision (default 1)
|
||||||
|
if not tag_type:
|
||||||
|
if self._revision is None:
|
||||||
|
self._revision = 1
|
||||||
|
return '{revision}'.format(revision=self._revision)
|
||||||
|
|
||||||
|
# cleanse tag value in case it starts with .
|
||||||
|
tag_value = tag_value.strip('.')
|
||||||
|
|
||||||
|
# coerce to int and None == 0
|
||||||
|
tag_ver = int(tag_ver if tag_ver else 0)
|
||||||
|
|
||||||
|
if self._revision is None:
|
||||||
|
tag_offset = self.tag_offsets.get(tag_type)
|
||||||
|
if tag_offset is None:
|
||||||
|
raise Exception('no tag offset defined for tag {0}'.format(tag_type))
|
||||||
|
pkgrel = '0.{0}'.format(tag_offset + tag_ver)
|
||||||
|
else:
|
||||||
|
pkgrel = self._revision
|
||||||
|
|
||||||
|
return '{pkgrel}.{tag_value}'.format(pkgrel=pkgrel, tag_value=tag_value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def raw(self):
|
||||||
|
return self._raw_version
|
||||||
|
|
||||||
|
# return the x.y.z version without any other modifiers present
|
||||||
|
@property
|
||||||
|
def base_version(self):
|
||||||
|
return self._parsed_version.base_version
|
||||||
|
|
||||||
|
# return the x.y version without any other modifiers present
|
||||||
|
@property
|
||||||
|
def major_version(self):
|
||||||
|
return re.match(r'^(\d+.\d+)', self._raw_version).group(1)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def codename(self):
|
||||||
|
return self._codename if self._codename else "UNKNOWN"
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description='Extract/transform Ansible versions to various packaging formats')
|
||||||
|
|
||||||
|
group = parser.add_mutually_exclusive_group(required=True)
|
||||||
|
group.add_argument('--raw', action='store_true')
|
||||||
|
group.add_argument('--majorversion', action='store_true')
|
||||||
|
group.add_argument('--baseversion', action='store_true')
|
||||||
|
group.add_argument('--debversion', action='store_true')
|
||||||
|
group.add_argument('--debrelease', action='store_true')
|
||||||
|
group.add_argument('--rpmrelease', action='store_true')
|
||||||
|
group.add_argument('--codename', action='store_true')
|
||||||
|
group.add_argument('--all', action='store_true')
|
||||||
|
|
||||||
|
parser.add_argument('--revision', action='store', default='auto')
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
mydir = os.path.dirname(__file__)
|
||||||
|
release_loc = os.path.normpath(mydir + '/../../../lib')
|
||||||
|
|
||||||
|
sys.path.insert(0, release_loc)
|
||||||
|
|
||||||
|
from ansible import release
|
||||||
|
|
||||||
|
rev = None
|
||||||
|
if args.revision != 'auto':
|
||||||
|
rev = args.revision
|
||||||
|
|
||||||
|
v_raw = release.__version__
|
||||||
|
codename = release.__codename__
|
||||||
|
v = AnsibleVersionMunger(v_raw, revision=rev, codename=codename)
|
||||||
|
|
||||||
|
if args.raw:
|
||||||
|
print(v.raw)
|
||||||
|
elif args.baseversion:
|
||||||
|
print(v.base_version)
|
||||||
|
elif args.majorversion:
|
||||||
|
print(v.major_version)
|
||||||
|
elif args.debversion:
|
||||||
|
print(v.deb_version)
|
||||||
|
elif args.debrelease:
|
||||||
|
print(v.deb_release)
|
||||||
|
elif args.rpmrelease:
|
||||||
|
print(v.rpm_release)
|
||||||
|
elif args.codename:
|
||||||
|
print(v.codename)
|
||||||
|
elif args.all:
|
||||||
|
props = [name for (name, impl) in vars(AnsibleVersionMunger).items() if isinstance(impl, property)]
|
||||||
|
|
||||||
|
for propname in props:
|
||||||
|
print('{0}: {1}'.format(propname, getattr(v, propname)))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
Loading…
Reference in New Issue