firmware_tools/Common_scripts/publishing/utils.groovy

27 lines
843 B
Groovy

// The filepath must end in "<folder>/**" or "<folder>/" - Glob wildcard - as a git sparse checkout
def allowed(String filepath) {
if (filepath.endsWith('/**') || filepath.endsWith('/')) {
def files = findFiles glob: filepath
if (files.length > 0) {
return
} else {
error "There are no files/folders under the publishable item: ${filepath}"
}
}
error "The publishable item: ${filepath} does not end in <folder>/** or <folder>/ (for git sparse checkouts)"
}
// Generate a list of artifact files that are publishable to outside parties
def generatelist(meta, publishable) {
filelist = []
for (filepath in publishable) {
if (filepath != meta.METAARTIFACTS) {
allowed(filepath)
}
meta.addPublishable(filepath)
}
}
return this;