summaryrefslogtreecommitdiff
path: root/ACE/bin
diff options
context:
space:
mode:
authorFred Hornsey <hornseyf@objectcomputing.com>2020-08-11 23:26:06 -0500
committerFred Hornsey <hornseyf@objectcomputing.com>2020-08-11 23:26:06 -0500
commitcaced33b4cb2cb38bbb5156fe2fd5b6abb784e00 (patch)
treeb9b924b493badad9871e4e25ee20deddfc235201 /ACE/bin
parentcad183e66896132e5e45c2f21ba705634e5c67bd (diff)
downloadATCD-caced33b4cb2cb38bbb5156fe2fd5b6abb784e00.tar.gz
make_release.py: Use Branches for Latest
Part of Fix for https://github.com/DOCGroup/ACE_TAO/issues/940 Assume Latest_Major, Latest_Minor, and Latest_Micro/Latest_Beta and the MPC equivalents are branches instead of tags. The other part of the fix is actually changing the tags into branches.
Diffstat (limited to 'ACE/bin')
-rwxr-xr-xACE/bin/make_release.py107
1 files changed, 46 insertions, 61 deletions
diff --git a/ACE/bin/make_release.py b/ACE/bin/make_release.py
index a76377c7586..5c1ca95d925 100755
--- a/ACE/bin/make_release.py
+++ b/ACE/bin/make_release.py
@@ -5,6 +5,8 @@
# @author William R. Otte <wotte@dre.vanderbilt.edu>
#
# Packaging script for ACE/TAO
+#
+# Should be compatible with Python 2.7 and 3.x
from __future__ import with_statement
from __future__ import print_function
@@ -524,33 +526,49 @@ def get_comp_versions (component):
# str (comp_versions[minor])
-def update_latest_tag (product, which, branch):
- """ Update one of the Latest_* tags externals to point the new release """
+def update_latest_branch (product, which):
+ """Update one of the Latest_* branches to point to the new release.
+ """
+
global opts
- tagname = "Latest_" + which
+ name = "Latest_" + which
- # Remove tag locally
- vprint ("Removing tag %s" % (tagname))
- ex_failureok ("cd $DOC_ROOT/" + product + " && git tag -d " + tagname)
+ vprint ('Fast-forwarding', name, 'to master')
+ ex ("cd $DOC_ROOT/" + product + " && git fetch . master:" + name)
- vprint ("Placing tag %s" % (tagname))
- ex ("cd $DOC_ROOT/" + product + " && git tag -a " + tagname + " -m\"" + tagname + "\"")
+def push_latest_branch (product, which):
+ """Update one of the remote Latest_* branches to point to the new release.
+ """
-def push_latest_tag (product, which, branch):
- """ Update one of the Latest_* tags externals to point the new release """
global opts
- tagname = "Latest_" + which
+ name = "Latest_" + which
if opts.push:
- # Remove tag in the remote origin
- ex_failureok ("cd $DOC_ROOT/" + product + " && git push origin :refs/tags/" + tagname)
+ vprint ("Pushing branch", name)
+ ex_failureok ("cd $DOC_ROOT/" + product + " && git push origin refs/heads/" + name)
+
+
+def latest_branch_helper (fn, release_type):
+ release_types = ("major", "minor", "micro")
+ do = release_types[release_types.index(release_type):]
+ if "micro" in do:
+ fn ("ACE_TAO", "Beta")
+ fn ("ACE_TAO", "Micro")
+ fn ("MPC", "ACETAO_Micro")
+ if "minor" in do:
+ fn ("ACE_TAO", "Minor")
+ fn ("MPC", "ACETAO_Minor")
+ if "major" in do:
+ fn ("ACE_TAO", "Major")
+ fn ("MPC", "ACETAO_Major")
- vprint ("Pushing tag %s" % (tagname))
- ex ("cd $DOC_ROOT/" + product + " && git push origin " + tagname)
def tag ():
- """ Tags the DOC and MPC repositories for the version and push that remote """
+ """Add the release tag and fast-forward the release branches on DOC and MPC
+ repositories.
+ """
+
global comp_versions, opts
tagname = get_tag(comp_versions, 'ACE')
@@ -563,38 +581,23 @@ def tag ():
vprint ("Placing tag %s on MPC" % (tagname))
ex ("cd $DOC_ROOT/MPC && git tag -a " + tagname + " -m\"" + tagname + "\"")
- # Update latest tag
- if opts.release_type == "major":
- update_latest_tag ("ACE_TAO", "Major", tagname)
- update_latest_tag ("ACE_TAO", "Minor", tagname)
- update_latest_tag ("ACE_TAO", "Beta", tagname)
- update_latest_tag ("ACE_TAO", "Micro", tagname)
- update_latest_tag ("MPC", "ACETAO_Major", tagname)
- update_latest_tag ("MPC", "ACETAO_Minor", tagname)
- update_latest_tag ("MPC", "ACETAO_Micro", tagname)
- elif opts.release_type == "minor":
- update_latest_tag ("ACE_TAO", "Minor", tagname)
- update_latest_tag ("ACE_TAO", "Beta", tagname)
- update_latest_tag ("ACE_TAO", "Micro", tagname)
- update_latest_tag ("MPC", "ACETAO_Minor", tagname)
- update_latest_tag ("MPC", "ACETAO_Micro", tagname)
- elif opts.release_type == "micro":
- update_latest_tag ("ACE_TAO", "Beta", tagname)
- update_latest_tag ("ACE_TAO", "Micro", tagname)
- update_latest_tag ("MPC", "ACETAO_Micro", tagname)
+ # Update release branches
+ latest_branch_helper (update_latest_branch, opts.release_type)
else:
vprint ("Placing tag %s on ACE_TAO" % (tagname))
vprint ("Placing tag %s on MPC" % (tagname))
print ("Creating tags:\n")
print ("Placing tag " + tagname + "\n")
+
def push ():
- """ Tags the DOC and MPC repositories for the version and push that remote """
+ """Push the release tag and the fast-forwarded release branches on DOC and
+ MPC repositories.
+ """
+
global comp_versions, opts
- tagname = "ACE+TAO-%d_%d_%d" % (comp_versions["ACE_major"],
- comp_versions["ACE_minor"],
- comp_versions["ACE_micro"])
+ tagname = get_tag (comp_versions, 'ACE')
if opts.push:
if opts.take_action:
@@ -607,31 +610,15 @@ def push ():
vprint ("Pushing tag %s on MPC" % (tagname))
ex ("cd $DOC_ROOT/MPC && git push origin tag " + tagname)
- # Update latest tag
- if opts.release_type == "major":
- push_latest_tag ("ACE_TAO", "Major", tagname)
- push_latest_tag ("ACE_TAO", "Minor", tagname)
- push_latest_tag ("ACE_TAO", "Beta", tagname)
- push_latest_tag ("ACE_TAO", "Micro", tagname)
- push_latest_tag ("MPC", "ACETAO_Major", tagname)
- push_latest_tag ("MPC", "ACETAO_Minor", tagname)
- push_latest_tag ("MPC", "ACETAO_Micro", tagname)
- elif opts.release_type == "minor":
- push_latest_tag ("ACE_TAO", "Minor", tagname)
- push_latest_tag ("ACE_TAO", "Beta", tagname)
- push_latest_tag ("ACE_TAO", "Micro", tagname)
- push_latest_tag ("MPC", "ACETAO_Minor", tagname)
- push_latest_tag ("MPC", "ACETAO_Micro", tagname)
- elif opts.release_type == "micro":
- push_latest_tag ("ACE_TAO", "Beta", tagname)
- push_latest_tag ("ACE_TAO", "Micro", tagname)
- push_latest_tag ("MPC", "ACETAO_Micro", tagname)
+ # Push release branches
+ latest_branch_helper (push_latest_branch, opts.release_type)
else:
vprint ("Pushing tag %s on ACE_TAO" % (tagname))
vprint ("Pushing tag %s on MPC" % (tagname))
print ("Pushing tags:\n")
print ("Pushing tag " + tagname + "\n")
+
##################################################
#### Packaging methods
##################################################
@@ -639,9 +626,7 @@ def export_wc (stage_dir):
global doc_root, comp_versions
- tag = "ACE+TAO-%d_%d_%d" % (comp_versions["ACE_major"],
- comp_versions["ACE_minor"],
- comp_versions["ACE_micro"])
+ tag = get_tag (comp_versions, 'ACE')
# Clone the ACE repository with the needed tag
print ("Retrieving ACE with tag " + tag)