Jenkins 2: how to know which git repository triggered the jenkins job
up vote
0
down vote
favorite
This is duplicated with: how to know which git branch triggered the jenkins job, however the answer below it cannot solve, which is:
commit = checkout scm
println commit.GIT_URL
above code could just return the GIT_URL that which repository the Jenskinsfile on.
So I have to answer again:
My job polling three GIT repository:
repos-A, repos-B, repos-C
with follow code:
triggers
pollSCM '* * * * *'
checkout changelog: false, scm: [$class: 'GitSCM', branches: [[name: 'refs/heads/master']], doGenerateSubmoduleConfigurations: false, extensions: , submoduleCfg: , userRemoteConfigs: [...]
checkout changelog: false, scm: [...]
checkout changelog: false, scm: [...]
Any of their commit will trigger my job, then during the job execution, I need to tell which repository trigger the job, to determine different stage to going on.
How can I get the repository info?
git jenkins
New contributor
add a comment |
up vote
0
down vote
favorite
This is duplicated with: how to know which git branch triggered the jenkins job, however the answer below it cannot solve, which is:
commit = checkout scm
println commit.GIT_URL
above code could just return the GIT_URL that which repository the Jenskinsfile on.
So I have to answer again:
My job polling three GIT repository:
repos-A, repos-B, repos-C
with follow code:
triggers
pollSCM '* * * * *'
checkout changelog: false, scm: [$class: 'GitSCM', branches: [[name: 'refs/heads/master']], doGenerateSubmoduleConfigurations: false, extensions: , submoduleCfg: , userRemoteConfigs: [...]
checkout changelog: false, scm: [...]
checkout changelog: false, scm: [...]
Any of their commit will trigger my job, then during the job execution, I need to tell which repository trigger the job, to determine different stage to going on.
How can I get the repository info?
git jenkins
New contributor
This might help: stackoverflow.com/questions/45684941/…
– ANIL
13 hours ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This is duplicated with: how to know which git branch triggered the jenkins job, however the answer below it cannot solve, which is:
commit = checkout scm
println commit.GIT_URL
above code could just return the GIT_URL that which repository the Jenskinsfile on.
So I have to answer again:
My job polling three GIT repository:
repos-A, repos-B, repos-C
with follow code:
triggers
pollSCM '* * * * *'
checkout changelog: false, scm: [$class: 'GitSCM', branches: [[name: 'refs/heads/master']], doGenerateSubmoduleConfigurations: false, extensions: , submoduleCfg: , userRemoteConfigs: [...]
checkout changelog: false, scm: [...]
checkout changelog: false, scm: [...]
Any of their commit will trigger my job, then during the job execution, I need to tell which repository trigger the job, to determine different stage to going on.
How can I get the repository info?
git jenkins
New contributor
This is duplicated with: how to know which git branch triggered the jenkins job, however the answer below it cannot solve, which is:
commit = checkout scm
println commit.GIT_URL
above code could just return the GIT_URL that which repository the Jenskinsfile on.
So I have to answer again:
My job polling three GIT repository:
repos-A, repos-B, repos-C
with follow code:
triggers
pollSCM '* * * * *'
checkout changelog: false, scm: [$class: 'GitSCM', branches: [[name: 'refs/heads/master']], doGenerateSubmoduleConfigurations: false, extensions: , submoduleCfg: , userRemoteConfigs: [...]
checkout changelog: false, scm: [...]
checkout changelog: false, scm: [...]
Any of their commit will trigger my job, then during the job execution, I need to tell which repository trigger the job, to determine different stage to going on.
How can I get the repository info?
git jenkins
git jenkins
New contributor
New contributor
edited 13 hours ago
New contributor
asked 14 hours ago
Du Ying
11
11
New contributor
New contributor
This might help: stackoverflow.com/questions/45684941/…
– ANIL
13 hours ago
add a comment |
This might help: stackoverflow.com/questions/45684941/…
– ANIL
13 hours ago
This might help: stackoverflow.com/questions/45684941/…
– ANIL
13 hours ago
This might help: stackoverflow.com/questions/45684941/…
– ANIL
13 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Du Ying is a new contributor. Be nice, and check out our Code of Conduct.
Du Ying is a new contributor. Be nice, and check out our Code of Conduct.
Du Ying is a new contributor. Be nice, and check out our Code of Conduct.
Du Ying is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224045%2fjenkins-2-how-to-know-which-git-repository-triggered-the-jenkins-job%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
This might help: stackoverflow.com/questions/45684941/…
– ANIL
13 hours ago