diff options
author | Matt Davis <nitzmahone@users.noreply.github.com> | 2018-05-21 16:14:53 -0700 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2018-05-21 16:14:53 -0700 |
commit | e4edb2842a8816a3eed596aea1c28aa769a31e9d (patch) | |
tree | 6e1407782d7a1360345e078a4cee7808d365002a /Makefile | |
parent | eb818df1ecbc45458fa1aa446e2cc236e425056e (diff) | |
download | ansible-e4edb2842a8816a3eed596aea1c28aa769a31e9d.tar.gz |
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_RELEASE
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 71 |
1 files changed, 54 insertions, 17 deletions
@@ -34,9 +34,17 @@ GENERATE_CLI = docs/bin/generate_man.py PYTHON=python SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") -# VERSION file provides one place to update the software version -VERSION := $(shell cat VERSION | cut -f1 -d' ') -RELEASE := $(shell cat VERSION | cut -f2 -d' ') +# fetch version from project release.py as single source-of-truth +VERSION := $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --raw || echo error) +ifeq ($(findstring error,$(VERSION)), error) +$(error "version_helper failed") +endif + +MAJOR_VERSION := $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --majorversion) +CODENAME := $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --codename) + +# if a specific release was not requested, set to 1 (RPMs have "fancier" logic for this further down) +RELEASE ?= 1 # Get the branch information from git ifneq ($(shell which git),) @@ -62,15 +70,16 @@ DEBUILD_OPTS = --source-option="-I" DPUT_BIN ?= dput DPUT_OPTS ?= DEB_DATE := $(shell LC_TIME=C date +"%a, %d %b %Y %T %z") +DEB_VERSION ?= $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --debversion) ifeq ($(OFFICIAL),yes) - DEB_RELEASE = $(RELEASE)ppa + DEB_RELEASE ?= $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --debrelease)ppa # Sign OFFICIAL builds using 'DEBSIGN_KEYID' # DEBSIGN_KEYID is required when signing ifneq ($(DEBSIGN_KEYID),) DEBUILD_OPTS += -k$(DEBSIGN_KEYID) endif else - DEB_RELEASE = 100.git$(DATE)$(GITINFO) + DEB_RELEASE ?= 100.git$(DATE)$(GITINFO) # Do not sign unofficial builds DEBUILD_OPTS += -uc -us DPUT_OPTS += -u @@ -90,7 +99,7 @@ PBUILDER_OPTS ?= --debootstrapopts --variant=buildd --architecture $(PBUILDER_AR RPMSPECDIR= packaging/rpm RPMSPEC = $(RPMSPECDIR)/ansible.spec RPMDIST = $(shell rpm --eval '%{?dist}') -RPMRELEASE = $(RELEASE) + ifneq ($(OFFICIAL),yes) RPMRELEASE = 100.git$(DATE)$(GITINFO) endif @@ -98,12 +107,20 @@ ifeq ($(PUBLISH),nightly) # https://fedoraproject.org/wiki/Packaging:Versioning#Snapshots RPMRELEASE = $(RELEASE).$(DATE)git.$(GIT_HASH) endif -RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)" + +RPMVERSION ?= $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --baseversion) +RPMRELEASE ?= $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --rpmrelease) +RPMNVR = "$(NAME)-$(RPMVERSION)-$(RPMRELEASE)$(RPMDIST)$(REPOTAG)" # MOCK build parameters MOCK_BIN ?= mock MOCK_CFG ?= +# dynamically add repotag define only if specified +ifneq ($(REPOTAG),) + EXTRA_RPM_DEFINES += --define "repotag $(REPOTAG)" +endif + # ansible-test parameters ANSIBLE_TEST ?= test/runner/ansible-test TEST_FLAGS ?= @@ -147,9 +164,9 @@ authors: sed "s/%VERSION%/$(VERSION)/" $< > $@ rm $< -# Regenerate %.1 if %.1.rst or VERSION has been modified more +# Regenerate %.1 if %.1.rst or release.py has been modified more # recently than %.1. (Implicitly runs the %.1.rst recipe) -%.1: %.1.rst VERSION +%.1: %.1.rst lib/ansible/release.py $(ASCII2MAN) .PHONY: loc @@ -222,15 +239,23 @@ sdist: clean docs sdist_upload: clean docs $(PYTHON) setup.py sdist upload 2>&1 |tee upload.log +.PHONY: changelog_reno +changelog_reno: + reno -d changelogs/ report --title 'Ansible $(MAJOR_VERSION) "$(CODENAME)" Release Notes' --collapse-pre-release --no-show-source --earliest-version v$(MAJOR_VERSION).0a1 --output changelogs/CHANGELOG-v$(MAJOR_VERSION).rst + .PHONY: rpmcommon rpmcommon: sdist @mkdir -p rpm-build @cp dist/*.gz rpm-build/ - @sed -e 's#^Version:.*#Version: $(VERSION)#' -e 's#^Release:.*#Release: $(RPMRELEASE)%{?dist}$(REPOTAG)#' $(RPMSPEC) >rpm-build/$(NAME).spec + @cp $(RPMSPEC) rpm-build/$(NAME).spec .PHONY: mock-srpm mock-srpm: /etc/mock/$(MOCK_CFG).cfg rpmcommon - $(MOCK_BIN) -r $(MOCK_CFG) $(MOCK_ARGS) --resultdir rpm-build/ --buildsrpm --spec rpm-build/$(NAME).spec --sources rpm-build/ + $(MOCK_BIN) -r $(MOCK_CFG) $(MOCK_ARGS) --resultdir rpm-build/ --bootstrap-chroot --old-chroot --buildsrpm --spec rpm-build/$(NAME).spec --sources rpm-build/ \ + --define "rpmversion $(RPMVERSION)" \ + --define "upstream_version $(VERSION)" \ + --define "rpmrelease $(RPMRELEASE)" \ + $(EXTRA_RPM_DEFINES) @echo "#############################################" @echo "Ansible SRPM is built:" @echo rpm-build/*.src.rpm @@ -238,7 +263,11 @@ mock-srpm: /etc/mock/$(MOCK_CFG).cfg rpmcommon .PHONY: mock-rpm mock-rpm: /etc/mock/$(MOCK_CFG).cfg mock-srpm - $(MOCK_BIN) -r $(MOCK_CFG) $(MOCK_ARGS) --resultdir rpm-build/ --rebuild rpm-build/$(NAME)-*.src.rpm + $(MOCK_BIN) -r $(MOCK_CFG) $(MOCK_ARGS) --resultdir rpm-build/ --bootstrap-chroot --old-chroot --rebuild rpm-build/$(NAME)-*.src.rpm \ + --define "rpmversion $(RPMVERSION)" \ + --define "upstream_version $(VERSION)" \ + --define "rpmrelease $(RPMRELEASE)" \ + $(EXTRA_RPM_DEFINES) @echo "#############################################" @echo "Ansible RPM is built:" @echo rpm-build/*.noarch.rpm @@ -252,6 +281,10 @@ srpm: rpmcommon --define "_srcrpmdir %{_topdir}" \ --define "_specdir $(RPMSPECDIR)" \ --define "_sourcedir %{_topdir}" \ + --define "upstream_version $(VERSION)" \ + --define "rpmversion $(RPMVERSION)" \ + --define "rpmrelease $(RPMRELEASE)" \ + $(EXTRA_RPM_DEFINES) \ -bs rpm-build/$(NAME).spec @rm -f rpm-build/$(NAME).spec @echo "#############################################" @@ -267,8 +300,12 @@ rpm: rpmcommon --define "_srcrpmdir %{_topdir}" \ --define "_specdir $(RPMSPECDIR)" \ --define "_sourcedir %{_topdir}" \ - --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ + --define "_rpmfilename $(RPMNVR).%%{ARCH}.rpm" \ --define "__python `which $(PYTHON)`" \ + --define "upstream_version $(VERSION)" \ + --define "rpmversion $(RPMVERSION)" \ + --define "rpmrelease $(RPMRELEASE)" \ + $(EXTRA_RPM_DEFINES) \ -ba rpm-build/$(NAME).spec @rm -f rpm-build/$(NAME).spec @echo "#############################################" @@ -282,7 +319,7 @@ debian: sdist mkdir -p deb-build/$${DIST} ; \ tar -C deb-build/$${DIST} -xvf dist/$(NAME)-$(VERSION).tar.gz ; \ cp -a packaging/debian deb-build/$${DIST}/$(NAME)-$(VERSION)/ ; \ - sed -ie "s|%VERSION%|$(VERSION)|g;s|%RELEASE%|$(DEB_RELEASE)|;s|%DIST%|$${DIST}|g;s|%DATE%|$(DEB_DATE)|g" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ; \ + sed -ie "s|%VERSION%|$(DEB_VERSION)|g;s|%RELEASE%|$(DEB_RELEASE)|;s|%DIST%|$${DIST}|g;s|%DATE%|$(DEB_DATE)|g" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ; \ done .PHONY: deb @@ -291,12 +328,12 @@ deb: deb-src PBUILDER_OPTS="$(PBUILDER_OPTS) --distribution $${DIST} --basetgz $(PBUILDER_CACHE_DIR)/$${DIST}-$(PBUILDER_ARCH)-base.tgz --buildresult $(CURDIR)/deb-build/$${DIST}" ; \ $(PBUILDER_BIN) create $${PBUILDER_OPTS} --othermirror "deb http://archive.ubuntu.com/ubuntu $${DIST} universe" ; \ $(PBUILDER_BIN) update $${PBUILDER_OPTS} ; \ - $(PBUILDER_BIN) build $${PBUILDER_OPTS} deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}.dsc ; \ + $(PBUILDER_BIN) build $${PBUILDER_OPTS} deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}.dsc ; \ done @echo "#############################################" @echo "Ansible DEB artifacts:" @for DIST in $(DEB_DIST) ; do \ - echo deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \ + echo deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \ done @echo "#############################################" @@ -310,7 +347,7 @@ local_deb: debian @echo "#############################################" @echo "Ansible DEB artifacts:" @for DIST in $(DEB_DIST) ; do \ - echo deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \ + echo deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \ done @echo "#############################################" |