You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2016/05/23 19:57:13 UTC
[1/6] lucene-solr:branch_6_0: - Fail if there are unpushed commits in
the Git working tree - Drop obsolete "--push-remote" param - Drop obsolete
"--smoke-test" param - Update example RM cmdline usage - Support relative
working tree root directory - Conve
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6_0 8217549a4 -> ba18ce8cd
- Fail if there are unpushed commits in the Git working tree
- Drop obsolete "--push-remote" param
- Drop obsolete "--smoke-test" param
- Update example RM cmdline usage
- Support relative working tree root directory
- Convert "root" positional cmdline arg into an optional "--root" arg defaulting to '.'
- Use sys.executable instead of $PYTHON_EXEC when printing smoke tester cmdline
- Add new fail-fast checks:
- Check for a functional "git" executable
- Ensure "ant" version is 1.8.X
- Ensure working tree is under Git control, and contains 'lucene/', 'solr/' and 'dev-tools/' dirs
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/fe51a371
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/fe51a371
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/fe51a371
Branch: refs/heads/branch_6_0
Commit: fe51a37152040e6d04876c947b7c5434463c0c06
Parents: 8217549
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:28:06 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon May 23 15:28:06 2016 -0400
----------------------------------------------------------------------
dev-tools/scripts/buildAndPushRelease.py | 85 ++++++++-------------------
1 file changed, 26 insertions(+), 59 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/fe51a371/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 62d5f65..a841a8f 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -61,8 +61,10 @@ def getGitRev():
status = os.popen('git status').read().strip()
if 'nothing to commit, working directory clean' not in status:
raise RuntimeError('git clone is dirty:\n\n%s' % status)
+ unpushedCommits = os.popen('git log origin..').read().strip()
+ if len(unpushedCommits) > 0:
+ raise RuntimeError('There are unpushed commits - "git log origin.." output is:\n\n%s' % unpushedCommits)
- # TODO: we should also detect unpushed changes here? Something like "git cherry -v origin/branch_5_5"?
print(' git clone is clean')
return os.popen('git rev-parse HEAD').read().strip()
@@ -115,47 +117,6 @@ def prepare(root, version, gpgKeyID, gpgPassword):
print()
return rev
-def push(version, root, rev, rcNum, username):
- print('Push...')
- dir = 'lucene-solr-%s-RC%d-rev%s' % (version, rcNum, rev)
- s = os.popen('ssh %s@people.apache.org "ls -ld public_html/staging_area/%s" 2>&1' % (username, dir)).read()
- if 'no such file or directory' not in s.lower():
- print(' Remove old dir...')
- run('ssh %s@people.apache.org "chmod -R u+rwX public_html/staging_area/%s; rm -rf public_html/staging_area/%s"' %
- (username, dir, dir))
- run('ssh %s@people.apache.org "mkdir -p public_html/staging_area/%s/lucene public_html/staging_area/%s/solr"' % \
- (username, dir, dir))
- print(' Lucene')
- os.chdir('%s/lucene/dist' % root)
- print(' zip...')
- if os.path.exists('lucene.tar.bz2'):
- os.remove('lucene.tar.bz2')
- run('tar cjf lucene.tar.bz2 *')
- print(' copy...')
- run('scp lucene.tar.bz2 %s@people.apache.org:public_html/staging_area/%s/lucene' % (username, dir))
- print(' unzip...')
- run('ssh %s@people.apache.org "cd public_html/staging_area/%s/lucene; tar xjf lucene.tar.bz2; rm -f lucene.tar.bz2"' % (username, dir))
- os.remove('lucene.tar.bz2')
-
- print(' Solr')
- os.chdir('%s/solr/package' % root)
- print(' zip...')
- if os.path.exists('solr.tar.bz2'):
- os.remove('solr.tar.bz2')
- run('tar cjf solr.tar.bz2 *')
- print(' copy...')
- run('scp solr.tar.bz2 %s@people.apache.org:public_html/staging_area/%s/solr' % (username, dir))
- print(' unzip...')
- run('ssh %s@people.apache.org "cd public_html/staging_area/%s/solr; tar xjf solr.tar.bz2; rm -f solr.tar.bz2"' % (username, dir))
- os.remove('solr.tar.bz2')
-
- print(' chmod...')
- run('ssh %s@people.apache.org "chmod -R a+rX-w public_html/staging_area/%s"' % (username, dir))
-
- print(' done!')
- url = 'http://people.apache.org/~%s/staging_area/%s' % (username, dir)
- return url
-
def pushLocal(version, root, rev, rcNum, localDir):
print('Push local [%s]...' % localDir)
os.makedirs(localDir)
@@ -206,29 +167,23 @@ def read_version(path):
def parse_config():
epilogue = textwrap.dedent('''
Example usage for a Release Manager:
- python3.2 -u buildAndPushRelease.py --push-remote mikemccand --sign 6E68DA61 --rc-num 1 /path/to/lucene_solr_4_7
+ python3 -u dev-tools/scripts/buildAndPushRelease.py --push-local /tmp/releases/6.0.1 --sign 6E68DA61 --rc-num 1
''')
description = 'Utility to build, push, and test a release.'
parser = argparse.ArgumentParser(description=description, epilog=epilogue,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('--no-prepare', dest='prepare', default=True, action='store_false',
help='Use the already built release in the provided checkout')
- parser.add_argument('--push-remote', metavar='USERNAME',
- help='Push the release to people.apache.org for the given user')
parser.add_argument('--push-local', metavar='PATH',
help='Push the release to the local path')
parser.add_argument('--sign', metavar='KEYID',
help='Sign the release with the given gpg key')
parser.add_argument('--rc-num', metavar='NUM', type=int, default=1,
help='Release Candidate number, required')
- parser.add_argument('--smoke-test', metavar='PATH',
- help='Run the smoker tester on the release in the given directory')
- parser.add_argument('root', metavar='checkout_path',
- help='Root of SVN checkout for lucene-solr')
+ parser.add_argument('--root', metavar='WORKING_TREE_PATH', default='.',
+ help='Root of Git working tree for lucene-solr')
config = parser.parse_args()
- if config.push_remote is not None and config.push_local is not None:
- parser.error('Cannot specify --push-remote and --push-local together')
if not config.prepare and config.sign:
parser.error('Cannot sign already built release')
if config.push_local is not None and os.path.exists(config.push_local):
@@ -236,8 +191,13 @@ def parse_config():
if config.rc_num <= 0:
parser.error('Release Candidate number must be a positive integer')
if not os.path.isdir(config.root):
- # TODO: add additional git check to ensure dir is a real lucene-solr checkout
- parser.error('Root path is not a valid lucene-solr checkout')
+ parser.error('Root path "%s" is not a directory' % config.root)
+ cwd = os.getcwd()
+ os.chdir(config.root)
+ config.root = os.getcwd() # Absolutize root dir
+ if os.system('git rev-parse') or 3 != len([d for d in ('dev-tools','lucene','solr') if os.isdir(d)]):
+ parser.error('Root path "%s" is not a valid lucene-solr checkout' % config.root)
+ os.chdir(cwd)
config.version = read_version(config.root)
print('Building version: %s' % config.version)
@@ -251,8 +211,17 @@ def parse_config():
config.gpg_password = None
return config
+
+def check_cmdline_tools(): # Fail fast if there are cmdline tool problems
+ if os.system('git --version'):
+ raise RuntimeError('"git --version" returned a non-zero exit code.')
+ antVersion = os.popen('ant -version').read().strip()
+ if not antVersion.startswith('Apache Ant(TM) version 1.8'):
+ raise RuntimeError('ant version is not 1.8.X: "%s"' % antVersion)
def main():
+ check_cmdline_tools()
+
c = parse_config()
if c.prepare:
@@ -261,19 +230,17 @@ def main():
os.chdir(root)
rev = open('rev.txt', encoding='UTF-8').read()
- if c.push_remote:
- url = push(c.version, c.root, rev, c.rc_num, c.push_remote)
- elif c.push_local:
+ if c.push_local:
url = pushLocal(c.version, c.root, rev, c.rc_num, c.push_local)
else:
url = None
if url is not None:
print(' URL: %s' % url)
- print('Next set the PYTHON_EXEC env var and you can run the smoker tester:')
- p = re.compile("(.*)\/")
+ print('Next run the smoker tester:')
+ p = re.compile(".*/")
m = p.match(sys.argv[0])
- print(' $PYTHON_EXEC %ssmokeTestRelease.py %s' % (m.group(), url))
+ print('%s -u %(s)smokeTestRelease.py %s' % (sys.executable, m.group(), url))
if __name__ == '__main__':
try:
[2/6] lucene-solr:branch_6_0: os.isdir => os.path.isdir
Posted by sa...@apache.org.
os.isdir => os.path.isdir
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e23f3eb1
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e23f3eb1
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e23f3eb1
Branch: refs/heads/branch_6_0
Commit: e23f3eb1f0b057a14c7c9c5d4a2a7aa2c784807b
Parents: fe51a37
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:32:20 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon May 23 15:32:20 2016 -0400
----------------------------------------------------------------------
dev-tools/scripts/buildAndPushRelease.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e23f3eb1/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index a841a8f..6652631 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -195,7 +195,7 @@ def parse_config():
cwd = os.getcwd()
os.chdir(config.root)
config.root = os.getcwd() # Absolutize root dir
- if os.system('git rev-parse') or 3 != len([d for d in ('dev-tools','lucene','solr') if os.isdir(d)]):
+ if os.system('git rev-parse') or 3 != len([d for d in ('dev-tools','lucene','solr') if os.path.isdir(d)]):
parser.error('Root path "%s" is not a valid lucene-solr checkout' % config.root)
os.chdir(cwd)
[6/6] lucene-solr:branch_6_0: - In help text,
show default RC number. - In help text,
state that the default --root value is '.' (the current directory)
Posted by sa...@apache.org.
- In help text, show default RC number.
- In help text, state that the default --root value is '.' (the current directory)
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ba18ce8c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ba18ce8c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ba18ce8c
Branch: refs/heads/branch_6_0
Commit: ba18ce8cd462f53d218dc69ff322e17a15024a29
Parents: f06a5e5
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:55:51 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon May 23 15:55:51 2016 -0400
----------------------------------------------------------------------
dev-tools/scripts/buildAndPushRelease.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ba18ce8c/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 980ef84..155f14f 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -181,9 +181,9 @@ def parse_config():
parser.add_argument('--sign', metavar='KEYID',
help='Sign the release with the given gpg key')
parser.add_argument('--rc-num', metavar='NUM', type=int, default=1,
- help='Release Candidate number, required')
- parser.add_argument('--root', metavar='WORKING_TREE_PATH', default='.',
- help='Root of Git working tree for lucene-solr')
+ help='Release Candidate number. Default: 1')
+ parser.add_argument('--root', metavar='PATH', default='.',
+ help='Root of Git working tree for lucene-solr. Default: "." (the current directory)')
config = parser.parse_args()
if not config.prepare and config.sign:
[4/6] lucene-solr:branch_6_0: Fix current branch detection
Posted by sa...@apache.org.
Fix current branch detection
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9568ac42
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9568ac42
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9568ac42
Branch: refs/heads/branch_6_0
Commit: 9568ac4238e1334233cc6efb7c71e72a3d2fbb58
Parents: b57f753
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:44:11 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon May 23 15:44:11 2016 -0400
----------------------------------------------------------------------
dev-tools/scripts/buildAndPushRelease.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9568ac42/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 1f4837a..f1a7759 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -61,7 +61,7 @@ def getGitRev():
status = os.popen('git status').read().strip()
if 'nothing to commit, working directory clean' not in status:
raise RuntimeError('git clone is dirty:\n\n%s' % status)
- branch = os.popen('git rev-parse --abbrev-ref HEAD')
+ branch = os.popen('git rev-parse --abbrev-ref HEAD').read().strip()
unpushedCommits = os.popen('git log origin/%s..' % branch).read().strip()
if len(unpushedCommits) > 0:
raise RuntimeError('There are unpushed commits - "git log origin.." output is:\n\n%s' % unpushedCommits)
[3/6] lucene-solr:branch_6_0: Check for unpushed commits only on the
current branch
Posted by sa...@apache.org.
Check for unpushed commits only on the current branch
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b57f753f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b57f753f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b57f753f
Branch: refs/heads/branch_6_0
Commit: b57f753f5285adf057ca0ef9cf952c1993b115e1
Parents: e23f3eb
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:40:44 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon May 23 15:40:44 2016 -0400
----------------------------------------------------------------------
dev-tools/scripts/buildAndPushRelease.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b57f753f/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 6652631..1f4837a 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -61,7 +61,8 @@ def getGitRev():
status = os.popen('git status').read().strip()
if 'nothing to commit, working directory clean' not in status:
raise RuntimeError('git clone is dirty:\n\n%s' % status)
- unpushedCommits = os.popen('git log origin..').read().strip()
+ branch = os.popen('git rev-parse --abbrev-ref HEAD')
+ unpushedCommits = os.popen('git log origin/%s..' % branch).read().strip()
if len(unpushedCommits) > 0:
raise RuntimeError('There are unpushed commits - "git log origin.." output is:\n\n%s' % unpushedCommits)
[5/6] lucene-solr:branch_6_0: When there are unpushed commits,
print out the full command used to show the commits
Posted by sa...@apache.org.
When there are unpushed commits, print out the full command used to show the commits
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f06a5e53
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f06a5e53
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f06a5e53
Branch: refs/heads/branch_6_0
Commit: f06a5e5374739b3231445adaf800e52b4228192c
Parents: 9568ac4
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:47:06 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon May 23 15:47:06 2016 -0400
----------------------------------------------------------------------
dev-tools/scripts/buildAndPushRelease.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f06a5e53/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index f1a7759..980ef84 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -62,9 +62,10 @@ def getGitRev():
if 'nothing to commit, working directory clean' not in status:
raise RuntimeError('git clone is dirty:\n\n%s' % status)
branch = os.popen('git rev-parse --abbrev-ref HEAD').read().strip()
- unpushedCommits = os.popen('git log origin/%s..' % branch).read().strip()
+ command = 'git log origin/%s..' % branch
+ unpushedCommits = os.popen(command).read().strip()
if len(unpushedCommits) > 0:
- raise RuntimeError('There are unpushed commits - "git log origin.." output is:\n\n%s' % unpushedCommits)
+ raise RuntimeError('There are unpushed commits - "%s" output is:\n\n%s' % (command, unpushedCommits))
print(' git clone is clean')
return os.popen('git rev-parse HEAD').read().strip()