Apache Solr open-source search software
SOLR-16041: Prepare Smoketester to be able to run on local release folder in Jenkins (#694)
Jan Høydahl30bb3202c4e1
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.pyindex 22ca14e0165..98437f8c332 100755--- a/dev-tools/scripts/buildAndPushRelease.py+++ b/dev-tools/scripts/buildAndPushRelease.py@@ -122,7 +122,9 @@ def prepare(root, version, gpg_key_id, gpg_password, gpg_home=None, sign_gradle=' -Dversion.release=%s' % versionif dev_mode:cmd += ' -Pvalidation.git.failOnModified=false'- if gpg_key_id is not None:+ if gpg_key_id is None:+ cmd += ' -Psign=false -x signJarsPublication' # Disable signing if no key provided to script+ else:cmd += ' -Psign --max-workers 2'if sign_gradle:print(" Signing method is gradle java-plugin")diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.pyindex c3a828fae95..e03ab1de330 100755--- a/dev-tools/scripts/smokeTestRelease.py+++ b/dev-tools/scripts/smokeTestRelease.py@@ -115,7 +115,7 @@ def noJavaPackageClasses(desc, file):with zipfile.ZipFile(file) as z2:for name2 in z2.namelist():if name2.endswith('.class') and (name2.startswith('java/') or name2.startswith('javax/')):- raise RuntimeError('%s contains sheisty class "%s"' % (desc, name2))+ raise RuntimeError('%s contains java or javax class "%s"' % (desc, name2))def decodeUTF8(bytes):@@ -200,7 +200,7 @@ def checkAllJARs(topDir, gitRevision, version):if normRoot.endswith('/server/lib'):# Solr's example intentionally ships servlet JAR:continue-+for file in files:if file.lower().endswith('.jar'):if ((normRoot.endswith('/modules/extraction/lib') and file.startswith('jakarta.activation-'))@@ -231,6 +231,8 @@ def checkSigs(urlString, version, tmpDir, isSigned, keysFile):artifacts = []for text, subURL in ents:+ if text == '.gitrev':+ continue # Allow this in the distribution build directoryif text == 'KEYS':raise RuntimeError('solr: release dir should not contain a KEYS file - only toplevel /dist/solr/KEYS is used')elif text == 'maven/':@@ -716,7 +718,7 @@ def testSolrExample(unpackPath, javaPath, isSrc):if not cygwin:subprocess.call(['bin/solr','stop','-p','8983'])else:- subprocess.call('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd stop -p 8983', shell=True)+ subprocess.call('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd stop -p 8983', shell=True)except:print(' Stop failed due to: '+sys.exc_info()[0])@@ -725,8 +727,8 @@ def testSolrExample(unpackPath, javaPath, isSrc):if not cygwin:runExampleStatus = subprocess.call(['bin/solr','-e','techproducts'])else:- runExampleStatus = subprocess.call('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd -e techproducts', shell=True)-+ runExampleStatus = subprocess.call('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd -e techproducts', shell=True)+if runExampleStatus != 0:raise RuntimeError('Failed to run the techproducts example, check log for previous errors.')@@ -749,17 +751,17 @@ def testSolrExample(unpackPath, javaPath, isSrc):os.chdir(unpackPath+'/solr')else:os.chdir(unpackPath)-+if not cygwin:subprocess.call(['bin/solr','stop','-p','8983'])else:- subprocess.call('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd stop -p 8983', shell=True)+ subprocess.call('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd stop -p 8983', shell=True)if isSrc:os.chdir(unpackPath+'/solr')else:os.chdir(unpackPath)-+def removeTrailingZeros(version):return re.sub(r'(\.0)*$', '', version)@@ -1104,9 +1106,14 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,print(' unshortened: %s' % newBaseURL)baseURL = newBaseURL- for text, subURL in getDirEntries(baseURL):- if text.lower().find('solr') != -1:- solrPath = subURL+ if baseURL.endswith('distribution/build/release'):+ # Used when building release locally in Jenkins+ solrPath = baseURL+ else:+ # An ordinary release has a 'solr' sub folder+ for text, subURL in getDirEntries(baseURL):+ if text.lower() == 'solr/':+ solrPath = subURLif solrPath is None:raise RuntimeError('could not find solr subdir')diff --git a/solr/distribution/build.gradle b/solr/distribution/build.gradleindex 10610b01cd4..4f89ed5f3ad 100644--- a/solr/distribution/build.gradle+++ b/solr/distribution/build.gradle@@ -59,7 +59,7 @@ configurations {dependencies {changesHtml project(path: ":solr:documentation", configuration: "changesHtml")- docker project(path: ':solr:docker', configuration: project.ext.withSignedArtifacts ? 'packagingOfficial' : 'packaging')+ docker project(path: ':solr:docker', configuration: project.ext.withSignedArtifacts ? 'packagingOfficial' : 'packagingLocal')}def distTarTask = rootProject.getTasksByName("distTar", true)[0]diff --git a/solr/docker/build.gradle b/solr/docker/build.gradleindex 0c2232789b2..efcae7532eb 100644--- a/solr/docker/build.gradle+++ b/solr/docker/build.gradle@@ -42,6 +42,9 @@ configurations {packaging {canBeResolved = true}+ packagingLocal {+ canBeResolved = true+ }packagingOfficial {canBeResolved = true}@@ -72,6 +75,10 @@ dependencies {builtBy 'assemblePackaging'}+ packagingLocal files("${dockerfilesDirPath}/Dockerfile.local") {+ builtBy 'createDockerfileLocal'+ }+packagingOfficial files("${dockerfilesDirPath}/Dockerfile.official") {builtBy 'createDockerfileOfficial'}