summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-08-24 12:49:50 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-08-24 12:49:50 -0400
commit59c4ce802ac78c7f845250a8e0c10210b6283800 (patch)
tree1f6130eec5c3fbc71f7d4651ae67384382c20b05
parent8c0abd3c1adb204737851c06cb9eeba16791f2c4 (diff)
downloadcmd2-git-59c4ce802ac78c7f845250a8e0c10210b6283800.tar.gz
Added a tag invoke task for adding a Git tag and pushing it to origin
-rw-r--r--tasks.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tasks.py b/tasks.py
index 583674e9..b045b81b 100644
--- a/tasks.py
+++ b/tasks.py
@@ -173,6 +173,15 @@ def clean_all(context):
pass
namespace_clean.add_task(clean_all, 'all')
+@invoke.task
+def tag(context, name='', message=''):
+ "Add a Git tag and push it to origin"
+ # If a tag was provided on the command-line, then add a Git tag and push it to origin
+ if name:
+ context.run('git tag -a {} -m {!r}'.format(name, message))
+ context.run('git push origin {}'.format(name))
+namespace.add_task(tag)
+
@invoke.task(pre=[clean_all])
def sdist(context):
"Create a source distribution"