You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ja...@apache.org on 2022/03/04 21:47:46 UTC
[solr] branch branch_9x updated: SOLR-16041: Prepare Smoketester to be able to run on local release folder in Jenkins (#694)
This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new d0099e1 SOLR-16041: Prepare Smoketester to be able to run on local release folder in Jenkins (#694)
d0099e1 is described below
commit d0099e1fd5bae25b86fe524f010ab24e11367dce
Author: Jan Høydahl <ja...@users.noreply.github.com>
AuthorDate: Fri Mar 4 17:22:18 2022 +0100
SOLR-16041: Prepare Smoketester to be able to run on local release folder in Jenkins (#694)
Co-authored-by: Christine Poerschke <cp...@apache.org>
(cherry picked from commit 30bb3202c4e182a95ffb0ffbc3729c585b4b3b3e)
---
dev-tools/scripts/buildAndPushRelease.py | 4 +++-
dev-tools/scripts/smokeTestRelease.py | 29 ++++++++++++++++++-----------
solr/distribution/build.gradle | 2 +-
solr/docker/build.gradle | 7 +++++++
4 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 22ca14e..98437f8 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' % version
if 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.py
index c3a828f..e03ab1d 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 directory
if 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 = subURL
if solrPath is None:
raise RuntimeError('could not find solr subdir')
diff --git a/solr/distribution/build.gradle b/solr/distribution/build.gradle
index 10610b0..4f89ed5 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.gradle
index 0c22327..efcae75 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'
}