mirror of https://github.com/apache/lucene.git
LUCENE-10200: store git revision in the release folder and read it back from buildAndPushRelease (#419)
This commit is contained in:
parent
1d152c5f67
commit
0544819b78
|
@ -30,7 +30,6 @@ import xml.etree.ElementTree as ET
|
||||||
import scriptutil
|
import scriptutil
|
||||||
|
|
||||||
LOG = '/tmp/release.log'
|
LOG = '/tmp/release.log'
|
||||||
REV_FILE = '/tmp/lucene-rev.txt'
|
|
||||||
dev_mode = False
|
dev_mode = False
|
||||||
|
|
||||||
def log(msg):
|
def log(msg):
|
||||||
|
@ -108,8 +107,6 @@ def prepare(root, version, gpg_key_id, gpg_password, gpg_home=None, sign_gradle=
|
||||||
rev = getGitRev()
|
rev = getGitRev()
|
||||||
print(' git rev: %s' % rev)
|
print(' git rev: %s' % rev)
|
||||||
log('\nGIT rev: %s\n' % rev)
|
log('\nGIT rev: %s\n' % rev)
|
||||||
with open(REV_FILE, mode='wb') as f:
|
|
||||||
f.write(rev.encode('UTF-8'))
|
|
||||||
|
|
||||||
print(' Check DOAP files')
|
print(' Check DOAP files')
|
||||||
checkDOAPfiles(version)
|
checkDOAPfiles(version)
|
||||||
|
@ -203,14 +200,16 @@ def normalizeVersion(tup):
|
||||||
return '.'.join(tup) + suffix
|
return '.'.join(tup) + suffix
|
||||||
|
|
||||||
|
|
||||||
def pushLocal(version, root, rev, rcNum, localDir):
|
def pushLocal(version, root, rcNum, localDir):
|
||||||
print('Push local [%s]...' % localDir)
|
print('Push local [%s]...' % localDir)
|
||||||
os.makedirs(localDir)
|
os.makedirs(localDir)
|
||||||
|
|
||||||
dir = 'lucene-%s-RC%d-rev%s' % (version, rcNum, rev)
|
lucene_dist_dir = '%s/lucene/distribution/build/release' % root
|
||||||
|
rev = open('%s/lucene/distribution/build/release/.gitrev' % root, encoding='UTF-8').read()
|
||||||
|
|
||||||
|
dir = 'lucene-%s-RC%d-rev-%s' % (version, rcNum, rev)
|
||||||
os.makedirs('%s/%s/lucene' % (localDir, dir))
|
os.makedirs('%s/%s/lucene' % (localDir, dir))
|
||||||
print(' Lucene')
|
print(' Lucene')
|
||||||
lucene_dist_dir = '%s/lucene/distribution/build/release' % root
|
|
||||||
os.chdir(lucene_dist_dir)
|
os.chdir(lucene_dist_dir)
|
||||||
print(' archive...')
|
print(' archive...')
|
||||||
if os.path.exists('lucene.tar'):
|
if os.path.exists('lucene.tar'):
|
||||||
|
@ -390,13 +389,12 @@ def main():
|
||||||
c.key_password = None
|
c.key_password = None
|
||||||
|
|
||||||
if c.prepare:
|
if c.prepare:
|
||||||
rev = prepare(c.root, c.version, c.key_id, c.key_password, gpg_home=gpg_home, sign_gradle=c.sign_method_gradle)
|
prepare(c.root, c.version, c.key_id, c.key_password, gpg_home=gpg_home, sign_gradle=c.sign_method_gradle)
|
||||||
else:
|
else:
|
||||||
os.chdir(c.root)
|
os.chdir(c.root)
|
||||||
rev = open(REV_FILE, encoding='UTF-8').read()
|
|
||||||
|
|
||||||
if c.push_local:
|
if c.push_local:
|
||||||
url = pushLocal(c.version, c.root, rev, c.rc_num, c.push_local)
|
url = pushLocal(c.version, c.root, c.rc_num, c.push_local)
|
||||||
else:
|
else:
|
||||||
url = None
|
url = None
|
||||||
|
|
||||||
|
|
|
@ -936,11 +936,11 @@ def make_java_config(parser, java17_home):
|
||||||
return jc(run_java11, java11_home, run_java17, java17_home)
|
return jc(run_java11, java11_home, run_java17, java17_home)
|
||||||
|
|
||||||
version_re = re.compile(r'(\d+\.\d+\.\d+(-ALPHA|-BETA)?)')
|
version_re = re.compile(r'(\d+\.\d+\.\d+(-ALPHA|-BETA)?)')
|
||||||
revision_re = re.compile(r'rev([a-f\d]+)')
|
revision_re = re.compile(r'rev-([a-f\d]+)')
|
||||||
def parse_config():
|
def parse_config():
|
||||||
epilogue = textwrap.dedent('''
|
epilogue = textwrap.dedent('''
|
||||||
Example usage:
|
Example usage:
|
||||||
python3 -u dev-tools/scripts/smokeTestRelease.py https://dist.apache.org/repos/dist/dev/lucene/lucene-6.0.1-RC2-revc7510a0...
|
python3 -u dev-tools/scripts/smokeTestRelease.py https://dist.apache.org/repos/dist/dev/lucene/lucene-9.0.0-RC1-rev-c7510a0...
|
||||||
''')
|
''')
|
||||||
description = 'Utility to test a release.'
|
description = 'Utility to test a release.'
|
||||||
parser = argparse.ArgumentParser(description=description, epilog=epilogue,
|
parser = argparse.ArgumentParser(description=description, epilog=epilogue,
|
||||||
|
|
|
@ -73,7 +73,10 @@ configure(project(":lucene:analysis:kuromoji")) {
|
||||||
// Apply patch via local git.
|
// Apply patch via local git.
|
||||||
project.quietExec {
|
project.quietExec {
|
||||||
workingDir = unpackedDir
|
workingDir = unpackedDir
|
||||||
executable "git" // TODO: better use jgit to apply patch, this is not portable!!!
|
// TODO: Uwe says: better use jgit to apply patch, this is not portable!!!
|
||||||
|
// Dawid answers: (LUCENE-10215) jgit's patch was broken - would not handle binary patches
|
||||||
|
// Seems like this has been fixed: https://gerrit.googlesource.com/jgit/+/10ac4499115965ff10e547a0632c89873a06cf91
|
||||||
|
executable "git"
|
||||||
args += [
|
args += [
|
||||||
"apply",
|
"apply",
|
||||||
file("src/tools/patches/Noun.proper.csv.patch").absolutePath
|
file("src/tools/patches/Noun.proper.csv.patch").absolutePath
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
import org.apache.lucene.gradle.Checksum
|
import org.apache.lucene.gradle.Checksum
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets
|
||||||
|
import java.nio.file.Files
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'signing'
|
id 'signing'
|
||||||
}
|
}
|
||||||
|
@ -73,6 +76,20 @@ task computeChecksums(type: Checksum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
task prepareGitRev() {
|
||||||
|
dependsOn ":gitStatus"
|
||||||
|
|
||||||
|
ext.outputFile = file("${buildDir}/.gitrev")
|
||||||
|
|
||||||
|
outputs.file(ext.outputFile)
|
||||||
|
inputs.property("gitrev", provider { -> rootProject.ext.gitRev })
|
||||||
|
|
||||||
|
doFirst {
|
||||||
|
Files.writeString(ext.outputFile.toPath(), rootProject.ext.gitRev, StandardCharsets.UTF_8)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Assemble everything needed in the release folder structure.
|
// Assemble everything needed in the release folder structure.
|
||||||
task assembleRelease(type: Sync) {
|
task assembleRelease(type: Sync) {
|
||||||
description "Assemble all Lucene artifacts for a release."
|
description "Assemble all Lucene artifacts for a release."
|
||||||
|
@ -85,6 +102,7 @@ task assembleRelease(type: Sync) {
|
||||||
into "maven"
|
into "maven"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
from tasks.prepareGitRev
|
||||||
from tasks.assembleSourceTgz
|
from tasks.assembleSourceTgz
|
||||||
from tasks.assembleBinaryTgz
|
from tasks.assembleBinaryTgz
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,9 @@ and an API that can easily be used to add search capabilities to applications.
|
||||||
* Please join the Lucene-User mailing list by sending a message to:
|
* Please join the Lucene-User mailing list by sending a message to:
|
||||||
java-user-subscribe@lucene.apache.org
|
java-user-subscribe@lucene.apache.org
|
||||||
|
|
||||||
## Files in a binary distribution
|
## Files in this binary distribution
|
||||||
|
|
||||||
The following sub-folders are included in the binary Lucene distribution:
|
The following sub-folders are included in the binary distribution of Lucene:
|
||||||
|
|
||||||
* `bin/`:
|
* `bin/`:
|
||||||
Convenience scripts to launch Lucene Luke and other index-maintenance tools.
|
Convenience scripts to launch Lucene Luke and other index-maintenance tools.
|
||||||
|
@ -40,6 +40,10 @@ The following sub-folders are included in the binary Lucene distribution:
|
||||||
* `licenses/`
|
* `licenses/`
|
||||||
Third-party licenses and notice files.
|
Third-party licenses and notice files.
|
||||||
|
|
||||||
|
Please note that this package does not include all the binary dependencies
|
||||||
|
of all Lucene modules. Up-to-date dependency information for each Lucene
|
||||||
|
module is published to Maven central (as Maven POMs).
|
||||||
|
|
||||||
To review the documentation, read the main documentation page, located at:
|
To review the documentation, read the main documentation page, located at:
|
||||||
`docs/index.html`
|
`docs/index.html`
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue