Commit c85d2e97 authored by Ben Cooksley's avatar Ben Cooksley

Use the diverted install prefix when running appstream compliance checks.

Fixes T6247
parent b151f6ae
...@@ -11,6 +11,7 @@ parser.add_argument('--project', type=str, required=True) ...@@ -11,6 +11,7 @@ parser.add_argument('--project', type=str, required=True)
parser.add_argument('--branchGroup', type=str, required=True) parser.add_argument('--branchGroup', type=str, required=True)
parser.add_argument('--platform', type=str, required=True) parser.add_argument('--platform', type=str, required=True)
parser.add_argument('--usingInstall', type=str, required=True) parser.add_argument('--usingInstall', type=str, required=True)
parser.add_argument('--withDiverted', type=str, required=True)
arguments = parser.parse_args() arguments = parser.parse_args()
# Load our build specification, which governs how we handle this build # Load our build specification, which governs how we handle this build
...@@ -25,9 +26,20 @@ if sys.platform != "linux" or not buildSpecification['do-appstream-check']: ...@@ -25,9 +26,20 @@ if sys.platform != "linux" or not buildSpecification['do-appstream-check']:
# Bail! # Bail!
sys.exit(0) sys.exit(0)
# Before we can process it, we need to determine which prefix to check
installRoot = arguments.installTo
if arguments.withDiverted != None:
installRoot = os.path.join( arguments.withDiverted, CommonUtils.makePathRelative(arguments.installTo) )
# Make sure we have Appstream metadata to process
appstreamDirectory = os.path.join( installRoot, 'share', 'metainfo' )
if not os.path.exists( appstreamDirectory ):
# Bail!
sys.exit(0)
# Determine the command we need to run # Determine the command we need to run
commandToRun = "appstreamcli validate --pedantic {0}/share/metainfo/*" commandToRun = "appstreamcli validate --pedantic {0}/*"
commandToRun = commandToRun.format( arguments.usingInstall ) commandToRun = commandToRun.format( appstreamDirectory )
# Now run it! # Now run it!
try: try:
......
...@@ -115,7 +115,7 @@ timestamps { ...@@ -115,7 +115,7 @@ timestamps {
stage('Checking Code Quality') { stage('Checking Code Quality') {
// Perform Appstream Compliance Checks // Perform Appstream Compliance Checks
sh "python3 -u ci-tooling/helpers/check-appstream-compliance.py --product ${productName} --project ${projectName} --branchGroup ${branchGroup} --platform ${currentPlatform} --usingInstall '$HOME/install-prefix/'" sh "python3 -u ci-tooling/helpers/check-appstream-compliance.py --product ${productName} --project ${projectName} --branchGroup ${branchGroup} --platform ${currentPlatform} --usingInstall '$HOME/install-prefix/' --withDiverted '$WORKSPACE/install-divert/'"
// cppcheck is not supported by Pipeline at the moment, so we don't run that for now // cppcheck is not supported by Pipeline at the moment, so we don't run that for now
// See https://issues.jenkins-ci.org/browse/JENKINS-35096 // See https://issues.jenkins-ci.org/browse/JENKINS-35096
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment