atlascamp 2010: the atlassian plugin sdk for fun & profit - ben speakmon

41
The Atlassian Plugin SDK For Fun & Profit Ben Speakmon Atlassian Developer Relations Wednesday, November 3, 2010

Upload: atlassian

Post on 17-May-2015

2.770 views

Category:

Technology


1 download

TRANSCRIPT

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

The Atlassian Plugin SDK For Fun & Profit

Ben SpeakmonAtlassian Developer Relations

Wednesday, November 3, 2010

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

Agenda

• Challenges in writing plugins

• How the SDK fixes it

• SDK in action

• What’s new

• Getting involved

Wednesday, November 3, 2010

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--”Pocket Calculator”, Kraftwerk

Wednesday, November 3, 2010

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

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

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

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

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

Creating a new plugin

Wednesday, November 3, 2010

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

Creating a new plugin

Wednesday, November 3, 2010

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

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

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

CLI plugin installation

Wednesday, November 3, 2010

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

CLI plugin installation

Wednesday, November 3, 2010

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

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

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

Changing a live gadget

Wednesday, November 3, 2010

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

Changing a live gadget

Wednesday, November 3, 2010

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

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

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

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

--Morpheus, The Matrix

Wednesday, November 3, 2010

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

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

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

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

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

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

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

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

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

Getting involvedBe the change you seek.

--Fifth Atlassian Value

Wednesday, November 3, 2010

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

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

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

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

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

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

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

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:

[email protected]

• irc.freenode.net #atlassiandev

Wednesday, November 3, 2010