Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run in Java 6, Update to 1.532.1 parent, added extra metrics #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
44 changes: 44 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="target/generated-sources/localizer">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/inject-tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
target/
.classpath
.project
.settings/

target/
.settings/

/work
23 changes: 23 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>graphite-plugin</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This plugin allows you to send the following metrics to one or more graphite servers: number of tests, tests skipped, tests failed, build duration, cobertura total line coverage and cobertura total branch coverage.


If you don't have a graphite server you can use : https://www.hostedgraphite.com to test.
78 changes: 42 additions & 36 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,82 +1,88 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.509.1</version><!-- which version of Jenkins is this plugin
<version>1.607</version><!-- which version of Jenkins is this plugin
built against? -->
</parent>

<artifactId>graphiteIntegrator</artifactId>
<version>1.2-SNAPSHOT</version>
<version>1.2.1-SNAPSHOT</version>
<packaging>hpi</packaging>
<url>https://wiki.jenkins-ci.org/display/JENKINS/Graphite-plugin</url>

<developers>
<developer>
<id>joachim_rodrigues</id>
<name>joachim rodrigues</name>
<email>[email protected]</email>
<id>joachim_rodrigues</id>
<name>joachim rodrigues</name>
<email>[email protected]</email>
</developer>
</developers>

<scm>
<connection>scm:git:ssh://github.com/jenkinsci/graphite-plugin.git</connection>
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/graphite-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/graphite-plugin</url>
</scm>
<connection>scm:git:ssh://github.com/jenkinsci/graphite-plugin.git</connection>
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/graphite-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/graphite-plugin</url>
</scm>

<!-- get every artifact through repo.jenkins-ci.org, which proxies all the
artifacts that we need -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>

<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<goals>deploy</goals>
<goals>deploy</goals>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<dependencies>
<dependency>
<groupId>net.sourceforge.cobertura</groupId>
<artifactId>cobertura</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>1.3</version>
</dependency>
</dependencies>

<distributionManagement>
<repository>
<id>maven.jenkins-ci.org</id>
<url>http://maven.jenkins-ci.org:8081/content/repositories/releases/</url>
</repository>
</distributionManagement>
<repository>
<id>maven.jenkins-ci.org</id>
<url>http://maven.jenkins-ci.org:8081/content/repositories/releases/</url>
</repository>
</distributionManagement>

<properties>
<maven-hpi-plugin.version>1.95</maven-hpi-plugin.version>

<maven-hpi-plugin.version>1.112</maven-hpi-plugin.version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ public final class DescriptorImpl extends BuildStepDescriptor<Publisher> impleme
/**
*
*/
private final CopyOnWriteList<Server> servers = new CopyOnWriteList<>();
private final CopyOnWriteList<Server> servers = new CopyOnWriteList<Server>();

/**
*
*/
private GraphiteValidator validator = new GraphiteValidator();


private String baseQueueName;

/**
* The default constructor.
*/
Expand Down Expand Up @@ -116,10 +119,16 @@ public Publisher newInstance(StaplerRequest req, JSONObject formData) {
@Override
public boolean configure(StaplerRequest req, JSONObject formData) {
servers.replaceBy(req.bindParametersToList(Server.class, "serverBinding."));
baseQueueName = formData.optString("baseQueueName", "");
save();
return true;
}

public String getBaseQueueName(){
return baseQueueName;
}


/**
* @param ip
* @param port
Expand Down Expand Up @@ -188,4 +197,22 @@ public FormValidation doCheckPort(@QueryParameter final String value) {

return FormValidation.ok("Port is correctly configured");
}

/**
*
* @param value
* @return
*/
public FormValidation doCheckBaseQueueName(@QueryParameter final String value) {
if(!validator.isBaseQueueNamePresent(value)){
return FormValidation.ok();
}

if(!validator.validateBaseQueueName(value)){
return FormValidation.error("Please ");
}

return FormValidation.ok("Base queue name is correctly Configured");

}
}
Loading