From 341028118d3e6ef001972f0f6e3f57d6669a4a39 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 23 Jun 2020 08:39:22 +0200 Subject: Jenkins: lib: T2625: unbloat ISO build --- Jenkinsfile | 48 ++++-------------------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index d865fea1..d65e65f0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,51 +16,11 @@ @NonCPS -def getGitBranchName() { - def branch = scm.branches[0].name - return branch.split('/')[-1] -} - -def getGitRepoURL() { - return scm.userRemoteConfigs[0].url -} +// Using a version specifier library, use 'current' branch. The underscore (_) +// is not a typo! You need this underscore if the line immediately after the +// @Library annotation is not an import statement! +@Library('vyos-build@current')_ -def getGitRepoName() { - return getGitRepoURL().split('/').last() -} - -// Returns true if this is a custom build launched on any project fork. -// Returns false if this is build from git@github.com:vyos/. -// can be e.g. vyos-1x.git or vyatta-op.git -def isCustomBuild() { - // GitHub organisation base URL - def gitURI = 'git@github.com:vyos/' + getGitRepoName() - def httpURI = 'https://github.com/vyos/' + getGitRepoName() - - return ! ((getGitRepoURL() == gitURI) || (getGitRepoURL() == httpURI)) -} - -def setDescription() { - def item = Jenkins.instance.getItemByFullName(env.JOB_NAME) - - // build up the main description text - def description = "" - description += "

Build VyOS ISO image

" - - if (isCustomBuild()) { - description += "

" - description += "Build not started from official Git repository!
" - description += "
" - description += "Repository: " + getGitRepoURL() + "
" - description += "Branch: " + getGitBranchName() + "
" - description += "

" - } else { - description += "Sources taken from Git branch: " + getGitBranchName() + "
" - } - - item.setDescription(description) - item.save() -} // Only keep the 10 most recent builds def projectProperties = [ -- cgit v1.2.3