summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2018-10-31 19:52:33 -0700
committerMatt Clay <matt@mystile.com>2018-11-05 15:38:44 -0800
commit6a351c9c86433e54955c7f08601355b862323d48 (patch)
tree97ba6d2ae04643cfc258b2fffdb4b1149a4df7c4 /packaging
parent1156014d9c0b99d17ee1e97e01c80e23140efbdc (diff)
downloadansible-6a351c9c86433e54955c7f08601355b862323d48.tar.gz
Add Makefile to simplify upstream releases.
Diffstat (limited to 'packaging')
-rw-r--r--packaging/release/Makefile60
1 files changed, 60 insertions, 0 deletions
diff --git a/packaging/release/Makefile b/packaging/release/Makefile
new file mode 100644
index 0000000000..b21aca446d
--- /dev/null
+++ b/packaging/release/Makefile
@@ -0,0 +1,60 @@
+version ?= $(shell python versionhelper/version_helper.py --raw)
+
+.PHONY: all
+all:
+ @echo "USAGE:"
+ @echo
+ @echo "make release version={version} # current version is '${version}'"
+ @echo "make publish"
+ @echo
+ @echo "NOTE: Make sure to source hacking/env-setup before running these targets."
+
+.PHONY: release
+release: version summary changelog commit-release
+ git show -p
+ git status
+ @echo
+ @echo 'Run `git push` if you are satisfied with the changes.'
+
+.PHONY: version
+version:
+ sed -i.bak "s/^__version__ = .*$$/__version__ = '${version}'/" ../../lib/ansible/release.py
+ rm ../../lib/ansible/release.py.bak
+
+.PHONY: summary
+summary:
+ @echo 'release_summary: |\n\
+ | Release Date: $(shell date '+%Y-%m-%d')\n\
+ | `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`_' > \
+ ../../changelogs/fragments/v${version}_summary.yaml
+
+.PHONY: changelog
+changelog:
+ changelogs/changelog.py release -vv && changelogs/changelog.py generate -vv
+ ansible-test sanity changelogs/
+
+.PHONY: commit-release
+commit-release:
+ git add ../../changelogs/ ../../lib/ansible/release.py
+ git commit -m "New release v${version}"
+
+.PHONY: publish
+publish: tag postversion commit-postversion
+ git show -p
+ git status
+ @echo
+ @echo 'Run `git push --follow-tags` if you are satisfied with the changes.'
+
+.PHONY: tag
+tag:
+ git tag -a v${version} -m "New release v${version}"
+
+.PHONY: postversion
+postversion:
+ sed -i.bak "s/^__version__ = .*$$/__version__ = '${version}.post0'/" ../../lib/ansible/release.py
+ rm ../../lib/ansible/release.py.bak
+
+.PHONY: commit-postversion
+commit-postversion:
+ git add ../../lib/ansible/release.py
+ git commit -m "Update Ansible release version to v${version}."