AtlasCamp 2010: The Atlassian Plugin SDK For Fun & Profit - Ben Speakmon

Preview:

Citation preview

The Atlassian Plugin SDK For Fun & Profit

Ben SpeakmonAtlassian Developer Relations

Wednesday, November 3, 2010

Agenda

• Challenges in writing plugins

• How the SDK fixes it

• SDK in action

• What’s new

• Getting involved

Wednesday, November 3, 2010

Plugin challengesI am yours, you are mineYou are what you areAnd you make it hard

--”Suite: Judy Blue Eyes”, Crosby, Stills & Nash

Wednesday, November 3, 2010

Effective plugin development

• Different than product development

• Work within someone else’s sandbox

• Three things that MUST be easy:

• Starting the product

• Configuring the product

• Installing the plugin

Wednesday, November 3, 2010

Challenge #1: StartingProduct Startup method

JIRA bin/startup.sh or .bat (standalone) or WAR install into app. server

Confluence bin/startup.sh or .bat (standalone) or WAR install into app. server

Bamboo bamboo.sh or Win32 service or WAR install into app. server

Crowd start_crowd.sh or .bat (standalone) or WAR install into app. server

FishEye/Crucible run.sh or .bat – no WAR version available

Wednesday, November 3, 2010

Challenge #2: ConfigProduct Data/logs dir. Configuration

JIRA jira-home WEB-INF/classes/jira-application.properties

Confluence None by defaultWEB-INF/classes/confluence-

init.properties

Bamboo None by defaultWEB-INF/classes/bamboo-

init.properties

Crowd None by defaultWEB-INF/classes/crowd-

init.properties, system / servlet context property

FishEye/Crucible

var FISHEYE_INST environment variable

Wednesday, November 3, 2010

Challenge #3: Plugin install

Product Install methods

JIRA Two plugin directories for different plugin systems, web interface

Confluence Two plugin directories for different plugin systems, web interface, plugin repository

Bamboo Two plugin directories for different plugin systems, web interface

Crowd One plugin directory (plugins 2 only)

FishEye/Crucible One plugin directory (plugins 2 only)

Wednesday, November 3, 2010

And if that wasn’t enough...

• Build systems

• Maven 1 or 2? Ant?

• Confusing dependencies

• Starting a plugin project

• Expert product knowledge required just to get started

• Maven archetypes are too hard to use

Wednesday, November 3, 2010

It all adds up to...

• Lots of small headaches

• Not your fault

• Not your job to fix them

• Slow code/test/debug cycle

• Frustration

Wednesday, November 3, 2010

How the SDK deals with this

“What is happiness? The feeling that power is growing, that resistance is overcome.”

--Friedrich Nietzsche, LISP user

Wednesday, November 3, 2010

Challenge #1: StartingProduct Startup method

JIRA bin/startup.sh or .bat (standalone) or WAR install into app. server

Confluence bin/startup.sh or .bat (standalone) or WAR install into app. server

Bamboo bamboo.sh or Win32 service or WAR install into app. server

Crowd start_crowd.sh or .bat (standalone) or WAR install into app. server

FishEye/Crucible run.sh or .bat – no WAR version available

Wednesday, November 3, 2010

Challenge #1: StartingProduct Startup method

JIRA bin/startup.sh or .bat (standalone) or WAR install into app. server

Confluence bin/startup.sh or .bat (standalone) or WAR install into app. server

Bamboo bamboo.sh or Win32 service or WAR install into app. server

Crowd start_crowd.sh or .bat (standalone) or WAR install into app. server

FishEye/Crucible run.sh or .bat – no WAR version available

atlas-runWednesday, November 3, 2010

Challenge #2: ConfigProduct Data/logs dir. Configuration

JIRA jira-home WEB-INF/classes/jira-application.properties

Confluence None by defaultWEB-INF/classes/confluence-

init.properties

Bamboo None by defaultWEB-INF/classes/bamboo-

init.properties

Crowd None by defaultWEB-INF/classes/crowd-

init.properties, system / servlet context property

FishEye/Crucible

var FISHEYE_INST environment variable

Wednesday, November 3, 2010

Challenge #2: ConfigProduct Data/logs dir. Configuration

JIRA jira-home WEB-INF/classes/jira-application.properties

Confluence None by defaultWEB-INF/classes/confluence-

init.properties

Bamboo None by defaultWEB-INF/classes/bamboo-

init.properties

Crowd None by defaultWEB-INF/classes/crowd-

init.properties, system / servlet context property

FishEye/Crucible

var FISHEYE_INST environment variable

Logs sent to console, preconfigured data dirs

Wednesday, November 3, 2010

Challenge #3: Plugin install

Product Install methods

JIRA Two plugin directories for different plugin systems, web interface

Confluence Two plugin directories for different plugin systems, web interface, plugin repository

Bamboo Two plugin directories for different plugin systems, web interface

Crowd One plugin directory (plugins 2 only)

FishEye/Crucible One plugin directory (plugins 2 only)

Wednesday, November 3, 2010

Challenge #3: Plugin install

Product Install methods

JIRA Two plugin directories for different plugin systems, web interface

Confluence Two plugin directories for different plugin systems, web interface, plugin repository

Bamboo Two plugin directories for different plugin systems, web interface

Crowd One plugin directory (plugins 2 only)

FishEye/Crucible One plugin directory (plugins 2 only)

Automatic through atlas-run

Wednesday, November 3, 2010

SDK DesignA process cannot be understood by stopping it. Understanding must move with the flow of the

process, must join it and flow with it.-- First Law of Mentat

Wednesday, November 3, 2010

Atlassian MavenPlugin Suite

• Suite of Maven plugins

• maven-jira-plugin, maven-confluence-plugin, etc.

• Common interface to products

• Handles installation and configuration

• Can be used independently of the SDK

Wednesday, November 3, 2010

Script shortcutsTask Maven command Script

Start product with current plugin installed

mvn amps:run atlas-run

Start product with current plugin installed and

debuggablemvn amps:debug atlas-debug

Start JIRA on port 8243 and context “myjira” with current

plugin installed

mvn amps:run –Dproduct=jira –Dcontext.path=/myjira –Dhttp.port=8243

atlas-run--product jira--context-path /myjira--http-port 8243

Run arbitrary Maven command

mvn myplugin:mygoal <parameters>

atlas-mvn myplugin:mygoal <parameters>

Wednesday, November 3, 2010

SDK in actionBy pressing down a special keyIt plays a little melody

--”Pocket Calculator”, Kraftwerk

Wednesday, November 3, 2010

SDK with Plugins 1.0

• SDK is only at full power with plugins 2

• http://confluence.atlassian.com/x/wRyyCg for details on how

Wednesday, November 3, 2010

30-second Plugin Creation™

• Creating a plugin is dirt simple!

• atlas-create-<product>-plugin

• Executes a Maven archetype

• Automatically prompts for required information

• Created plugin project works out of the box

Wednesday, November 3, 2010

Creating a new plugin

Wednesday, November 3, 2010

Creating a new plugin

Wednesday, November 3, 2010

On-the-fly code change

• Fast code/test/debug

• Start a CLI instance in a separate terminal from atlas-run

•Make a code change

• Reinstall the plugin from the CLI

Wednesday, November 3, 2010

CLI plugin installation

Wednesday, November 3, 2010

CLI plugin installation

Wednesday, November 3, 2010

Auto resource reload

• Plugin web resources are monitored

• Detects change and auto-updates

• Just reload the browser, see your changes, get the green-skinned alien girl, repeat

Wednesday, November 3, 2010

Changing a live gadget

Wednesday, November 3, 2010

Changing a live gadget

Wednesday, November 3, 2010

Boxed Maven• Contains a standalone,

isolated Maven 2.1.0

• Uses Atlassian repos by default

• No extra configuration needed

• Usable on its own

• atlas-mvn passes parameters and goals straight through

Wednesday, November 3, 2010

What’s newCome on! Stop trying to hit me and hit me!

--Morpheus, The Matrix

Wednesday, November 3, 2010

External home directories

• Create a zip of an existing product home directory

• atlas-run starts the product with that data/configuration/etc.

• Thanks to Jonathan Doklovic @ SysBliss!

Wednesday, November 3, 2010

Test groups

• Create groups of tests

• Write a group of tests for all supported products and separate groups for product-specific testing

• Run one, some, or all groups at once

Wednesday, November 3, 2010

Multiple version testing

• Run a test (or a test group) against multiple versions of the same product

• “Why does it work in JIRA 4.1 but not 4.2?”

Wednesday, November 3, 2010

Co-installs

• Your plugin may require other plugins or special artifacts to run

• SDK can install these for you during atlas-run or atlas-debug

Wednesday, November 3, 2010

Getting involvedBe the change you seek.

--Fifth Atlassian Value

Wednesday, November 3, 2010

Vital statistics

• The SDK is open source

• Apache License 2.0

• Frequent updates, new features and support for new product releases

• Outside committers contributing

Wednesday, November 3, 2010

Helping out

• Development IS at http://studio.atlassian.com/browse/AMPS

• Things YOU can help with right now:

• Documentation

• Testing on Windows

• Features YOU can help with:

• Per-plugin storage

Wednesday, November 3, 2010

Wrap-up

• SDK makes plugin and gadget creation easier

• Works in all products

• Faster code/test/debug cycle

• Tight integration with Atlassian

• Flexible enough to work in your system

Wednesday, November 3, 2010

Resources• Writing plugins: http://confluence.atlassian.com/x/

CgbvCw

• Marketplace: http://plugins.atlassian.com

• Hosting: http://studio.plugins.atlassian.com

• Forums: http://discuss.atlassian.com

• Contact Developer Relations:

• developer-relations@atlassian.com

• irc.freenode.net #atlassiandev

Wednesday, November 3, 2010

Recommended