extending stash - jason hinch

Post on 13-Jun-2015

455 Views

Category:

Software

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

What's the easiest way to make Stash more useful for your team? Extend it. Get the details on how to hack Stash with merge conditions, pre- and post-receive hooks, and more from Stash full stack developer Jason Hinch.

TRANSCRIPT

#atlassian

JASON HINCH • DEVELOPER • ATLASSIAN • @j_hinch

Extending Stash

H O O K E D O N S TA S H

G E T T I N G S TA RT E D

Agenda

T O O M U C H T O H A N D L E

Q U E S T I O N S & R E F E R E N C E S

go.atlassian.com/stashdevdocs

G E T T I N G S TA RT E D

Stash plugin 101• In-process add-on (aka p2 plugins)• Shares host applications resources• OSGi bundle with

atlassian-plugin.xml

• Built on the Atlassian Platform• Web - Filters, Servlets, Web Resources, Web Fragments• Business - SAL, Atlassian Cache, Atlassian Scheduler• Data - PluginSettings (SAL), ActiveObjects

• Atlassian Connect coming soon

H O O K E D O N S TA S H

G E T T I N G S TA RT E D

Hooked on Stash

T O O M U C H T O H A N D L E

Q U E S T I O N S & R E F E R E N C E S

H O O K E D O N S TA S H

Repository Hooks• Configured per repository• Enabled/Disabled• Persisted settings (optional)

• Prevent pushes & merges• Notified on successful

change

H O O K E D O N S TA S H

Repository Hooks• Examples• Prevent tag deletion• Commits without referenced

JIRA ticket• Branch naming conventions• Notify build server of new

changes• Notify mirror to synchronize

Example: Naming Convention Hook

H O O K E D O N S TA S H

atlassian-plugin.xml

H O O K E D O N S TA S H

atlassian-plugin.xml

H O O K E D O N S TA S H

atlassian-plugin.xml

H O O K E D O N S TA S H

atlassian-plugin.xml

H O O K E D O N S TA S H

NamingConventionHook.java

H O O K E D O N S TA S H

NamingConventionHook.java

H O O K E D O N S TA S H

NamingConventionHook.java

H O O K E D O N S TA S H

NamingConventionHook.java

H O O K E D O N S TA S H

NamingConventionHook.java

H O O K E D O N S TA S H

NamingConventionHook.java

H O O K E D O N S TA S H

NamingConventionHook.java

H O O K E D O N S TA S H

NamingConventionHook.java

H O O K E D O N S TA S H

static/config.soy

H O O K E D O N S TA S H

static/config.soy

H O O K E D O N S TA S H

static/config.soy

H O O K E D O N S TA S H

static/config.soy

H O O K E D O N S TA S H

static/config.soy

Naming Convention Hook Demo

Naming Convention Hook Demo

Naming Convention Hook Demo

Naming Convention Hook Demo

Naming Convention Hook Demo

Naming Convention Hook Demo

H O O K E D O N S TA S H

G E T T I N G S TA RT E D

Too much to handle

T O O M U C H T O H A N D L E

Q U E S T I O N S & R E F E R E N C E S

T O O M U C H T O H A N D L E

File & Diff Handlers• Front-end plugin point• Custom rendering for any

source and diff view• Including:• Pull request overview• Pull request diff• Changeset diff• File source & diff

T O O M U C H T O H A N D L E

File & Diff Handlers• Examples• 3D models• CSV• PDF• Adobe Photoshop

Example: STL Handler

T O O M U C H T O H A N D L E

atlassian-plugin.xml

T O O M U C H T O H A N D L E

atlassian-plugin.xml

T O O M U C H T O H A N D L E

atlassian-plugin.xml

T O O M U C H T O H A N D L E

atlassian-plugin.xml

T O O M U C H T O H A N D L E

stl-handler.js

T O O M U C H T O H A N D L E

stl-handler.js

T O O M U C H T O H A N D L E

stl-handler.js

T O O M U C H T O H A N D L E

stl-handler.js

T O O M U C H T O H A N D L E

stl-handler.js

STL Handler Demo

STL Handler Demo

H O O K E D O N S TA S H

G E T T I N G S TA RT E D

Questions?

T O O M U C H T O H A N D L E

Q U E S T I O N S & R E F E R E N C E S

Q U E S T I O N S & R E F E R E N C E S

References• Documentation - http://go.atlassian.com/stashdevdocs• Repository hook example - https://bitbucket.org/atlassianlabs/stash-naming-

convention-hook-plugin• File handler example - https://bitbucket.org/atlassian/stash-stl-plugin/

Thank you!

JASON HINCH • DEVELOPER • ATLASSIAN • @j_hinch

top related