Discussion:
Connecting Jenkins to GitHub
HB
2018-10-28 21:07:44 UTC
Permalink
All,

I am completely new to Jenkins but am tasked with getting a working
environment up and running.

Everything appears to running well as follows:

RHEL 7.5
Jenkins ver 2.148

Installed using the below yum repo:
[jenkins]
name=Jenkins
baseurl=http://pkg.jenkins.io/redhat
gpgcheck=1

I have it configured to use Active Directory for user authentication and
roles.

My questions revolve around getting Jenkins connected to GitHub. I am
following these steps:

https://gist.github.com/misterbrownlee/3708738

I have created a 'utility user' (say git-jenkins) in GitHub that will
ideally be the user that Jenkins uses to connect to GitHub. I also have
created a key pair for the connection. Since Jenkins runs as user
'jenkins' on the server, I created the key pair as this user and imported
the public key to the 'git-jenkins' utility user in GitHub.

I also set:

Global Config user.name Value
Global Config user.email Value

to the 'git-jenkins' GitHub utility user via: Manage Jenkins --> Configure
System.


I am trying to follow these steps:

- Make sure the Manage Jenkins > Configure System has the right path to git
- Set the global git user.name and user.email to match your global config
options
- Configure GitHub Web Hook to Manually manage hook urls
- Click the (?) icon next to the manual option and copy the hook URL you
see there
- Optionally set the service account email as the Jenkins sender email
address

However, I am not able to successfully 'test connection' to GitHub in
Manage Jenkins --> Configure System..

I am able to clone the repository from the command line with a different
user than the 'git-jenkins' utility user via Jenkins. But since the
'jenkins' user on the server does not have a login shell out of the box, I
am unable to test from the command line.

Can anyone point me in the right direction here as to what I might be
missing? I hope I have not confused the situation too much.

Thanks in advance,

HB
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert Rajendra
2018-10-29 02:06:42 UTC
Permalink
To integrate Jenkins with github. You need to install gith , github plugins
with ssh plugin you can read the docs regarding these and get the work done
Post by HB
All,
I am completely new to Jenkins but am tasked with getting a working
environment up and running.
RHEL 7.5
Jenkins ver 2.148
[jenkins]
name=Jenkins
baseurl=http://pkg.jenkins.io/redhat
gpgcheck=1
I have it configured to use Active Directory for user authentication and
roles.
My questions revolve around getting Jenkins connected to GitHub. I am
https://gist.github.com/misterbrownlee/3708738
I have created a 'utility user' (say git-jenkins) in GitHub that will
ideally be the user that Jenkins uses to connect to GitHub. I also have
created a key pair for the connection. Since Jenkins runs as user
'jenkins' on the server, I created the key pair as this user and imported
the public key to the 'git-jenkins' utility user in GitHub.
Global Config user.name Value
Global Config user.email Value
to the 'git-jenkins' GitHub utility user via: Manage Jenkins --> Configure
System.
- Make sure the Manage Jenkins > Configure System has the right path to git
- Set the global git user.name and user.email to match your global config
options
- Configure GitHub Web Hook to Manually manage hook urls
- Click the (?) icon next to the manual option and copy the hook URL you
see there
- Optionally set the service account email as the Jenkins sender email
address
However, I am not able to successfully 'test connection' to GitHub in
Manage Jenkins --> Configure System..
I am able to clone the repository from the command line with a different
user than the 'git-jenkins' utility user via Jenkins. But since the
'jenkins' user on the server does not have a login shell out of the box, I
am unable to test from the command line.
Can anyone point me in the right direction here as to what I might be
missing? I hope I have not confused the situation too much.
Thanks in advance,
HB
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CABbC_KFCFJPx8X1ms3Xe%2BQJeqCSK-LTJxrPM-_uxCHNK7G73HQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
HB
2018-10-29 03:20:31 UTC
Permalink
Thank you for the reply. I am not seeing 'gith' plugin, is that short for
a plugin? Here are the plugins that I have installed referring to git and
ssh:

Git client plugin
2.7.3
Git plugin
3.9.1
GIT server Plugin
1.7
GitHub API Plugin
1.92
GitHub Branch Source Plugin
2.4.1
GitHub plugin
1.29.3

SSH Credentials Plugin
1.14
SSH Slaves plugin
1.28.1

Am I missing plugins that you are referring to? Thanks again, any guidance
is greatly appreciated..

HB
Post by Robert Rajendra
To integrate Jenkins with github. You need to install gith , github
plugins with ssh plugin you can read the docs regarding these and get the
work done
Post by HB
All,
I am completely new to Jenkins but am tasked with getting a working
environment up and running.
RHEL 7.5
Jenkins ver 2.148
[jenkins]
name=Jenkins
baseurl=http://pkg.jenkins.io/redhat
gpgcheck=1
I have it configured to use Active Directory for user authentication and
roles.
My questions revolve around getting Jenkins connected to GitHub. I am
https://gist.github.com/misterbrownlee/3708738
I have created a 'utility user' (say git-jenkins) in GitHub that will
ideally be the user that Jenkins uses to connect to GitHub. I also have
created a key pair for the connection. Since Jenkins runs as user
'jenkins' on the server, I created the key pair as this user and imported
the public key to the 'git-jenkins' utility user in GitHub.
Global Config user.name Value
Global Config user.email Value
to the 'git-jenkins' GitHub utility user via: Manage Jenkins -->
Configure System.
- Make sure the Manage Jenkins > Configure System has the right path to git
- Set the global git user.name and user.email to match your global
config options
- Configure GitHub Web Hook to Manually manage hook urls
- Click the (?) icon next to the manual option and copy the hook URL you
see there
- Optionally set the service account email as the Jenkins sender email
address
However, I am not able to successfully 'test connection' to GitHub in
Manage Jenkins --> Configure System..
I am able to clone the repository from the command line with a different
user than the 'git-jenkins' utility user via Jenkins. But since the
'jenkins' user on the server does not have a login shell out of the box, I
am unable to test from the command line.
Can anyone point me in the right direction here as to what I might be
missing? I hope I have not confused the situation too much.
Thanks in advance,
HB
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/84ebfffc-fc47-455c-9115-ae2660086196%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
sagar utekar
2018-10-29 03:32:32 UTC
Permalink
Hi,

Search for a GitHub integration plugin.

Here is a YouTube video link you can refer -


Thank you.
Post by HB
Thank you for the reply. I am not seeing 'gith' plugin, is that short for
a plugin? Here are the plugins that I have installed referring to git and
Git client plugin
2.7.3
Git plugin
3.9.1
GIT server Plugin
1.7
GitHub API Plugin
1.92
GitHub Branch Source Plugin
2.4.1
GitHub plugin
1.29.3
SSH Credentials Plugin
1.14
SSH Slaves plugin
1.28.1
Am I missing plugins that you are referring to? Thanks again, any
guidance is greatly appreciated..
HB
Post by Robert Rajendra
To integrate Jenkins with github. You need to install gith , github
plugins with ssh plugin you can read the docs regarding these and get the
work done
Post by HB
All,
I am completely new to Jenkins but am tasked with getting a working
environment up and running.
RHEL 7.5
Jenkins ver 2.148
[jenkins]
name=Jenkins
baseurl=http://pkg.jenkins.io/redhat
gpgcheck=1
I have it configured to use Active Directory for user authentication and
roles.
My questions revolve around getting Jenkins connected to GitHub. I am
https://gist.github.com/misterbrownlee/3708738
I have created a 'utility user' (say git-jenkins) in GitHub that will
ideally be the user that Jenkins uses to connect to GitHub. I also have
created a key pair for the connection. Since Jenkins runs as user
'jenkins' on the server, I created the key pair as this user and imported
the public key to the 'git-jenkins' utility user in GitHub.
Global Config user.name Value
Global Config user.email Value
to the 'git-jenkins' GitHub utility user via: Manage Jenkins -->
Configure System.
- Make sure the Manage Jenkins > Configure System has the right path to git
- Set the global git user.name and user.email to match your global
config options
- Configure GitHub Web Hook to Manually manage hook urls
- Click the (?) icon next to the manual option and copy the hook URL you
see there
- Optionally set the service account email as the Jenkins sender email
address
However, I am not able to successfully 'test connection' to GitHub in
Manage Jenkins --> Configure System..
I am able to clone the repository from the command line with a different
user than the 'git-jenkins' utility user via Jenkins. But since the
'jenkins' user on the server does not have a login shell out of the box, I
am unable to test from the command line.
Can anyone point me in the right direction here as to what I might be
missing? I hope I have not confused the situation too much.
Thanks in advance,
HB
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/84ebfffc-fc47-455c-9115-ae2660086196%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/84ebfffc-fc47-455c-9115-ae2660086196%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAH_GKWvy2wekc4Umhf85A_eEjnqi3%3DsQPK1S3kB%3DeS7UCva44g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
HB
2018-10-29 04:21:13 UTC
Permalink
Thank you. After installing the GitHub integration plugin and watching the
video, I was able to create a project just as in the video.

My GitHub repository contains only the README.md file as well, however the
difference is that my repo is private. The item I create to my private
repo on GitHub is not requiring that I add any credentials. Despite not
creating any credentials after clicking the git radio button under 'Source
Code Management', I can just save the item successfully. I can also click
on the GitHub link within the project and it takes me right to the repo in
GitHub.

Does this sound correct? I feel like it should require defining
credentials to successfully connect to GitHub. Or is it that I am being
successfully connected via the public key that I put in place on the GitHub
side? Or is it possibly a cookie that is allowing the connection? Is that
something I can verify some how?

Thanks,

HB
Post by sagar utekar
Hi,
Search for a GitHub integration plugin.
Here is a YouTube video link you can refer -
http://youtu.be/Z3S2gMBUkBo
Thank you.
Post by HB
Thank you for the reply. I am not seeing 'gith' plugin, is that short
for a plugin? Here are the plugins that I have installed referring to git
Git client plugin
2.7.3
Git plugin
3.9.1
GIT server Plugin
1.7
GitHub API Plugin
1.92
GitHub Branch Source Plugin
2.4.1
GitHub plugin
1.29.3
SSH Credentials Plugin
1.14
SSH Slaves plugin
1.28.1
Am I missing plugins that you are referring to? Thanks again, any
guidance is greatly appreciated..
HB
Post by Robert Rajendra
To integrate Jenkins with github. You need to install gith , github
plugins with ssh plugin you can read the docs regarding these and get the
work done
Post by HB
All,
I am completely new to Jenkins but am tasked with getting a working
environment up and running.
RHEL 7.5
Jenkins ver 2.148
[jenkins]
name=Jenkins
baseurl=http://pkg.jenkins.io/redhat
gpgcheck=1
I have it configured to use Active Directory for user authentication
and roles.
My questions revolve around getting Jenkins connected to GitHub. I am
https://gist.github.com/misterbrownlee/3708738
I have created a 'utility user' (say git-jenkins) in GitHub that will
ideally be the user that Jenkins uses to connect to GitHub. I also have
created a key pair for the connection. Since Jenkins runs as user
'jenkins' on the server, I created the key pair as this user and imported
the public key to the 'git-jenkins' utility user in GitHub.
Global Config user.name Value
Global Config user.email Value
to the 'git-jenkins' GitHub utility user via: Manage Jenkins -->
Configure System.
- Make sure the Manage Jenkins > Configure System has the right path to git
- Set the global git user.name and user.email to match your global
config options
- Configure GitHub Web Hook to Manually manage hook urls
- Click the (?) icon next to the manual option and copy the hook URL
you see there
- Optionally set the service account email as the Jenkins sender email
address
However, I am not able to successfully 'test connection' to GitHub in
Manage Jenkins --> Configure System..
I am able to clone the repository from the command line with a
different user than the 'git-jenkins' utility user via Jenkins. But since
the 'jenkins' user on the server does not have a login shell out of the
box, I am unable to test from the command line.
Can anyone point me in the right direction here as to what I might be
missing? I hope I have not confused the situation too much.
Thanks in advance,
HB
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/84ebfffc-fc47-455c-9115-ae2660086196%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/84ebfffc-fc47-455c-9115-ae2660086196%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/13724115-fbdc-4dc4-876f-dd230b44ad2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mark Waite
2018-10-30 09:23:19 UTC
Permalink
If Jenkins is running under your user id and the GitHub repository URL is
using SSH and you're using command line git as the git implementation, then
command line git fallback to use your default ssh private key. That's a
behavior of command line git more than a behavior of Jenkins.

If Jenkins is running under your user id and the GitHub repository https
repository credentials have been permanently stored with git credentials,
then command line git will use those credentials.

If Jenkins is running under another user id or the GitHub repository URL is
using https without stored credentials or you're using JGit, then a
credential will need to be provided.

It is usually best to provide those credentials and not rely on command
line git defaults.

Mark Waite
Post by HB
Thank you. After installing the GitHub integration plugin and watching
the video, I was able to create a project just as in the video.
My GitHub repository contains only the README.md file as well, however the
difference is that my repo is private. The item I create to my private
repo on GitHub is not requiring that I add any credentials. Despite not
creating any credentials after clicking the git radio button under 'Source
Code Management', I can just save the item successfully. I can also click
on the GitHub link within the project and it takes me right to the repo in
GitHub.
Does this sound correct? I feel like it should require defining
credentials to successfully connect to GitHub. Or is it that I am being
successfully connected via the public key that I put in place on the GitHub
side? Or is it possibly a cookie that is allowing the connection? Is that
something I can verify some how?
Thanks,
HB
Post by sagar utekar
Hi,
Search for a GitHub integration plugin.
Here is a YouTube video link you can refer -
http://youtu.be/Z3S2gMBUkBo
Thank you.
Post by HB
Thank you for the reply. I am not seeing 'gith' plugin, is that short
for a plugin? Here are the plugins that I have installed referring to git
Git client plugin
2.7.3
Git plugin
3.9.1
GIT server Plugin
1.7
GitHub API Plugin
1.92
GitHub Branch Source Plugin
2.4.1
GitHub plugin
1.29.3
SSH Credentials Plugin
1.14
SSH Slaves plugin
1.28.1
Am I missing plugins that you are referring to? Thanks again, any
guidance is greatly appreciated..
HB
Post by Robert Rajendra
To integrate Jenkins with github. You need to install gith , github
plugins with ssh plugin you can read the docs regarding these and get the
work done
Post by HB
All,
I am completely new to Jenkins but am tasked with getting a working
environment up and running.
RHEL 7.5
Jenkins ver 2.148
[jenkins]
name=Jenkins
baseurl=http://pkg.jenkins.io/redhat
gpgcheck=1
I have it configured to use Active Directory for user authentication
and roles.
My questions revolve around getting Jenkins connected to GitHub. I am
https://gist.github.com/misterbrownlee/3708738
I have created a 'utility user' (say git-jenkins) in GitHub that will
ideally be the user that Jenkins uses to connect to GitHub. I also have
created a key pair for the connection. Since Jenkins runs as user
'jenkins' on the server, I created the key pair as this user and imported
the public key to the 'git-jenkins' utility user in GitHub.
Global Config user.name Value
Global Config user.email Value
to the 'git-jenkins' GitHub utility user via: Manage Jenkins -->
Configure System.
- Make sure the Manage Jenkins > Configure System has the right path to git
- Set the global git user.name and user.email to match your global
config options
- Configure GitHub Web Hook to Manually manage hook urls
- Click the (?) icon next to the manual option and copy the hook URL
you see there
- Optionally set the service account email as the Jenkins sender email
address
However, I am not able to successfully 'test connection' to GitHub in
Manage Jenkins --> Configure System..
I am able to clone the repository from the command line with a
different user than the 'git-jenkins' utility user via Jenkins. But since
the 'jenkins' user on the server does not have a login shell out of the
box, I am unable to test from the command line.
Can anyone point me in the right direction here as to what I might be
missing? I hope I have not confused the situation too much.
Thanks in advance,
HB
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/68a52bb7-f242-4cd4-9e53-4792259958fa%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/84ebfffc-fc47-455c-9115-ae2660086196%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/84ebfffc-fc47-455c-9115-ae2660086196%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/13724115-fbdc-4dc4-876f-dd230b44ad2e%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/13724115-fbdc-4dc4-876f-dd230b44ad2e%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtFJ%3D6Uy46oeHQtHYrZZ2UG-tdVOapkPdic%2BXdHDsjCLPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...