Refactor some console messages

This commit is contained in:
Jim Nicholson 2024-02-14 00:34:59 -08:00
parent 9e85196fe8
commit 6d901e46c6
3 changed files with 10 additions and 10 deletions

View File

@ -45,10 +45,10 @@ Map call(Map config = [:], Map queryParams = [:]) {
plugin. */
/* groovylint-disable-next-line Instanceof */
if (latest.version instanceof net.sf.json.JSONNull && latest.name) {
echo 'Search result version field was null, looking in name field for a version'
echo 'Info: Search result version field was null, looking in name field for a version'
java.util.regex.Matcher match = (latest.name =~ /(?<=-)(\d+\.\d+\.\d+)(?=[\.-].*)/)
if (!match) {
echo "Match: ${match}"
echo "Error: Match: ${match}"
error("Regular expression match failed for latest.name: ${latest.name}")
}
version = match[0][1]
@ -57,7 +57,7 @@ Map call(Map config = [:], Map queryParams = [:]) {
}
} else {
version = '0.0.0'
echo 'INFO: No matching assets found, assuming this is the first version.'
echo 'Info: No matching assets found, assuming this is the first version.'
}
return version
}

View File

@ -24,7 +24,7 @@ void call(Map config = [:], Closure body = { }) {
runConfig.separator +
runConfig.extension
echo "Will tag result as: ${archiveName}"
echo "Info: Will archive results as: ${archiveName}."
sh """
if command -v "${runConfig.archiveCmd}"; then

View File

@ -27,36 +27,36 @@ void call(Map config = [:], Closure body) {
printBanner(runConfig.stepName)
ansiColor('css') {
if (fileExists(runConfig.venvDir) && runConfig.recreateVenv) {
echo 'INFO: Removing old venv from workspace.'
echo 'Info: Removing old venv from workspace.'
dir(runConfig.venvDir) {
deleteDir()
}
}
if (!fileExists(runConfig.venvDir)) {
echo "INFO: Creating new venv in ${runConfig.venvDir}."
echo "Info: Creating new venv in ${runConfig.venvDir}."
sh "${runConfig.pythonPath} -m venv ${runConfig.venvDir}"
}
withEnv(venvEnv) {
List setupCmds = []
if (runConfig.updatePip) {
echo 'INFO: Will update pip if an update is available.'
echo 'Info: Will update pip if an update is available.'
updateCmd = "${venvPython.join('/')} -m pip install --upgrade pip"
setupCmds.add(updateCmd)
}
if (runConfig.installPipTools) {
echo 'INFO: Will install pip-tools.'
echo 'Info: Will install pip-tools.'
installCmd = "${venvPython.join('/')} -m pip install pip-tools"
setupCmds.add(installCmd)
}
if (fileExists(runConfig.requirementsFile)) {
echo "INFO: Will resolve requirements from ${runConfig.requirementsFile}."
echo "Info: Will resolve requirements from ${runConfig.requirementsFile}."
reqCmd = "pip-compile ${runConfig.requirementsFile}"
setupCmds.add(reqCmd)
}
if (!setupCmds.isEmpty()) {
echo 'INFO: Beginning venv setup.'
echo 'Info: Beginning venv setup.'
sh setupCmds.join('\n')
}
echo 'Executing closure...'