Skip to content

Commit

Permalink
update validate folder search
Browse files Browse the repository at this point in the history
Signed-off-by: MarkAckert <[email protected]>
  • Loading branch information
MarkAckert committed Sep 18, 2024
1 parent eee19b8 commit 0b15b06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 10 additions & 4 deletions validate/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10735,7 +10735,7 @@ var releaseFilesPattern = `${zoweReleaseJsonObject['zowe']['to']}/org/zowe/${rel
if (validateArtifactoryFolder) {
// check artifactory release pattern
console.log(`Checking if ${releaseVersion} already exists in Artifactory ...`)
var searchResult = searchFolder(releaseFilesPattern)
var searchResult = searchReleaseFolder(releaseFilesPattern)
if (!searchResult || searchResult == null || searchResult == '') {
logValidate(`>>[validate 1/17]>> Target artifactory folder ${releaseFilesPattern} doesn\'t exist.`)
}
Expand Down Expand Up @@ -11212,7 +11212,13 @@ if (validatePswi) {
if (pswi['path']) {
releaseArtifacts['pswi'] = {}
releaseArtifacts['pswi']['source'] = pswi
releaseArtifacts['pswi']['target'] = zoweReleaseJsonObject['zowe']['sourceFiles']['zowe-PSWI-*.pax.Z'].replace(/\*/g, releaseVersion)
if (realPromote) {
releaseArtifacts['pswi']['target'] = zoweReleaseJsonObject['zowe']['sourceFiles']['zowe-PSWI-*.pax.Z'].replace(/\*/g, releaseVersion)

} else {
//nightly artifact does not alter its name, just use the name from staging jfrog folder
releaseArtifacts['pswi']['target'] = pswi['path'].split("/").pop() //pop returns last item in array, ie. part after last slash
}
logValidate(`>>[validate 17/17]>> Found PSWI ${releaseArtifacts['pswi']['source']['path']}.`)
}
}
Expand Down Expand Up @@ -11261,8 +11267,8 @@ fs.writeFileSync(promoteJsonFileNameFull, JSON.stringify(releaseArtifacts, null,
// }
// }

function searchFolder(pattern) {
var cmd = `jfrog rt search --sort-by=created --sort-order=desc ${pattern} | jq -r '.[]'`
function searchReleaseFolder(pattern) {
var cmd = `jfrog rt search --sort-by=created --sort-order=desc --exclusions=*/sbom/* ${pattern} | jq -r '.[]'`
debug(`searchFolder full command: ${cmd}`)
var out = utils.sh(cmd)
if (!out || out == null || out == '') {
Expand Down
6 changes: 3 additions & 3 deletions validate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var releaseFilesPattern = `${zoweReleaseJsonObject['zowe']['to']}/org/zowe/${rel
if (validateArtifactoryFolder) {
// check artifactory release pattern
console.log(`Checking if ${releaseVersion} already exists in Artifactory ...`)
var searchResult = searchFolder(releaseFilesPattern)
var searchResult = searchReleaseFolder(releaseFilesPattern)
if (!searchResult || searchResult == null || searchResult == '') {
logValidate(`>>[validate 1/17]>> Target artifactory folder ${releaseFilesPattern} doesn\'t exist.`)
}
Expand Down Expand Up @@ -636,8 +636,8 @@ fs.writeFileSync(promoteJsonFileNameFull, JSON.stringify(releaseArtifacts, null,
// }
// }

function searchFolder(pattern) {
var cmd = `jfrog rt search --sort-by=created --sort-order=desc ${pattern} | jq -r '.[]'`
function searchReleaseFolder(pattern) {
var cmd = `jfrog rt search --sort-by=created --sort-order=desc --exclusions=*/sbom/* ${pattern} | jq -r '.[]'`
debug(`searchFolder full command: ${cmd}`)
var out = utils.sh(cmd)
if (!out || out == null || out == '') {
Expand Down

0 comments on commit 0b15b06

Please sign in to comment.