Blank bamboo plugin

This commit is contained in:
Carolyn Van Slyck 2015-06-11 16:08:19 -05:00
commit 4147b55ffb
11 changed files with 227 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

6
LICENSE Normal file
View file

@ -0,0 +1,6 @@
To avoid future confusion, we recommend that you include a license with your plugin.
This file is simply a reminder.
For a template license you can have a look at: http://www.opensource.org/licenses/
Atlassian releases most of its modules under the Apache2 license: http://opensource.org/licenses/Apache-2.0

13
README Normal file
View file

@ -0,0 +1,13 @@
You have successfully created an Atlassian Plugin!
Here are the SDK commands you'll use immediately:
* atlas-run -- installs this plugin into the product and starts it on localhost
* atlas-debug -- same as atlas-run, but allows a debugger to attach at port 5005
* atlas-cli -- after atlas-run or atlas-debug, opens a Maven command line window:
- 'pi' reinstalls the plugin into the running product instance
* atlas-help -- prints description for all commands in the SDK
Full documentation is always available at:
https://developer.atlassian.com/display/DOCS/Introduction+to+the+Atlassian+Plugin+SDK

85
pom.xml Normal file
View file

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>com.carolynvs</groupId>
<artifactId>github.webhook</artifactId>
<version>1.0-SNAPSHOT</version>
<organization>
<name>Carolyn Van Slyck</name>
<url>http://carolynvanslyck.com/</url>
</organization>
<name>GitHub WebHook</name>
<description>Easily trigger bamboo builds from GitHub branches and pull requests.</description>
<packaging>atlassian-plugin</packaging>
<properties>
<bamboo.version>5.9.0</bamboo.version>
<bamboo.data.version>5.9.0</bamboo.data.version>
<amps.version>5.0.13</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
</properties>
<dependencies>
<dependency>
<groupId>com.atlassian.bamboo</groupId>
<artifactId>atlassian-bamboo-web</artifactId>
<version>${bamboo.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<!-- WIRED TEST RUNNER DEPENDENCIES -->
<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
<version>${plugin.testrunner.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-bamboo-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${bamboo.version}</productVersion>
<productDataVersion>${bamboo.data.version}</productDataVersion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,6 @@
package com.carolynvs.github.webhook;
public interface MyPluginComponent
{
String getName();
}

View file

@ -0,0 +1,23 @@
package com.carolynvs.github.webhook;
import com.atlassian.sal.api.ApplicationProperties;
public class MyPluginComponentImpl implements MyPluginComponent
{
private final ApplicationProperties applicationProperties;
public MyPluginComponentImpl(ApplicationProperties applicationProperties)
{
this.applicationProperties = applicationProperties;
}
public String getName()
{
if(null != applicationProperties)
{
return "myComponent:" + applicationProperties.getDisplayName();
}
return "myComponent";
}
}

View file

@ -0,0 +1,32 @@
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="github.webhook"/>
<!-- add our web resources -->
<web-resource key="github.webhook-resources" name="github.webhook Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="github.webhook.css" location="/css/github.webhook.css"/>
<resource type="download" name="github.webhook.js" location="/js/github.webhook.js"/>
<resource type="download" name="images/" location="/images"/>
<context>github.webhook</context>
</web-resource>
<!-- publish our component -->
<component key="myPluginComponent" class="com.carolynvs.github.webhook.MyPluginComponentImpl" public="true">
<interface>com.carolynvs.github.webhook.MyPluginComponent</interface>
</component>
<!-- import from the product container -->
<component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" />
</atlassian-plugin>

View file

@ -0,0 +1,2 @@
#put any key/value pairs here
my.plugin.name=MyPlugin

View file

@ -0,0 +1,28 @@
package it.com.carolynvs.github.webhook;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner;
import com.carolynvs.github.webhook.MyPluginComponent;
import com.atlassian.sal.api.ApplicationProperties;
import static org.junit.Assert.assertEquals;
@RunWith(AtlassianPluginsTestRunner.class)
public class MyComponentWiredTest
{
private final ApplicationProperties applicationProperties;
private final MyPluginComponent myPluginComponent;
public MyComponentWiredTest(ApplicationProperties applicationProperties,MyPluginComponent myPluginComponent)
{
this.applicationProperties = applicationProperties;
this.myPluginComponent = myPluginComponent;
}
@Test
public void testMyName()
{
assertEquals("names do not match!", "myComponent:" + applicationProperties.getDisplayName(),myPluginComponent.getName());
}
}

View file

@ -0,0 +1,17 @@
package ut.com.carolynvs.github.webhook;
import org.junit.Test;
import com.carolynvs.github.webhook.MyPluginComponent;
import com.carolynvs.github.webhook.MyPluginComponentImpl;
import static org.junit.Assert.assertEquals;
public class MyComponentUnitTest
{
@Test
public void testMyName()
{
MyPluginComponent component = new MyPluginComponentImpl(null);
assertEquals("names do not match!", "myComponent",component.getName());
}
}

View file

@ -0,0 +1,14 @@
<atlassian-plugin key="${project.groupId}.${project.artifactId}-tests" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
</plugin-info>
<!-- from our base plugin -->
<component-import key="myComponent" interface="com.carolynvs.github.webhook.MyPluginComponent"/>
<!-- from the product container -->
<component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" />
</atlassian-plugin>