Coder Social home page Coder Social logo

heucuva / publishtokafka-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from virtualramblas/publishtokafka-plugin

0.0 1.0 0.0 29 KB

A Jenkins post-build action plugin to publish build jobs execution relevant data to Kafka topics.

Java 92.35% HTML 7.65%

publishtokafka-plugin's Introduction

publishtokafka-plugin

A Jenkins post-build action plugin to publish build jobs execution data to Kafka topics.

What's Jenkins?

Jenkins is probably the leading Open Source automation server, implemented in Java. It provides continuous integration services and hundreds of plugins to support building, deploying and automating any project. You can extend the Jenkins features writing your own custom plugins.

What's Kafka?

Kafka is an Open Source message broker written in Scala and currently maintained by the Apache Software Foundation. It is fast, scalable, and has a modern cluster-centric design aimed to provide strong durability and fault-tolerance guarantees.

Features

This plugin publishes the build jobs execution details in JSON format to a Kafka topic. In the current release the general info about a build job, details about the host (master or slave) where a build job has been executed, the full set of parameters values for a given execution and the Git build data are collected. Future releases will collect also all of the details for each single build step. Here's an example of the current JSON message content sent to a topic:

{
	"buildNumber":7,
	"name":"KTest",
	"startDate":{
		"date":8,"day":3,"hours":12,"minutes":14,"month":2,"seconds":57,
		"time":1488975297587,"timezoneOffset":0,"year":117
	},
	"endDate":{
		"date":8,"day":3,"hours":12,"minutes":15,"month":2,"seconds":10,
		"time":1488975310027,"timezoneOffset":0,"year":117
	},
	"duration":12440,
	"result":"SUCCESS",
	"parameters":{
        "MONGODB_HOST":"mongodb1.xxx.com",
        "MONGODB_PORT":"27018"
    },
	"nodeName":"master",
	"computerName":"XXXXXXXXX",
	"gitDetails":{
		"remoteURLs":["https://github.com/virtualramblas/publishtokafka-plugin.git"],
		"lastBuiltRevision":{
			"branches":[{"SHA1":{"firstByte":73,"name":"493ce83487eef93bb119a618ce62811f79fdb26a"},
"SHA1String":"493ce83487eef93bb119a618ce62811f79fdb26a",
"name":"refs/remotes/origin/master"}],
			"sha1":{"firstByte":73,"name":"493ce83487eef93bb119a618ce62811f79fdb26a"},
			"sha1String":"493ce83487eef93bb119a618ce62811f79fdb26a"
		}
	},
	"nodeDetails":{
		"nodeLabels":"master",
		"OS":"Windows_NT",
		"numberOfProcessors":"4",
		"processorArchitecture":"x86",
		"processorArchitectureW6432":"AMD64",
		"processorIdentifier":"Intel64 Family 6 Model 78 Stepping 3, GenuineIntel",
		"computerName":"XXXXXXXXX"
	}
}  

After publishing to the destination topic data can then be consumed by other systems in order to generate stats and/or perform analytics.

How to build and install it

The plugin project has been initially created from scratch through Maven (same as for the other available Jenkins plugins), so you need Maven in order to build it starting from the source code. Please read this post in my personal blog in order to understand how to set up Maven to work locally with Jenkins plugins.
After downloading the project you need to move to the root directory of the project (the one containing the pom.xml file) and run the following command to build it:

mvn compile

or start to look at how it works:

mvn hpi:run

In order to produce the .hpi installer run the following Maven command:

mvn install

Then you can install it on your server simply uploading it through the Manage Jenkins -> Manage Plugins-> Advanced tab of the Jenkins dashboard.
I didn't use intentionally any Java 8 feature while implementing this plugin in order to ensure compatibility with Jenkins servers still running on JVM 7 as well.

Wiki

Please have a look at this plugin's Wiki for more detailed info.

Releases

4 releases available so far:

  • 1.0: Implemented enhancements #10 and #11. Code refactoring.
  • 0.9: Fixed bug #8. Implemented enhancement #7 and change request #6.
  • 0.8: Fixed bug #4 . Implemented enhancements #1 and #2
  • 0.7: initial release

publishtokafka-plugin's People

Contributors

virtualramblas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.