Handle components that don't have associated source code

This commit is contained in:
Dan Hawkins 2018-12-31 16:09:25 +00:00
commit fc17af2c5f

View file

@ -68,23 +68,25 @@ def checkoutreleaserepo(buildmeta, String checkoutfolder) {
def checkoutsourcerepo(buildmeta, String checkoutfolder) {
def String sourcerepo = buildmeta.gitinfo.remoteurl
// Get the latest revision of the source repo without checking out working copy; Check out to a folder unique to component
if (fileExists(checkoutfolder)) {
dir(checkoutfolder) {
sh("""
git reset --hard
git clean -fdx
git pull
# Remove all tags that are not already on the remote
git tag -l | xargs git tag -d >/dev/null
git fetch -t >/dev/null
"""
)
if (sourcerepo) {
// Get the latest revision of the source repo without checking out working copy; Check out to a folder unique to component
if (fileExists(checkoutfolder)) {
dir(checkoutfolder) {
sh("""
git reset --hard
git clean -fdx
git pull
# Remove all tags that are not already on the remote
git tag -l | xargs git tag -d >/dev/null
git fetch -t >/dev/null
"""
)
}
}
}
else {
dir(sourcerepofolder) {
sh("git clone ${sourcerepo} ${checkoutfolder}")
else {
dir(sourcerepofolder) {
sh("git clone ${sourcerepo} ${checkoutfolder}")
}
}
}
}
@ -297,10 +299,15 @@ def gitrelease(buildmeta, previousreleasemeta, String releaserepo, String source
def String srcbuildstamp = "${buildmeta.productinfo.productname}_${buildmeta.productinfo.subcomponentname}_${buildmeta.buildstampinfo.buildstamp}"
def String buildsha = buildmeta.gitinfo.gitrevision
def ArrayList<String> srctaglist = maketaglist(srcbuildstamp, otherreleasetags)
def tagadded = sourcegittags(buildsha, srctaglist)
if (tagadded) {
sourcegitpush(dryrunpush)
if (buildsha) {
def ArrayList<String> srctaglist = maketaglist(srcbuildstamp, otherreleasetags)
def tagadded = sourcegittags(buildsha, srctaglist)
if (tagadded) {
sourcegitpush(dryrunpush)
}
}
else {
summaryappend(",No Src ")
}
}
}