summaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-10-06 11:33:51 +0200
committerChristian Poessinger <christian@poessinger.com>2019-10-06 11:33:51 +0200
commit45a9ea3c32183c0b0e7bbcabbe41dbe8d6337744 (patch)
treed37e43a96f1dc34f7da405692ec99cbd4907e548 /Jenkinsfile
parentee11c5034db48b10692cf85b164729b86c259e86 (diff)
downloadvyos-build-45a9ea3c32183c0b0e7bbcabbe41dbe8d6337744.tar.gz
vyos-build-45a9ea3c32183c0b0e7bbcabbe41dbe8d6337744.zip
Jenkins: add getGitRepoName()
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile14
1 files changed, 10 insertions, 4 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index c81dc1d7..34c7b766 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -25,11 +25,17 @@ def getGitRepoURL() {
return scm.userRemoteConfigs[0].url
}
-// Returns true if this is a custom build launched on any project fork,
-// returns false if this is build from git@github.com:vyos/vyos-build.git
+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/<reponame>.
+// <reponame> can be e.g. vyos-1x.git or vyatta-op.git
def isCustomBuild() {
- def gitURI = "git@github.com:vyos/vyos-build.git"
- def httpURI = "https://github.com/vyos/vyos-build.git"
+ // GitHub organisation base URL
+ def gitURI = 'git@github.com:vyos/' + getGitRepoName()
+ def httpURI = 'https://github.com/vyos/' + getGitRepoName()
return ! ((getGitRepoURL() == gitURI) || (getGitRepoURL() == httpURI))
}