Why can I not see the cloudbees github plugin - github

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.

Related

How do I disable a Github check for Google Cloud Build

I've installed the Google Cloud Build app from Github Marketplace, and enabled it on several repositories, only to discover that enabling access for those repositories automatically starts running the Google Cloud Build "check" after every PR or push to a PR. Since some of those repositories are not actually ready for Google Cloud build, I needed to turn off the checks... I used the URL mentioned in the docs to get to the page where you can select which repositories should be connected to your GCP project, and unchecked a bunch of them... this disconnected them from the project, but, surprisingly, did not disable the Github checks! So now, there are Github checks on several repositories that just result in an error because they're not connected to any projects in Cloud Build.
Surely, it is not an uncommon use case to need a way to "disable Checks" on a per-repository basis - is there any way to do that?
(If not, consider it a requested feature if there are any Google Engineers reading!) ;)
I did talk to chat support, and the only way we could figure out to remove the checks would be to uninstall Google Cloud Build completely from the entire organization, which I don't want to do because we do have some setup that I want to keep, and I don't know how much of that configuration would have to be redone if I uninstalled it completely.
Here is a screenshot of the broken check that I can't disable:
I think there are 2 steps to disable CloudBuild,
1. Disable on CloudBuild itself. For some time I kept seeing 2 builds per push made, but disabling a trigger on CloudBuild helped fix that.
2. On Github, you can configure the Cloudbuild app to monitor a specific repo on the organization level setting.
3. If you feel a lot adventurous though and it's not solved, on the project level setting, you could delete the Webhooks integration for cloudbuild, as that's what Github notifies of each build.
It can be found within GH App installations:
https://console.cloud.google.com/gcb-github-registration
Select the GH account used for your link between Cloud Build and GH, then the GCP project you want to edit.
Here connected repositories can be edited, and in the second step (Trigger settings), the "Default GitHub Checks" can be disabled.
You can also goto settings of your repository and click installations inside settings.
And then remove Google cloud build from Installed apps and authorized github apps.
Cloud Build Triggers are still in beta, and have gone through several updates since this question was posted, but it now appears that the "Github Default Checks" are no longer hidden from management. They are now explicitly offered (but not automatically created) when connecting a repo, and you can finally view and disable (or delete) individual "Github Default Checks" on the trigger management page: https://console.cloud.google.com/cloud-build/triggers
I'll leave this as unanswered, because I'm uncertain this is how it is working for everyone, or that this answer will remain true, but if it works for you, feel free to vote up the answer!
To link GCP Project to the Github repository, create a trigger by clicking on resolve link, besides Action Required and then disable the same. For me this procedure worked out.

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.

Jenkins GitHub OAuth plugin not visible in securityRealm

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

Create new vendor application for YII2 in GitHub

I created a very simple plugin for yii2 and added it to Github.
https://github.com/harlangray/languageswitcher
When I add "harlangray/languageswitcher": "*" to the require section and run composer update on my project, it gives me an error.
Problem 1
- The requested package xxxxx could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see https:xxxxx for more details.
Read http:yyyyy for further common problems.
I am really new to github and composer. Can someone give me the steps to create a plugin and make it uninstallable via composer?
Thank you
Composer has no idea about github packages, unless you add them as under the repositories as a package.
If you want to be able to install it via the require section you'll need to add your package to Packagist. This is the site composers gets the package meta information from.
Only thing you have to do is register, click the big "Submit Package" button and point it to your github project. Optionally (but advised) you could setup a hook in github to update packagist every time you commit something to github so that you don't have to do it manually.

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.