diff options
-rw-r--r-- | Jenkinsfile | 14 |
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)) } |