Extending Stash - Jason Hinch

  • View

  • Download

Embed Size (px)


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.

Text of Extending Stash - Jason Hinch

  • 1. #atlassian

2. Extending StashJASON HINCH DEVELOPER ATLASSIAN @j_hinch 3. AgendaGETTING STARTEDHOOKED ON STASHTOO MUCH TO HANDLEQUESTIONS & REFERENCES 4. go.atlassian.com/stashdevdocs 5. GETTING STARTEDStash plugin 101 In-process add-on (aka p2 plugins) Shares host applications resources OSGi bundle withatlassian-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 6. Hooked on StashGETTING STARTEDHOOKED ON STASHTOO MUCH TO HANDLEQUESTIONS & REFERENCES 7. HOOKED ON STASHRepository Hooks Configured per repository Enabled/Disabled Persisted settings (optional) Prevent pushes & merges Notified on successfulchange 8. HOOKED ON STASHRepository Hooks Examples Prevent tag deletion Commits without referencedJIRA ticket Branch naming conventions Notify build server of newchanges Notify mirror to synchronize 9. Example: NamingConvention Hook 10. HOOKED ON STASHatlassian-plugin.xml 11. HOOKED ON STASHatlassian-plugin.xml 12. HOOKED ON STASHatlassian-plugin.xml 13. HOOKED ON STASHatlassian-plugin.xml 14. HOOKED ON STASHNamingConventionHook.java 15. HOOKED ON STASHNamingConventionHook.java 16. HOOKED ON STASHNamingConventionHook.java 17. HOOKED ON STASHNamingConventionHook.java 18. HOOKED ON STASHNamingConventionHook.java 19. HOOKED ON STASHNamingConventionHook.java 20. HOOKED ON STASHNamingConventionHook.java 21. HOOKED ON STASHNamingConventionHook.java 22. HOOKED ON STASHstatic/config.soy 23. HOOKED ON STASHstatic/config.soy 24. HOOKED ON STASHstatic/config.soy 25. HOOKED ON STASHstatic/config.soy 26. HOOKED ON STASHstatic/config.soy 27. Naming Convention Hook Demo 28. Naming Convention Hook Demo 29. Naming Convention Hook Demo 30. Naming Convention Hook Demo 31. Naming Convention Hook Demo 32. Naming Convention Hook Demo 33. Too much to handleGETTING STARTEDHOOKED ON STASHTOO MUCH TO HANDLEQUESTIONS & REFERENCES 34. TOO MUCH TO HANDLEFile & Diff Handlers Front-end plugin point Custom rendering for anysource and diff view Including: Pull request overview Pull request diff Changeset diff File source & diff 35. TOO MUCH TO HANDLEFile & Diff Handlers Examples 3D models CSV PDF Adobe Photoshop 36. Example:STL Handler 37. TOO MUCH TO HANDLEatlassian-plugin.xml 38. TOO MUCH TO HANDLEatlassian-plugin.xml 39. TOO MUCH TO HANDLEatlassian-plugin.xml 40. TOO MUCH TO HANDLEatlassian-plugin.xml 41. TOO MUCH TO HANDLEstl-handler.js 42. TOO MUCH TO HANDLEstl-handler.js 43. TOO MUCH TO HANDLEstl-handler.js 44. TOO MUCH TO HANDLEstl-handler.js 45. TOO MUCH TO HANDLEstl-handler.js 46. STL Handler Demo 47. STL Handler Demo 48. Questions?GETTING STARTEDHOOKED ON STASHTOO MUCH TO HANDLEQUESTIONS & REFERENCES 49. QUESTIONS & REFERENCESReferences 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/ 50. Thank you!JASON HINCH DEVELOPER ATLASSIAN @j_hinch