Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Working on partner API

  • Loading branch information...
commit 5af5bc7720a93e3e8b43e2d94ede8f97a888d48d 1 parent 0061be7
@holm holm authored
Showing with 32 additions and 14 deletions.
  1. +21 −3 pom.xml
  2. +11 −11 src/main/java/com/podio/hudson/PodioBuildNotifier.java
View
24 pom.xml
@@ -9,9 +9,9 @@
</parent>
<groupId>com.podio</groupId>
- <artifactId>podio-publisher</artifactId>
+ <artifactId>hudson</artifactId>
<name>Podio Build</name>
- <version>0.1.0-SNAPSHOT</version>
+ <version>1.0.0</version>
<packaging>hpi</packaging>
<!-- get every artifact through maven.glassfish.org, which proxies all the
@@ -21,7 +21,25 @@
<id>m.g.o-public</id>
<url>http://maven.glassfish.org/content/groups/public/</url>
</repository>
+ <repository>
+ <id>nexus.podio.com</id>
+ <name>Podio Nexus</name>
+ <url>http://localhost:9191/nexus/content/repositories/releases/</url>
+ </repository>
</repositories>
+ <distributionManagement>
+ <repository>
+ <id>nexus</id>
+ <name>Podio Nexus</name>
+ <url>http://localhost:9191/nexus/content/repositories/releases/</url>
+ </repository>
+ </distributionManagement>
+ <licenses>
+ <license>
+ <name>MIT</name>
+ <url>http://creativecommons.org/licenses/MIT/</url>
+ </license>
+ </licenses>
<pluginRepositories>
<pluginRepository>
@@ -33,7 +51,7 @@
<dependency>
<groupId>com.podio</groupId>
<artifactId>api</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
View
22 src/main/java/com/podio/hudson/PodioBuildNotifier.java
@@ -38,7 +38,7 @@
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
-import com.podio.BaseAPI;
+import com.podio.ResourceFactory;
import com.podio.common.Reference;
import com.podio.common.ReferenceType;
import com.podio.contact.ContactAPI;
@@ -125,10 +125,10 @@ public BuildStepMonitor getRequiredMonitorService() {
return BuildStepMonitor.BUILD;
}
- private BaseAPI getBaseAPI() {
+ private ResourceFactory getBaseAPI() {
DescriptorImpl descriptor = (DescriptorImpl) getDescriptor();
- return new BaseAPI(descriptor.hostname, descriptor.hostname,
+ return new ResourceFactory(descriptor.hostname, descriptor.hostname,
descriptor.port, descriptor.ssl, false,
new OAuthClientCredentials(clientId, clientSecret),
new OAuthUsernameCredentials(username, password));
@@ -137,7 +137,7 @@ private BaseAPI getBaseAPI() {
@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
BuildListener listener) throws InterruptedException, IOException {
- BaseAPI baseAPI = getBaseAPI();
+ ResourceFactory baseAPI = getBaseAPI();
String result = StringUtils.capitalize(build.getResult().toString()
.toLowerCase());
@@ -211,7 +211,7 @@ private Run getFirstFailure(Run build) {
}
}
- private Integer getItemId(BaseAPI baseAPI, int buildNumber) {
+ private Integer getItemId(ResourceFactory baseAPI, int buildNumber) {
ItemsResponse response = new ItemAPI(baseAPI).getItemsByExternalId(
APP_ID, Integer.toString(buildNumber));
if (response.getFiltered() != 1) {
@@ -221,7 +221,7 @@ private Integer getItemId(BaseAPI baseAPI, int buildNumber) {
return response.getItems().get(0).getId();
}
- private int postBuild(BaseAPI baseAPI, int buildNumber, String result,
+ private int postBuild(ResourceFactory baseAPI, int buildNumber, String result,
String url, String changes, Set<Integer> userIds,
Integer totalTestCases, Integer failedTestCases, String duration) {
List<FieldValuesUpdate> fields = new ArrayList<FieldValuesUpdate>();
@@ -261,11 +261,11 @@ public boolean needsToRunAfterFinalized() {
return true;
}
- private SpaceWithOrganization getSpace(BaseAPI baseAPI) {
+ private SpaceWithOrganization getSpace(ResourceFactory baseAPI) {
return new SpaceAPI(baseAPI).getSpaceByURL(spaceURL);
}
- private Set<Integer> getUserIds(BaseAPI baseAPI, int spaceId,
+ private Set<Integer> getUserIds(ResourceFactory baseAPI, int spaceId,
AbstractBuild<?, ?> build) {
Set<Integer> userIds = new HashSet<Integer>();
@@ -309,7 +309,7 @@ private String getChangesText(AbstractBuild<?, ?> build) {
return out;
}
- private Integer getUserId(BaseAPI baseAPI, int spaceId, User user) {
+ private Integer getUserId(ResourceFactory baseAPI, int spaceId, User user) {
UserProperty mailProperty = user.getProperty(Mailer.UserProperty.class);
if (mailProperty == null) {
return null;
@@ -367,7 +367,7 @@ public FormValidation doValidateAuth(
@QueryParameter("clientSecret") final String clientSecret,
@QueryParameter("spaceURL") final String spaceURL)
throws IOException, ServletException {
- BaseAPI baseAPI = new BaseAPI(hostname, hostname, port, ssl, false,
+ ResourceFactory baseAPI = new ResourceFactory(hostname, hostname, port, ssl, false,
new OAuthClientCredentials(clientId, clientSecret),
new OAuthUsernameCredentials(username, password));
@@ -402,7 +402,7 @@ public FormValidation doValidateAPI(
return FormValidation.error("Port must be an integer");
}
- BaseAPI baseAPI = new BaseAPI(hostname, hostname, portInt, ssl,
+ ResourceFactory baseAPI = new ResourceFactory(hostname, hostname, portInt, ssl,
false, null, null);
try {
Please sign in to comment.
Something went wrong with that request. Please try again.