diff options
author | Andrei Gheorghiu <andrei.gheorghiu@enea.com> | 2016-10-18 15:53:13 +0200 |
---|---|---|
committer | Andrei Gheorghiu <andrei.gheorghiu@enea.com> | 2016-10-18 15:53:13 +0200 |
commit | 18a77b4e5dd658171c3c45b847b1cd7ef6ac864f (patch) | |
tree | bf77cc9c998880fc73da36ca94db8880b1d61777 /Jenkinsfile | |
parent | 775df309c13c98ea3d1622ac40651f59f997359e (diff) | |
download | el_manifests-standard-18a77b4e5dd658171c3c45b847b1cd7ef6ac864f.tar.gz |
changed how we get manifest repo url
Diffstat (limited to 'Jenkinsfile')
-rw-r--r-- | Jenkinsfile | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 409597e..087101e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile | |||
@@ -5,18 +5,27 @@ | |||
5 | MANIFEST_REPOSITORY = null | 5 | MANIFEST_REPOSITORY = null |
6 | BRANCH = env.BRANCH_NAME | 6 | BRANCH = env.BRANCH_NAME |
7 | 7 | ||
8 | node ('master') { | 8 | def scmInstance = scm.getUserRemoteConfigs()[0] |
9 | print 'master node' | 9 | MANIFEST_REPOSITORY = scmInstance.getUrl() |
10 | dir ("../${env.BRANCH_NAME}@script") { | 10 | def git_repo_name = scmInstance.getName() |
11 | def git_remote_url = sh returnStdout: true, script: "git remote get-url origin" | 11 | env.PROFILE = git_repo_name.split('-')[-1] |
12 | def git_repo = git_remote_url.trim().split('/')[-1] | 12 | |
13 | def git_repo_name = git_repo.replace('.git','') | 13 | print "MANIFEST_REPOSITORY: " + MANIFEST_REPOSITORY |
14 | def profile = git_repo_name.split('-')[-1] | 14 | print "git_repo_name: " + git_repo_name |
15 | env.PROFILE = profile | 15 | print "PROFILE: " + env.PROFILE |
16 | MANIFEST_REPOSITORY = git_remote_url.trim() | 16 | |
17 | sh 'echo $PROFILE' | 17 | // node ('master') { |
18 | } | 18 | // print 'master node' |
19 | } | 19 | // dir ("../${env.BRANCH_NAME}@script") { |
20 | // def git_remote_url = sh returnStdout: true, script: "git remote get-url origin" | ||
21 | // def git_repo = git_remote_url.trim().split('/')[-1] | ||
22 | // def git_repo_name = git_repo.replace('.git','') | ||
23 | // def profile = git_repo_name.split('-')[-1] | ||
24 | // env.PROFILE = profile | ||
25 | // MANIFEST_REPOSITORY = git_remote_url.trim() | ||
26 | // sh 'echo $PROFILE' | ||
27 | // } | ||
28 | // } | ||
20 | 29 | ||
21 | fileLoader.withGit('git@git.enea.se:eltf/jenkins.git', 'master', null, '') { | 30 | fileLoader.withGit('git@git.enea.se:eltf/jenkins.git', 'master', null, '') { |
22 | fileLoader.load('freeze_manifest.groovy'); | 31 | fileLoader.load('freeze_manifest.groovy'); |