Use a plugin's fork for Jenkins - jenkins

Instead of using this Jenkins plugin https://github.com/jenkinsci/quality-gates-plugin, I am trying to use a forked version of it: https://github.com/sarg/quality-gates-plugin that has some extra functionality.
I've downloaded the forked version as a .zip file. I changed the termination of the file from .zip to .hpi. Then, I added it to Jenkins's plugins directory.
This should have installed the plugin, right?
I am looking at installed plugins, but I can't find Quality Gates Plugin.
Do I need to do something else to install the plugin?

You have to build the plugin before uploading / installing the plugin in Jenkins. You do this by unzipping the downloaded zip file. Then, using your favorite terminal or command prompt that has maven on the path, you run mvn install. If successful, it will build the .hpi file for the plugin and can be found in the target folder, e.g. target/pluginname.hpi
For more info on plugin development and building plugins, look here.

Related

sonar-swift to analyse xcode project

Im trying to analyse swift app using SonarQube. followed the instructions from here
Im able to run the sonarqube server and running sonar-scanner while running it I'm getting this error
com.sonarsource.A.A.B.A: No license for swift
I'm using this plug in, backelite-sonar-swift-plugin-0.2.4.jar i feel this plug in is free and we can use it. correct me it I'm wrong.
What I did was:
Download Sonarqube LTS version (https://www.sonarqube.org/downloads/)
Download and install dependencies and Sonar-Swift from https://github.com/Backelite/sonar-swift (including sonar-scanner)
Download sonar-project.properties (https://gist.github.com/Edudjr/db51907068ea76b116d11d9a9b13f05f#file-sonar-project-properties) and configure it according to your project. Place it in your project root folder.
Download run-sonar-swift.sh (https://gist.github.com/Edudjr/79a2379842357c33709aecf040d9ae77#file-run-sonar-swift-sh), place it in somewhere in your mac and add to path (/etc/paths). I did a small change in the script because oclint was not running properly.
Start your Sonarqube server (sonar.sh console in sonar folder) and run run-sonar-swift.sh in your project root folder. You should be done.
Manual Installation
In the page dedicated to the plugin you want to install (ex: for Python : SonarPython), click on the "Download" link of the version compatible with your SonarQube version.
Upload the downloaded jar file in your SonarQube Server and put it in the directory : $SONARQUBE_HOME/extensions/plugins.
If another version of the same plugin is already there, you need to remove it, since only one version of a given plugin may be available in the extensions/plugins directory.
Once done, you will need to restart your SonarQube Server.
https://docs.sonarqube.org/display/SONAR/Installing+a+Plugin
Backelite Sonar-Swift last release:
https://github.com/Backelite/sonar-swift/releases

Grails 2.5.1: use grails command-line tasks from binary plugin in lib folder

In Grails 2.5.1, is it possible to use grails command-line tasks from a binary plugin in the lib folder?
I had to modify an existing third-party plugin to get it to work properly.
I put the jar generated by the following command in my project's lib directory:
grails package-plugin --binary
When my project runs, it correctly uses my modified version of the plugin.
At build time, however, I need to run a Grails task on the command line that was provided by the plugin, but, using the binary plugin, the task does not appear to be available.
e.g., if the task was abc, when using the real plugin being referenced in the plugins section of BuildConfig.groovy, then I could run:
grails abc
Using the binary plugin in the lib folder, however, results in the task not being available from the command line.
Also, the original plugin hooked into grails war to include extra steps in the build process without changing the command line. These hooks no longer run with the binary plugin. Is there any way to reinstate the hooks for the binary plugin?
Thanks.

Jenkins nodelabel plugin where does .jpi come from?

I am writing a puppet script that will automatically setup a jenkins instance with the nodelabel parameter plugins. It successfully downloads the .hpi but the plugin still doesn't work.
When I install it using the web UI I see that a working version has both .hpi and .jpi files. I can't find a link for a .jpi anywhere so I am guessing this is generated from the .hpi. I'd like to know if/how this is created during the automated install process so that I can mimic it in puppet.
The .jpi and .hpi files are just zip files (JPI = jenkins plug in, HPI = hudson plug in). If you put the .hpi in your plugins directory (probably /var/lib/jenkins/plugins) and restart Jenkins, it will install the plug in.
What I found was Jenkins-ci.org stores .hpi files, and installing this way will leave them as .hpi files. Installing through the gui changes them to .jpi.
You might also look at the one of the existing puppet modules for Jenkins.

How to deploy grails app with private plugin to cloud

I've created a private plugin for domain objects that are shared between two grails applications. I'm able to use the plugin successfully in my local environment as I've set the path to it via the BuildConfig file. For example, I have the following directories:
appOne/
myPlugin/grails-my-plugin-0.1.zip (myPlugin is a grails plugin project dir)
In: appOne/grails-app/conf/BuildConfig.groovy:
grails.plugin.location.compileMyPlugin = "../myPlugin"
My question is, what is the proper/best way to handle "packaging" this plugin with my app release so I can deploy it to a cloud service where it won't be available for download? I imagine there is a way to have grails do this for you but I'm unsure. (I'm very new to grails)
When you create you .war file for deployment, grails simply includes your plugin. So you have nothing special to do.
If your project is build in the cloud, you might try to specify a file path as local repository:
repositories {
grailsCentral()
localRepo "../myPlugin"
}
Just drop your zipped plugin in this folder and grails will find it.
I ended up doing the following to resolve this in Grails 2.1.0:
1) In the Grails Plugin Project:
grails package-plugin Produces the grails-myplugin-0.1.zip file
2) Copy plugin to my application's lib directory (appOne/lib/grails-myplugin-0.1.zip)
3) In BuildConfig.groovy
Remove: grails.plugin.location.compilemyPlugin = "../myPlugin"
This was/is used during development to prevent the rebuild-reinstall process
when updating files included in the plugin.
Add:
plugins {..... compile ':grails-myPlugin:0.1' }
4) Test by cleaning appOne and re-run which will install/re-install the plugin via the lib directory
5) Commit all changes and add the plugin zip file to appOne and push. The cloud provider,
Heroku in this case, can then resolve the dependency.
Your build script should first package the plugin, then install the plugin into your Grails application. At least, that is how I have to do it. If you try and have both your plugin specified in the BuildConfig dependencies and as an inline plugin, Grails tends to complain about that.

Installing Nimble for Grails

I came across Nimble yesterday, but couldn't get past Step 1, configuring BuildConfig.groovy to find the Nimble's remote repository.
My BuildConfig.groovy file is one line:
grails.plugin.repos.discovery.intient="http://intient.com/downloads/grails/
Here is the message I get when running grails install-plugin nimble 0.2:
Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /opt/dev/sdks/grails-1.1.1
Base Directory: /home/wraith/dev/source/demo
Running script /opt/dev/sdks/grails-1.1.1/scripts/InstallPlugin.groovy
Environment set to development
No authentication for svn repo at intient ...
Reading remote plugin list ...
Reading remote plugin list ...
Reading remote plugin list ...
Plugin 'nimble' was not found in repository. If it is not stored in a configured repository you will need to install it manually. Type 'grails list-plugins' to find out what plugins are available.
This is the first time I have tried to install a plugin not in the official repository. What is the best way to narrow down if it is a problem at Intient.com or with my configuration?
Follow these instructions with the following modifications:
Step 1 is correct
Instead of using the remote repository, download the zipped plugin
Move the plugin to ~/dev/plugins
grails install-plugin ~/dev/plugins/grails-nimble-0.2.zip
Steps 3-5 are correct
We were performing some maintenance on intient.com and the load balancer wasn't providing this content for the last 12 hours or so (oops!).
Should be sorted now but the steps Wraith Monster gave above work for a manual install as well.
Once Grails 1.2 proper hits Nimble will be part of the official plugin repo and we won't need to worry about this at all.
you could always download the zip file for the plugin and install it manually
Download source code from http://github.com/intient/nimble
Unzip under your plugins directory of your project (usually under ${USER_HOME}/.grails/<grails-version>/projects/<myproject>/plugins)
Rename the extracted folder into "nimble-0.2"
Remove from BuildConfig the line grails.plugin.repos.discovery.intient="http://intient.com/downloads/grails/"
Edit the file application.properties of your project and add the line plugins.nimble=0.2
If not installed under your project, you should install the plugins : shiro (version 1.0-SNAPSHOT at least) and mail (>0.6). (run command grails install-plugin <pluginName> <version>)
Start directly from Step 3
It should work (at least, it worked for me). Good luck

Resources