Merge commit 'b6aa653aeb'
This commit is contained in:
commit
59631ee17a
4 changed files with 36 additions and 7 deletions
|
|
@ -8,8 +8,10 @@ def registerPipelineScriptConfiguration(meta) {
|
|||
registerConfigurationInfo(meta, 'pipeline script', '-', '-', gh.getGitInfo("${autobuilder.getautobuildpath()}"))
|
||||
}
|
||||
|
||||
def gitCheckoutAndRegister(meta, String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) {
|
||||
def gitCheckoutAndRegister(meta, String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true, String filter = '') {
|
||||
def ArrayList<String> sparseitemlist = gh.convertSparseItemsString(filter)
|
||||
gh.gitCheckoutAlt(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone)
|
||||
|
||||
registerConfigurationInfo(meta, tool, gitURL, revision, gh.getGitInfo(targetDir))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,11 +28,16 @@ def Map artifactsImporter(meta, artifactDetails, installerDetails) {
|
|||
|
||||
def importer = load("${autobuilder.commonscripts()}/import/importer.groovy")
|
||||
for (installer in toBuild) {
|
||||
def artifactKey = installerDetails.get(installer)[1]
|
||||
(sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey)
|
||||
if (artifactFetched.get(artifactKey) == null) {
|
||||
def importmeta = importer.artifactimport(meta, sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy)
|
||||
artifactFetched.put(artifactKey, importmeta)
|
||||
def artifactKeys = installerDetails.get(installer)[1]
|
||||
if (artifactKeys instanceof java.lang.String) {
|
||||
artifactKeys = [ artifactKeys ]
|
||||
}
|
||||
for (artifactKey in artifactKeys) {
|
||||
(sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey)
|
||||
if (artifactFetched.get(artifactKey) == null) {
|
||||
def importmeta = importer.artifactimport(meta, sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy)
|
||||
artifactFetched.put(artifactKey, importmeta)
|
||||
}
|
||||
}
|
||||
}
|
||||
return artifactFetched
|
||||
|
|
|
|||
|
|
@ -4,6 +4,21 @@ import hudson.plugins.git.extensions.impl.*
|
|||
|
||||
clh = load("${autobuilder.commonscripts()}/commandline/commandline.groovy")
|
||||
|
||||
def boolean isShallowClonedRepo(String gitrootpath) {
|
||||
def boolean isshallowclone = true
|
||||
|
||||
dir( gitrootpath) {
|
||||
if (isUnix()) {
|
||||
isshallowclone = sh(returnStdout: true, script: "git rev-parse --is-shallow-repository").trim().toBoolean()
|
||||
}
|
||||
else {
|
||||
isshallowclone = bat(returnStdout: true, script: "@git rev-parse --is-shallow-repository").trim().toBoolean()
|
||||
}
|
||||
echo "Repo at ${gitrootpath} is shallow cloned: ${isshallowclone}"
|
||||
}
|
||||
return isshallowclone
|
||||
}
|
||||
|
||||
String getGitInfo(String workingSetRootPath) {
|
||||
dir(workingSetRootPath) {
|
||||
return clh.getCommandOutput('git rev-parse HEAD')
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy")
|
||||
|
||||
def int maxversionnumber() {
|
||||
def int MAXVERSIONNUMBER = 65535
|
||||
return MAXVERSIONNUMBER
|
||||
|
|
@ -15,6 +16,12 @@ def getGitRevision(String gitrootpath, int basebuildnumber) {
|
|||
def String gitrevision
|
||||
def String remoteinfo
|
||||
def String remoteurl
|
||||
|
||||
def boolean isShallowCloned = gh.isShallowClonedRepo(gitrootpath)
|
||||
if (isShallowCloned) {
|
||||
error("Cannot generate a version number from a shallow cloned repo at ${gitrootpath}")
|
||||
}
|
||||
|
||||
dir( gitrootpath) {
|
||||
def int changecount = 0
|
||||
if (isUnix()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue