Propelo's Jenkins Plugin to send reports about jobs' logs and metadata to the Propelo Service.
- Have a Propelo account with permissions to add an integration.
- Have access and permissions to install plugins in Jenkins.
- Login to your Propelo account
- Access the Integrations Settings Tile.
- Add a new Jenkins integration
-
Install the plugin
- Sign-in to Jenkins and select Manage Jenkins.
- Select “Manage Plugins”.
- Select the “Available plugins” tab.
- In the “Search Plugin” box, type "propelo"
- Install the plugin called "Propelo Job Reporter" by selecting it and clicking "Install without restart".
- Once the plugin installation is complete, the status will change to “Success". If it doesn't change to "Success" a restart might be needed
-
Configure the plugin
- Sign-in to Jenkins and select Manage Jenkins.
- Select "Propelo Job Reporter".
- Set Jenkins Instance name. This name would appear on SEI UI.
- Set Propelo Api key. The api key can be obtained in the SEI (Propelo) UI.
- Set plugin directory. The work directory where the propelo plugin will store permanent and intermediate information. The jenkins process must have write access on this directory.
NOTE: In most cases the default value should work and changing would not be needed. - Set the Jenkins Username of the user who created the Jenkins user token. This field is needed only for Blue Ocean plugin specific data.
NOTE: In most cases this can be left empty. - Set the Jenkins User Token. Instructions to generate Jenkins User Token.
This field is needed only for Blue Ocean plugin specific data.
NOTE: In most cases this can be left empty. - Set "Trust " if required. If this is enabled, all certificates are trusted in network communication between Jenkins Plugin and Propelo's Saas.
NOTE: This should be disabled by default. In specific cases involving network proxies this needs to be enabled.
- Sign-in to Jenkins and select Manage Jenkins.
- Maven
Steps:
-
Build command:
mvn install
-
This creates an
hpi
file that can be uploaded to Jenkins:
target/propelo-job-reporter.hpi
Notes:
-
Use Java 8 to build otherwise there will be some issues with Javadoc step, e.g.:
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 mvn install
-
- Gradle
Steps:
-
Build command: JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ./gradlew clean build
-
This creates an
hpi
file that can be uploaded to Jenkins:
build/libs/propelo-job-reporter.hpi
Notes:
-
Use Java 8 to build otherwise there will be some issues with Javadoc step, e.g.:
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ./gradlew clean build
-
The findbugs step may fail (skipTests=true doesn't seem to work) but anaways runs after the build has been created
- Add Plugin: go to Manage Plugins > Advanced > Upload Plugin http://jenkins-host/pluginManager/advanced
Test while developing
JENKINS_HOME=jenkins-job-reporter/work ./gradlew clean server JENKINS_HOME=jenkins-job-reporter/work JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ./gradlew clean server GRADLE_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 JENKINS_HOME=jenkins-job-reporter/work JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ./gradlew clean server
Run Jenkins docker image:
Blue Ocean Jenkins
https://hub.docker.com/r/jenkinsci/blueocean/
Officcial jenkins docker (lts or any specific version)
docker run -d --name jenkins-dev -p 8080:8080 -p 50000:50000 --mount "type=bind,source=/<base path>/data/jenkins_dev,target=/var/jenkins_home" --env JAVA_OPTS=-Dhudson.footerURL=https://levelops.io jenkins/jenkins:lts
- Run integration test class over Wiremock provided in resources
Jelly UI: https://wiki.jenkins.io/display/JENKINS/Jelly+form+controls
- Adding Plugin Manually return error "413 Request Entity Too Large".
This is a known issue with Jenkins Nginx default settings.
Solution: Increase client max body size limit in Nginx config- Edit Nginx config
vi /etc/nginx/nginx.conf
- Add the following line to http or server or location context to increase the size limit
\# set client body size to 20M \# client_max_body_size 20M;
- Restart Nginx service
service nginx reload
Link to Jenkins Bug.
Link to solution instructions.
Link to Jenkins Gradle Plugin
Link to Jenkins Gradle Plugin - GitHub - Edit Nginx config