How to compile and build Gerrit Plugins?

To build Gerrit Plugins from source, you need:

A Linux or macOS system (Windows is not supported at this time)

zip, unzip, wget

$yum install zip -y
$ yum install unzip -y
$ yum install wget -y
$ yum install git -y

Python 2 or 3
This is installed in each RHEL 7 and Ubunutu server by defaul.

Node.js

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
OR
curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
sudo yum -y install nodejs

Bazel

## RHEL/CentOS 7 64-Bit ##
$ wget https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.repo
$ cp vbatts-bazel-epel-7.repo /etc/yum.repos.d/
$ yum install -y bazel

How to Installing Bazel on Ubuntu?
https://docs.bazel.build/versions/master/install-ubuntu.html

Maven

$ cd /opt
$ wget http://www-us.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip
$ unzip apache-maven-3.5.4-bin.zip
$ mv apache-maven-3.5.4 maven
$ export PATH=$PATH:/op/maven/bin

gcc

$ sudo yum install gcc-c++ make

Now, Bazel in tree driven means it can only be built from within Gerrit tree. Clone or link the plugin into gerrit/plugins directory:

# First become a non-root user

A JDK for Java 8

$ cd
$ wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz
$ tar -xvf jdk-8u181-linux-x64.tar.gz
$ export JAVA_HOME=/home/ec2-user/jdk1.8.0_181
$ java -version

Follow for Gerrit.war

$ git clone --recursive https://gerrit.googlesource.com/gerrit
$ cd gerrit 
$ bazel build release

Follow for plugins such as its-jira

$ cd plugins
$ git clone https://gerrit.googlesource.com/plugins/its-jira
$ git clone https://gerrit.googlesource.com/plugins/its-base
$ bazel build plugins/its-jira

The output can be normally found in the following directory:

bazel-genfiles/plugins/its-jira/its-jira.jar

# Some plugins describe their build process in src/main/resources/Documentation/build.md file. It may worth checking.

# Some plugins cane be build using maven as well

Reference

  • https://gerrit-review.googlesource.com/Documentation/dev-bazel.html
  • https://gerrit.googlesource.com/gerrit/
  • https://gerrit-review.googlesource.com/Documentation/cmd-plugin-install.html
  • https://gerrit-review.googlesource.com/Documentation/dev-build-plugins.html
Tagged : / / / /

How to Install plug-ins in IBM UrbanCode Deploy

Procedure

  1. Download the installation files for one or more plug-ins from the following site: https://developer.ibm.com/urbancode/plugins/ibm-urbancode-deploy/
  2. Load the plug-ins:
    1. For automation plug-ins, click Settings > Automation Plugins, then click Load Plugin.
    2. For source plug-ins, click Settings > Source Config Plugins, then click Load Plugin.
    3. Enter the path to the compressed plug-in file, and then click Submit.

Results

The plug-in is listed on either the Automation Plugins pane or the Source Config Plugins pane. After the plug-in is installed, it is available immediately.

Uninstalling a plug-in

To uninstall a plug-in, click Settings > Automation Plugins, find the plug-in, and then click Delete.

Note: Before uninstalling a plug-in, verify that it is no longer in use. Deleting a plug-in which is being used by existing processes causes those processes to be invalid.

Rolling back plug-ins

You cannot roll back a plug-in version to a previous version. If you have mistakenly deleted a version of a plug-in being used in processes, the step will display “PLUGIN DELETED”. The server retains the pertinent steps to avoid breaking persistent processes and snapshots, but the configuration should be updated according to intention. If the intention is to use an earlier version of the plug-in, perform the following steps:

    1. Uninstall (Delete) the later version of the plug-in. Now, in all processes, steps from that plug-in are shown with the text “PLUGIN DELETED”. These steps should never be left in this state.Note: The server retains the later version steps to avoid breaking snapshots. However, you cannot add these steps to processes after you delete the plug-in. All deleted steps should be updated immediately.
    2. Install the earlier version of the plug-in (if not already installed).Note: If an earlier plug-in version was installed and previously upgraded, this step is not necessary, as the previous version will be now be usable again.
    3. In each process that used steps from the later plug-in, re-create and delete the steps that are labeled “PLUGIN DELETED.” This will “roll back” the step from the later to earlier version. The process steps cannot be changed until you re-create them, even if you installed another version of the plug-in.

Note: Re-installing the later version of the plug-in will restore the processes.

Tagged : / /

How to Install plug-ins in IBM UrbanCode Release

 

Procedure

  1. Download the installation files for one or more plug-ins from the following site: https://developer.ibm.com/urbancode/plugins/ibm-urbancode-build/. Do not extract the compressed files.
  2. Load the plug-ins:
    1. From the IBM UrbanCode Build user interface, click the System tab.
    2. In the Server group, click Plug-ins.
    3. On the Plugins page, Browse and locate the plug-in installation file and then click Open.
    4. On the Plugins page, click Load.

Results

After the upload to the server is complete, the plug-in is listed on the Plugins page and available for immediate use.

Uninstalling a plug-in

To uninstall a plug-in, click System > Plug-ins, locate the plug-in, and then click the Delete icon.

Note: Before uninstalling a plug-in, verify that it is no longer in use. Deleting a plug-in which is being used by existing processes causes those processes to be invalid.

Tagged : / / /

How to Install plug-ins in IBM UrbanCode Build

Procedure

  1. Download the installation files for one or more plug-ins from the following site: https://developer.ibm.com/urbancode/plugins/ibm-urbancode-build/. Do not extract the compressed files.
  2. Load the plug-ins:
    1. From the IBM UrbanCode Build user interface, click the System tab.
    2. In the Server group, click Plug-ins.
    3. On the Plugins page, Browse and locate the plug-in installation file and then click Open.
    4. On the Plugins page, click Load.

Results

After the upload to the server is complete, the plug-in is listed on the Plugins page and available for immediate use.

Uninstalling a plug-in

To uninstall a plug-in, click System > Plug-ins, locate the plug-in, and then click the Delete icon.

Note: Before uninstalling a plug-in, verify that it is no longer in use. Deleting a plug-in which is being used by existing processes causes those processes to be invalid.

Tagged : / / / /

Environment variables and properties defined in jenkins | Jenkins Tutorial

Environment variables and properties defined in jenkins

Jenkins Set Environment Variables

When a Jenkins job executes, it sets some environment variables that you may use in your shell script, batch command, Ant script or Maven POM 1. The following table contains a list of all of these environment variables.

Environment Variable Description
BUILD_NUMBER The current build number, such as “153”
BUILD_ID The current build id, such as “2005-08-22_23-59-59” (YYYY-MM-DD_hh-mm-ss, defunct since version 1.597)
BUILD_URL The URL where the results of this build can be found (e.g. http://buildserver/jenkins/job/MyJobName/666/)
NODE_NAME The name of the node the current build is running on. Equals ‘master’ for master node.
JOB_NAME Name of the project of this build. This is the name you gave your job when you first set it up. It’s the third column of the Jenkins Dashboard main page.
BUILD_TAG String of jenkins-${JOB_NAME}-${BUILD_NUMBER}. Convenient to put into a resource file, a jar file, etc for easier identification.
JENKINS_URL Set to the URL of the Jenkins master that’s running the build. This value is used by Jenkins CLI for example
EXECUTOR_NUMBER The unique number that identifies the current executor (among executors of the same machine) that’s carrying out this build. This is the number you see in the “build executor status”, except that the number starts from 0, not 1.
JAVA_HOME If your job is configured to use a specific JDK, this variable is set to the JAVA_HOME of the specified JDK. When this variable is set, PATH is also updated to have $JAVA_HOME/bin.
WORKSPACE The absolute path of the workspace.
SVN_REVISION For Subversion-based projects, this variable contains the revision number of the module. If you have more than one module specified, this won’t be set.
CVS_BRANCH For CVS-based projects, this variable contains the branch of the module. If CVS is configured to check out the trunk, this environment variable will not be set.
GIT_COMMIT For Git-based projects, this variable contains the Git hash of the commit checked out for the build (like ce9a3c1404e8c91be604088670e93434c4253f03) (all the GIT_* variables require git plugin)
GIT_URL For Git-based projects, this variable contains the Git url (like git@github.com:user/repo.git or [https://github.com/user/repo.git])
GIT_BRANCH For Git-based projects, this variable contains the Git branch that was checked out for the build (normally origin/master)

Promoted Build Plugin Environment Variables

If you are using the Promoted Build Plugin, you will have access to the following environment variables. This allows you to access information about your Jenkins build since certain environment variables stated above (such as BUILD_TAG now refer to the Promoted Build Plugin’s job.

Environment Variable Replaces Description
PROMOTED_URL BUILD_URL The URL of the original Jenkins job that is involved with the promotion. BUILD_URL now refers to the Promotion’s URL
PROMOTED_JOB_NAME JOB_NAME The name of the original Jenkins job that is involved with the promotion. JOB_NAME now refers to the Promotion’s job’s name
PROMOTED_NUMBER BUILD_NUMBER The Build Number of the job being promoted. BUILD_NUMBER now refer’s the the Promotion Number
PROMOTED_ID BUILD_ID The Build ID (ex. “2005-08-22_23-59-59” (YYYY-MM-DD_hh-mm-ss) ) of the original Jenkins job. BUILD_ID now refer’s to the Promotion’s build ID.

System Properties

Name  ↓ Value   
awt.toolkit sun.awt.X11.XToolkit
com.sun.akuma.Daemon daemonized
executable-war /usr/lib/jenkins/jenkins.war
file.encoding UTF-8
file.encoding.pkg sun.io
file.separator /
java.awt.graphicsenv sun.awt.X11GraphicsEnvironment
java.awt.headless true
java.awt.printerjob sun.print.PSPrinterJob
java.class.path /usr/lib/jenkins/jenkins.war
java.class.version 52.0
java.endorsed.dirs /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/endorsed
java.ext.dirs /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/ext:/usr/java/packages/lib/ext
java.home /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre
java.io.tmpdir /tmp
java.library.path /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.runtime.name OpenJDK Runtime Environment
java.runtime.version 1.8.0_111-b15
java.specification.name Java Platform API Specification
java.specification.vendor Oracle Corporation
java.specification.version 1.8
java.vendor Oracle Corporation
java.vendor.url http://java.oracle.com/
java.vendor.url.bug http://bugreport.sun.com/bugreport/
java.version 1.8.0_111
java.vm.info mixed mode
java.vm.name OpenJDK 64-Bit Server VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Oracle Corporation
java.vm.specification.version 1.8
java.vm.vendor Oracle Corporation
java.vm.version 25.111-b15
JENKINS_HOME /var/lib/jenkins
jna.loaded true
jna.platform.library.path /usr/lib64:/lib64:/usr/lib:/lib:/usr/lib64/mysql
jnidispatch.path /tmp/jna–1712433994/jna4147775405825940943.tmp
line.separator
mail.smtp.sendpartial true
mail.smtps.sendpartial true
os.arch amd64
os.name Linux
os.version 3.10.0-514.el7.x86_64
path.separator :
sun.arch.data.model 64
sun.boot.class.path /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/jfr.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/classes
sun.boot.library.path /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/amd64
sun.cpu.endian little
sun.cpu.isalist
sun.font.fontmanager sun.awt.X11FontManager
sun.io.unicode.encoding UnicodeLittle
sun.java.command /usr/lib/jenkins/jenkins.war –logfile=/var/log/jenkins/jenkins.log –webroot=/var/cache/jenkins/war –daemon –httpPort=8080 –debug=5 –handlerCountMax=100 –handlerCountMaxIdle=20
sun.java.launcher SUN_STANDARD
sun.jnu.encoding UTF-8
sun.management.compiler HotSpot 64-Bit Tiered Compilers
sun.os.patch.level unknown
svnkit.http.methods Digest,Basic,NTLM,Negotiate
svnkit.ssh2.persistent false
user.country US
user.dir /
user.home /var/lib/jenkins
user.language en
user.name jenkins
user.timezone America/New_York

Environment Variables

Name  ↓ Value   
_ /etc/alternatives/java
HOME /var/lib/jenkins
LANG en_US.UTF-8
LOGNAME jenkins
NLSPATH /usr/dt/lib/nls/msg/%L/%N.cat
PATH /sbin:/usr/sbin:/bin:/usr/bin
PWD /
SHELL /bin/bash
SHLVL 2
USER jenkins
XFILESEARCHPATH /usr/dt/app-defaults/%L/Dt

Plugins

Name  ↓ Version    Enabled    Pinned   
ace-editor 1.1 true false
ant 1.4 true false
antisamy-markup-formatter 1.5 true false
bouncycastle-api 2.16.0 true false
branch-api 1.11.1 true false
build-timeout 1.18 true false
cloudbees-folder 5.16 true false
credentials 2.1.10 true false
credentials-binding 1.10 true false
display-url-api 0.5 true false
durable-task 1.12 true false
email-ext 2.53 true false
external-monitor-job 1.7 true false
git 3.0.1 true false
git-client 2.2.0 true false
git-server 1.7 true false
github 1.25.1 true false
github-api 1.84 true false
github-branch-source 1.10.1 true false
github-organization-folder 1.5 true false
gradle 1.25 true false
handlebars 1.1.1 true false
icon-shim 2.0.3 true false
jacoco 2.1.0 true false
javadoc 1.4 true false
jira 2.3 true false
jobConfigHistory 2.15 true false
jquery 1.11.2-0 true false
jquery-detached 1.2.1 true false
junit 1.19 true false
ldap 1.13 true false
mailer 1.18 true false
mapdb-api 1.0.9.0 true false
matrix-auth 1.4 true false
matrix-project 1.8 true false
maven-plugin 2.14 true false
momentjs 1.1.1 true false
pam-auth 1.3 true false
pipeline-build-step 2.4 true false
pipeline-graph-analysis 1.3 true false
pipeline-input-step 2.5 true false
pipeline-milestone-step 1.3 true false
pipeline-rest-api 2.4 true false
pipeline-stage-step 2.2 true false
pipeline-stage-view 2.4 true false
plain-credentials 1.3 true false
resource-disposer 0.3 true false
scm-api 1.3 true false
script-security 1.25 true false
sonar 2.5 true false
ssh-credentials 1.12 true false
ssh-slaves 1.12 true false
structs 1.5 true false
subversion 2.7.1 true false
thinBackup 1.9 true false
timestamper 1.8.7 true false
token-macro 2.0 true false
windows-slaves 1.2 true false
workflow-aggregator 2.4 true false
workflow-api 2.8 true false
workflow-basic-steps 2.3 true false
workflow-cps 2.23 true false
workflow-cps-global-lib 2.5 true false
workflow-durable-task-step 2.7 true false
workflow-job 2.9 true false
workflow-multibranch 2.9.2 true false
workflow-scm-step 2.3 true false
workflow-step-api 2.7 true false
workflow-support 2.12 true false
ws-cleanup 0.32 true false

Useful Plugins

https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin

Reference

https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project
http://jenkins:8080/systemInfo

Tagged : / / / / / / /

Reporting Plugins in Maven | Maven Plugins That Provide Reports

reporting-plugins-in-maven

Reporting plugins
Plugins which generate reports, are configured as reports in the POM and run under the site generation
lifecycle.

This plugin consists of several reports that you can run selectively, individually or even run all of them. Please see below for instructions on how to configure your pom.xml to do this.

Run All Reports
To include all Project Info Reports in your project, you must configure your pom.xml. Use “mvn site:site” to generate the configured reports.

project


org.apache.maven.plugins
maven-project-info-reports-plugin

Run Selective Reports


org.apache.maven.plugins
maven-project-info-reports-plugin

dependencies
project-team
mailing-list
cim
issue-tracking
license
scm

Reporting plugins are configured in the POM as in this example:

org.apache.maven.plugins
maven-project-info-reports-plugin

Configuration in the reporting section also applies if plugin goals are invoked individually. The converse is not true– if you configure the plugin inside , that configuration will NOT apply to .

Configuring multiple reports for one plugin using . Each must have a unique . For more information on UMLGraph, see the UMLGraph site and this page.

org.apache.maven.plugins
maven-javadoc-plugin

uml

gr.spinellis.umlgraph.doclet.UmlGraph

gr.spinellis
UmlGraph
4.4

-views
target/uml
private

javadoc

html

private

javadoc

Plugins Type Version Release Date Description Source Repository Issue Tracking
changelog R 2.1 2007-07-25 Generate a
list of recent
changes from
your SCM.
SVN JIRA
changes B+R 2.1 2008-11-24 Generate a
report from
issue tracking
or a change
document.
SVN JIRA
checkstyle B+R 2.3 2009-07-14 Generate a
checkstyle
report.
SVN JIRA
clover B+R 2.4 2007-04-23 Generate
a Clover
report. NOTE:
Moved to
Atlassian.com
SVN JIRA
doap B 1.0 2008-08-01 Generate a
Description
of a Project
(DOAP) file
from a POM.
SVN JIRA
docck B 1.0 2008-11-16 Documentation
checker
plugin.
SVN JIRA
javadoc B+R 2.6 2009-07-29 Generate
Javadoc for
the project.
SVN JIRA
Jxr R 2.1 2007-04-05 Generate a
source cross
reference.
SVN JIRA
pmd B+R 2.4 2008-01-08 Generate a
PMD report.
SVN JIRA
projectinforeports R 2.1.2 2009-07-23 Generate
standard
project
reports.
SVN JIRA
surefirereport R 2.4.3 2008-05-14 Generate a
report based
on the results
of unit tests.
SVN JIRA

Known Plugins That Provide Reports

 

Tagged : / / / / / / / / / / / /