Skip to content

Commit

Permalink
Merge branch 'release/stashnotifier-1.9'
Browse files Browse the repository at this point in the history
Conflicts:
	pom.xml
  • Loading branch information
scaytrase committed Nov 7, 2015
2 parents 4f8ff89 + d1fe10a commit 82861b4
Show file tree
Hide file tree
Showing 19 changed files with 608 additions and 253 deletions.
26 changes: 19 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
syntax: glob
*.class

# Idea trash
stashNotifier.i*
.idea/*
*.iml

# System trash
.DS_Store
**/Thumbs.db

# Temp dirs
target/*
work/*
bin/*

*.class
.classpath
.project
.checkstyle
.settings

build.properties
target/*
work/*
bin/*
**/Thumbs.db
stashNotifier.i*
.idea/*



13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: java

deploy:
provider: releases
api_key: $API_KEY
file: target/stashNotifier.hpi
skip_cleanup: true
on:
tags: true

# Requires user input
#after_deploy:
# - mvn release:prepare release:perform -Dusername=$JENKINS_USERNAME -Dpassword=$JENKINS_KEY
66 changes: 59 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@
<version>1.498</version>
</parent>

<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>stashNotifier</artifactId>
<version>1.8</version>
<version>1.9.0</version>
<name>Stash Notifier</name>
<description>
Jenkins plugin to notify Atlassian Stash git repository servers of
build results through the Stash build API.
Jenkins plugin to notify Atlassian Stash (Bitbucket) git repository servers of
build results through the Stash build API.
</description>
<url>http://wiki.jenkins-ci.org/display/JENKINS/StashNotifier+Plugin</url>
<packaging>hpi</packaging>

<scm>
<connection>scm:git:git://github.com/jenkinsci/stashnotifier-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/stashnotifier-plugin.git</developerConnection>
<connection>scm:git:https://github.com/jenkinsci/stashnotifier-plugin.git</connection>
<developerConnection>scm:git:https://github.com/jenkinsci/stashnotifier-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/stashnotifier-plugin</url>
</scm>
</scm>

<distributionManagement>
<repository>
Expand All @@ -35,6 +34,10 @@
<id>gruetter</id>
<name>Georg Gruetter</name>
</developer>
<developer>
<id>scaytrase</id>
<name>Pavel Batanov</name>
</developer>
</developers>

<properties>
Expand All @@ -60,6 +63,42 @@
<version>2.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1.22</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plain-credentials</artifactId>
<version>1.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>token-macro</artifactId>
<version>1.11</version>
<type>jar</type>
</dependency>
</dependencies>

<pluginRepositories>
Expand All @@ -68,4 +107,17 @@
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>InjectedTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
5 changes: 2 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ click on *Add post-build action* and select *Notify Stash Instance*
server and check the URL in the browser. The URL
<tt>http://georg@localhost:7991/projects</tt> e. g. reveals the
server base URL, which is <tt>http://localhost:7991</tt> in this case.
2. Enter the Stash user name which is used to authenticate the plugin with
the Stash build API.
3. Enter the Stash users password.
2. Use the [Credentials Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Plugin) to select credentials for stash

That's it. If you have configured everything correctly, Jenkins will notify
your Stash instance of subsequent builds. The result is illustrated on
Expand All @@ -38,6 +36,7 @@ Maintainers
===========

* Georg Gruetter ([Twitter](https://twitter.com/bumbleGee), [GitHub](https://github.com/gruetter))
* Pavel Batanov ([GitHub](https://github.com/scaytrase))

License
=======
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.jenkinsci.plugins.stashNotifier;

import com.cloudbees.plugins.credentials.Credentials;
import com.cloudbees.plugins.credentials.CredentialsMatcher;
import com.cloudbees.plugins.credentials.common.CertificateCredentials;
import com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials;

/**
* A very simple matcher to ensure we only show username/password or certificate credentials
*/
public class StashCredentialMatcher implements CredentialsMatcher {
public boolean matches(Credentials credentials) {
return (credentials instanceof CertificateCredentials) || (credentials instanceof UsernamePasswordCredentials);
}
}
Loading

0 comments on commit 82861b4

Please sign in to comment.