Jenkins GitHub OAuth plugin not visible in securityRealm - github

I set up jenkins and I would like to use Github authenticator. Plug-in was installed properly but in Global Security I can't find Github oauth option in Security Realm and Authorization Strategy.
Is there any dependency for the plug-in (besides these installed automatically) or something?

In plug-ins I had every needed plug-in enabled but still in folder $JENKINS_HOME/plugins there was file github-api.jpi.disabled.
Remove the file and restart Jenkins.
Now Github Anthentication Plugin is visible in Security Realm

Related

How to activate NuGet repository format on Nexus 3

Preambule:
I would like to setup a NuGet repository hosted inside of my company.
We already had a Nexus OSS 2.13 running so I tried setting up a Nuget hosted repository on it, and uploaded my package there to test it. I then configured NuGet repos on my Visual Studio 2015 in order to add the one on that nexus server.
The problem I encountered then is that VS2015 uses (apparently) nuget feed v3, while Nexus 2.13 has the v2 feed. The symptom was a 404 error while browsing the nexus repository (when nuget calls repo_url/Search()).
The error message looked like :
The v2 feed at '/nexus nuget repository url/Search()?[...]' returned '404 not found'
Browsing it through the repo url in a web browser (without /Search()) works fine, and so is browsing repo_url/FindPackagesById.
I tried downgrading my NuGet vsix version as much as possible, going down to v3.1.1, but no version worked with the v2 feed.
What I tried next:
I looked up Sonatype website about nexus, and saw Nexus v3 is said to handle NuGet, while v2 has no such mention. I decided to try and install Nexus 3 next to our Nexus 2.13 (on the same machine) and see what it had to offer.
I downloaded v3.0.2-02 from that same page as above and started setting it up.
I followed parts of the documentation on how to install it skipping some parts that were already done because of the v2.13 installation. (Disclaimer: I did not install v2.13 myself though I considered installing java runtime environment and stuff like that to be a given).
I then started nexus 3 as a service and successfully reached the home page and logged in as admin.
Having read a statement on hosted repository management in the documentation saying:
By default, the repository manager ships with the following configured hosted repositories:
[...]
nuget-hosted
This hosted repository is where your organization can publish internal
releases in repository using the NuGet repository format. You can also
use this repository for third-party components that are not available in
external repositories, that could potentially be proxied to gain access
to the components.
I headed to Repository -> Repositories section and clicked "Create repository".
Only maven (group/hosted/proxy) and raw (group/hosted/proxy) recipes are available. No Nuget, no npm, nothing else than maven...
Searching a bit, I found in the System -> Bundles section that the bundle for nuget repositories mvn:com.sonatype.nexus.plugins/nexus-repository-nuget/3.0.2-02 is listed as Installed
while maven's mvn:org.sonatype.nexus.plugins/nexus-repository-maven/3.0.2-02 is listed as Active.
I tried looking for a place where bundles can be activated, and thought I found one at $NEXUS_HOME/etc/startup.properties where the first line says:
# Bundles to be started on startup, with startlevel
and contains line looking the one I added to try and activate nuget:
mvn\:com.sonatype.nexus.plugins/nexus-repository-nuget/3.0.2-02 = 10
I then used > sudo service nexus3 restart to restart nexus v3, logged back into admin, went to Repositories, and saw that still no nuget recipe is available.
I went back to Bundles and saw the nuget bundle is still listed as Installed and not Active.
I'm now all out of ideas as to what I could or should do in order to simply create a hosted nuget repository, which should already be available according to nexus' documentation...
What am I missing?
What is wrong with a fresh install missing what the documentation is saying is available by default?
How do I create a hosted NuGet repository on that nexus v3?
I found a way to activate the nexus-repository-nuget plugin:
Activate karaf console in file bin/nexus.vmoptions :
-Dkaraf.startLocalConsole=true
Then start nexus with the run option:
sudo bin/nexus run
And finally in the karaf console, activate nexus-repository-nuget bundle:
bundle:start 214
Now just quit the console and stop the runner, and start as a service. The bundle should be "Activated" and you should be able to create a nuget repository.

How to configure jenkins with rails to perform deployment

I using Ubuntu 12.04 LTS and i want to configure Jenkins with rails to do deployment process.
Actually i configured with
Github plugin, Ant Plugin, Brakeman Plugin, Cloudbees Deployer Plugin, conditional-buildstep, Credentials Plugin, Deploy to container Plugin, External Monitor Job Type Plugin, Git server plugin, GitHub API Plugin, Github Authentication plugin, GitHub plugin, Github Pull Request Builder, GitHub SQS Build Trigger Plugin, Hudson SCP publisher plugin, Javadoc Plugin, Jenkins CVS Plug-in, Jenkins GIT client plugin, Jenkins GIT plugin, Jenkins Grails plugin, Jenkins Mailer Plugin, Jenkins Parameterized Trigger plugin, Jenkins Rake plugin, Jenkins ruby metrics plugin, Jenkins SSH Slaves plugin, Jenkins Subversion Plug-in, Jenkins Translation Assistance plugin, Job Generator, LDAP Plugin, Maven Integration plugin, PAM Authentication plugin, project Description Setter, ruby-runtime, Run Condition Plugin, SSH Credentials Plugin, Static Analysis Utilities, Token Macro Plugin
PLease do let me know the ways or steps to configure Jenkins ci with rails and let me know the Plugin which needs to be added and removed by verifying above. Thanks in advance.
There are many ways to deploy your rails application. Using capistrano, git, scp, rsync, or even using third party hosts like heroku. Jenkins is just going to automate the process that you will have designed.
So it really depends on what you have decided. Your post doesn't contain enough information.

Why can I not see the cloudbees github plugin

Trying to follow the instructions at http://developer.cloudbees.com/bin/view/DEV/GitHub+Commit+Hooks+HOWTO
but I don't see the github plugin in the list of available or installed jenkins plugins.
What am I doing wrong?
Ok, so I contacted CB support and they told me what the docs said: install the plugin. I go to confirm that I still don't have the plugin available to me, and it's now available. Not sure if they changed something or it was just a glitch, but I'm now able to follow the docs and get github working.
The Cloudbeeds blog does list the requirements:
Requirement for Plug-in Use
Jenkins 1.400 or newer
Jenkins Git Plugin version 1.1.12 or newer
At least one GitHub hosted project to build ;-)
Step-by-Step Instructions on How to Use it: Installation
Go to your Jenkins instances root page.
If your Jenkins instance has security enabled, login as a user who has the Overall | Administer permission.
Select the Manage Jenkins link on the left-hand side of the screen.
Select the Manage Plugins link.
On the Available tab, select the Github Plugin and click the Download and Install button at the bottom of the page (if you do not got the Git Plugin installed, do not worry, Jenkins is smart enough to install/upgrade the Git plugin, where required).
Restart Jenkins once the plugins are downloaded (Note: users of Jenkins 1.442 or newer should be aware that the plugin currently requires a restart to function correctly).
So there could be many reasons (like the Jenkins version) why you don't see the Jenkins GitHub plugin, the most usual one being to be logged on a non-Administor account.
As the OP TomL confirms in his answer, if the plugin is still not visible to be installed, only CB support can make it visible.

Can we set NuGet URLs with domain policy

NuGet is just great addition for Visual Studio. And it also allows for custom NuGet repositories as long as you provide custom URLs to them.
For company-related projects we can have own NuGet repositories serving whatever libraries are needed for internal projects. The main problem is that each developer has to configure this manually within Visual Studio.
Question
Is it possible to set these URLs by domain security policy settings? This would be great, because every new team member that would install Visual Studio would automatically get these URLs and gettig project source code could automatically load related libraries (with the new NuGet feature that loads missing ones on build).
So #Haacked and Steve Sanderson... Is this possible?
NuGet 2.1 introduced hierarchical configuration settings for NuGet. This allows you to specify things like additional repositories at a project/solution level rather than having to have everyone receive the settings through a group policy.
Release notes: http://docs.nuget.org/docs/release-notes/nuget-2.1
By setting a NuGet repository at the solution level, everyone working on the solution will get the additional repository added to their package sources.
That is not yet possible. I'm pretty sure there's a feature request already for this in http://nuget.codeplex.com/. I recommend finding that feature and commenting on it. If you can't find it, start a discussion. :)

GitHub Organization Repo + Jenkins (GitHub Plugin) integration

I have an organization on GitHub with private repositories. I also have Jenkins set up running on port 8080 on a server, with the GitHub plugin installed. I've created an account on GitHub for my jenkins user, which resides in the owners group.
I'm trying to trigger a job on jenkins when a change is pushed to my development branch (or master branch, neither seem to be working).
When I look at the GitHub Hook Logs in Jenkins, it says that Polling has not run yet. When I go to "Manage Jenkins", the GitHub plugin says my account is Verified when I test it.
Any insight on how to configure this? I have multiple repositories I'd like to work with, so deploy keys don't seem like the solution to me.
Update:
As Craig Ringer mentions in his answer, you can select Grant READ permissions for /github-webhook in "Configure Jenkins" under the GitHub plugin settings, allowing the webhook to be called without authentication.
Another update: Webhooks are now (Dec. 2014) available for organization: see WebHooks API for orgs.
Note: the issue 4 of the hudson-github-plugin was about:
Last GitHub Push
Polling has not run yet.
And the conclusion was:
Nevermind, the only missing piece was a permission checkbox for the github user which ain't documented anywhere on the internet.
So is this a permission issue regarding your Jenkins users?
The article "Set up Jenkins-CI on Ubuntu for painless Rails3 app CI testing" includes the following process:
To restrict the CI system and give access to your Team members to use or see the build logs, first you’ve to create an account.
Go to Manage Jenkins > Configure System,
Check the Enable Security checkbox
Under Security Realm, choose Jenkins's own user database
Check the Allow users to sign up checkbox
Under Authorization, choose Project-based Matrix Authorization Strategy
Add first user with the name admin and another with GitHub (Note: the username for Admin access has to be admin) For GitHub named user, just choose the Overall Read only permission. We’ll use this user later with the GitHub hook.
Note: The admin and GitHub user that we’ve added in the above step does not create the User. Then you’ve to create a real user with that same name. Ya, I know, its a bit weird with Jenkins UI.
Go to Manage Jenkins > Manage Users > Create User. Create both admin and GitHub users.
Hooking with the Github web-hooks
Now to run the build automagically when new commit or branch gets pushed onto Github, we have to setup the repository.
Got to the hooks page for your repository. e.g.
github.com/<username>/<project_name>/admin/hooks
Under AVAILABLE SERVICE HOOKS > Post-Receive URLs, add github:github#your-ci-server.com/github-webhook/.
The github:github is the user that we’d created earlier.
Then we have to verify Jenkins with Github. Go to Manage Jenkins > Configure System and under GitHub Web Hook, add your Github username and password and click the Test Credential button to authorize once with Github.
It looks like the accepted answer is no longer necessary with the current version of the GitHub plugin. You can instead check Grant READ permissions for /github-webhook in "Configure Jenkins" under the GitHub plugin settings, allowing the webhook to be called without authentication.
As explained in the help on this option that's quite safe, and frankly no worse than having a user named "github" with password "github" anyway.
There are two ways to achieve automatic builds on Jenkins. What you choose depends on whether GitHub can call the Jenkins server URL you provide. This may not be the case if you are running Jenkins behind a firewall.
If GitHub can reach that URL you can set up the service hook on your repo there.
If not you can set up Jenkins to poll periodically.
You may set up both, but one solution is enough to get it working. I would always go for the first if feasible as it saves resources CPU and traffic wise.
Either way you need the GitHub plugin for Jenkins.
Hope that helps a bit.