Merge commit '954e216659fc50d6a993ca134035de728fc76d0e'
This commit is contained in:
commit
cac10f4b09
7 changed files with 45 additions and 11 deletions
|
|
@ -34,8 +34,17 @@ def getmetafolderscript() {
|
|||
return metafolderscript
|
||||
}
|
||||
|
||||
def alterreleaserepo(String releaserepo, String releaserepovariantsuffix) {
|
||||
def String altered = releaserepo.trim()
|
||||
|
||||
if (releaserepovariantsuffix?.trim()) {
|
||||
altered = altered.replace("-RELEASE_REPO_VARIANT_SUFFIX-", releaserepovariantsuffix)
|
||||
}
|
||||
return altered
|
||||
}
|
||||
|
||||
// Start up boilderplate
|
||||
def startbuild(script, String productname = PRODUCT_NAME, String subcomponentname = SUBCOMPONENT_NAME, String releaserepo = RELEASE_REPO, String autobuildpath = autobuildroot, String commonscriptspath = commonscriptsroot) {
|
||||
def startbuild(script, String productname = PRODUCT_NAME, String subcomponentname = SUBCOMPONENT_NAME, String releaserepo = RELEASE_REPO, String productvariant = '', String autobuildpath = autobuildroot, String commonscriptspath = commonscriptsroot) {
|
||||
echo "Starting...."
|
||||
|
||||
autobuildroot = autobuildpath
|
||||
|
|
@ -46,14 +55,16 @@ def startbuild(script, String productname = PRODUCT_NAME, String subcomponentnam
|
|||
|
||||
def meta = getmetafolderscript().metareset(script)
|
||||
echo "Product name: ${productname} Subcomponent name: ${subcomponentname}"
|
||||
meta.productinfo.set(productname, subcomponentname)
|
||||
meta.productinfo.set(productname, subcomponentname, productvariant)
|
||||
def now = new Date()
|
||||
now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC'))
|
||||
meta.jenkinsbuildinfo.set(JOB_NAME, BUILD_ID.toInteger(), NODE_NAME, now.toString())
|
||||
|
||||
def rr = load("${commonscripts()}/release/registerrepo.groovy")
|
||||
echo "Release repo: ${releaserepo}"
|
||||
rr.registerrepo(meta, releaserepo)
|
||||
def String alteredreleaserepo = alterreleaserepo(releaserepo, productvariant)
|
||||
|
||||
echo "Release repo: ${alteredreleaserepo}"
|
||||
rr.registerrepo(meta, alteredreleaserepo)
|
||||
|
||||
def ch = load("${commonscripts()}/configuration/configuration.groovy")
|
||||
ch.registerPipelineScriptConfiguration(meta)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ pipeline {
|
|||
stage('Copying logic artifacts') {
|
||||
steps {
|
||||
script {
|
||||
importer.artifactimport(meta, LOGIC_ARTIFACT_LOCATION, LOGIC_ARTIFACT_PROJECT, LOGIC_ARTIFACT_BUILD_SELECTOR, LOGIC_RELEASE_REPO, LOGIC_RELEASE_REVISION, LOGICDEST)
|
||||
def logicoptions = importer.getNewImportOptions()
|
||||
logicoptions.source(LOGIC_ARTIFACT_LOCATION, LOGIC_ARTIFACT_PROJECT, LOGIC_ARTIFACT_BUILD_SELECTOR, LOGIC_ARTIFACT_RELEASE_REPO, LOGIC_ARTIFACT_RELEASE_REVISION)
|
||||
importer.artifactimport(meta, logicoptions, LOGICDEST)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,14 +22,16 @@ abstract class GISJsonSerialised implements Serializable {
|
|||
class ProductInfo extends GISJsonSerialised {
|
||||
String productname
|
||||
String subcomponentname
|
||||
String variant
|
||||
|
||||
ProductInfo(script, productname = "", subcomponentname = "") {
|
||||
ProductInfo(script, productname = "", subcomponentname = "", variant = "") {
|
||||
super(script)
|
||||
this.productname = productname
|
||||
this.subcomponentname = subcomponentname
|
||||
this.variant = variant
|
||||
}
|
||||
|
||||
void set(String productname, String subcomponentname) {
|
||||
void set(String productname, String subcomponentname, String variant = '') {
|
||||
// Make sure the fields can be used in git tags
|
||||
def int pstatus = 0
|
||||
if (script.isUnix()) {
|
||||
|
|
@ -51,19 +53,34 @@ class ProductInfo extends GISJsonSerialised {
|
|||
if (sstatus > 0) {
|
||||
script.error("The subcomponent name: ${subcomponentname} needs to be renamed as it cannot be used in a git tag name")
|
||||
}
|
||||
if (variant) {
|
||||
def int vstatus = 0
|
||||
if (script.isUnix()) {
|
||||
vstatus = script.sh(script: "git check-ref-format --normalize \"refs/tags/${variant}\" >/dev/null 2>/dev/null", , returnStatus: true)
|
||||
}
|
||||
else {
|
||||
vstatus = script.bat(script: "@git check-ref-format --normalize \"refs/tags/${variant}\" > NUL 2> NUL", , returnStatus: true)
|
||||
}
|
||||
if (vstatus > 0) {
|
||||
script.error("The subcomponent name: ${variant} needs to be renamed as it cannot be used in a git tag name")
|
||||
}
|
||||
}
|
||||
this.productname = productname
|
||||
this.subcomponentname = subcomponentname
|
||||
this.variant = variant
|
||||
}
|
||||
|
||||
void deserialiseJson(rawmeta) {
|
||||
productname = rawmeta['productname']
|
||||
subcomponentname = rawmeta['subcomponentname']
|
||||
variant = rawmeta['variant'] ?: ""
|
||||
}
|
||||
|
||||
LinkedHashMap serialisationdata() {
|
||||
def data = [
|
||||
'productname' : productname,
|
||||
'subcomponentname' : subcomponentname,
|
||||
'variant' : variant,
|
||||
]
|
||||
return data
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ class DebRootDefinition {
|
|||
String GIS_OPT_SCRIPTS_CONTROL
|
||||
String GIS_OPT_WWW
|
||||
String GIS_OPT_OTHER
|
||||
String GIS_OPT_KERNEL
|
||||
String GIS_OPT_LOGIC
|
||||
String GIS_OPT_PRINTHEAD
|
||||
|
||||
|
|
@ -45,6 +46,7 @@ class DebRootDefinition {
|
|||
GIS_OPT_SCRIPTS_CONTROL = "${DEBPATH}/opt/gis/scripts/control"
|
||||
GIS_OPT_WWW = "${DEBPATH}/opt/gis/www"
|
||||
GIS_OPT_OTHER = "${DEBPATH}/opt/gis/other"
|
||||
GIS_OPT_KERNEL = "${DEBPATH}/opt/gis/kernel"
|
||||
GIS_OPT_LOGIC = "${DEBPATH}/opt/gis/logic"
|
||||
GIS_OPT_PRINTHEAD = "${DEBPATH}/opt/gis/printhead"
|
||||
|
||||
|
|
@ -70,7 +72,6 @@ def buildPackage(String packageout, String uniquepackageout, DebRootDefinition p
|
|||
|
||||
cp -v -r "${packagedefs.PACKAGE_SOURCE_ROOT}/${packagedefs.PACKAGE_SOURCE_FOLDER_NAME}"/* "${packagedefs.DEBPATH}"
|
||||
|
||||
sudo chmod -v -R 755 "${packagedefs.DEBPATH}"
|
||||
sudo chown -v -R root: "${packagedefs.DEBPATH}"
|
||||
|
||||
mkdir -v -p "${packageout}"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy")
|
||||
|
||||
markunstable = false
|
||||
unstablereason = ""
|
||||
|
||||
|
|
@ -373,7 +375,8 @@ def gitrelease(buildmeta, previousreleasemeta, String releaserepo, String source
|
|||
|
||||
def releasecomponent(toplevelbuildmeta, buildinfo, String otherreleasetags, String dryrunpush) {
|
||||
def buildmeta = buildinfo.meta
|
||||
def String uniquefolder = "${buildmeta.productinfo.productname}_${buildmeta.productinfo.subcomponentname}"
|
||||
def uriconverted = gh.uniquereporootname(buildmeta.gitinfo.remoteurl)
|
||||
def String uniquefolder = "${buildmeta.productinfo.productname}_${buildmeta.productinfo.subcomponentname}_${uriconverted}"
|
||||
def String uniquefolderforrepo = "${releaserepofolder}/${uniquefolder}"
|
||||
def String uniquefoldertemp = "${tempfolder}/${uniquefolder}"
|
||||
def String uniquefolderforsourcerepo = "${sourcerepofolder}/${uniquefolder}"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pipeline {
|
|||
steps {
|
||||
script {
|
||||
autobuilderscript = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy")
|
||||
meta = autobuilderscript.startbuild(this, PRODUCT_NAME, SUBCOMPONENT_NAME, RELEASE_REPO)
|
||||
meta = autobuilderscript.startnonbuild(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ def main(argv):
|
|||
pattern = args.pattern
|
||||
substitute = args.substitute
|
||||
|
||||
print("Converting incidences of {0} with {1} in file: {2}\n".format(pattern, substitute, filetoconvert))
|
||||
print("Converting instances of {0} with {1} in file: {2}\n".format(pattern, substitute, filetoconvert))
|
||||
|
||||
with open(filetoconvert,'r') as c:
|
||||
fileread = c.read()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue