Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Extending Stash - Jason Hinch

1,277 views

Published on

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.

Published in: Software
  • Be the first to comment

Extending Stash - Jason Hinch

  1. 1. #atlassian
  2. 2. Extending Stash JASON HINCH • DEVELOPER • ATLASSIAN • @j_hinch
  3. 3. Agenda GETTING STARTED HOOKED ON STASH TOO MUCH TO HANDLE QUESTIONS & REFERENCES
  4. 4. go.atlassian.com/stashdevdocs
  5. 5. GETTING STARTED 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
  6. 6. Hooked on Stash GETTING STARTED HOOKED ON STASH TOO MUCH TO HANDLE QUESTIONS & REFERENCES
  7. 7. HOOKED ON STASH Repository Hooks • Configured per repository • Enabled/Disabled • Persisted settings (optional) • Prevent pushes & merges • Notified on successful change
  8. 8. HOOKED ON STASH Repository Hooks • Examples • Prevent tag deletion • Commits without referenced JIRA ticket • Branch naming conventions • Notify build server of new changes • Notify mirror to synchronize
  9. 9. Example: Naming Convention Hook
  10. 10. HOOKED ON STASH atlassian-plugin.xml
  11. 11. HOOKED ON STASH atlassian-plugin.xml
  12. 12. HOOKED ON STASH atlassian-plugin.xml
  13. 13. HOOKED ON STASH atlassian-plugin.xml
  14. 14. HOOKED ON STASH NamingConventionHook.java
  15. 15. HOOKED ON STASH NamingConventionHook.java
  16. 16. HOOKED ON STASH NamingConventionHook.java
  17. 17. HOOKED ON STASH NamingConventionHook.java
  18. 18. HOOKED ON STASH NamingConventionHook.java
  19. 19. HOOKED ON STASH NamingConventionHook.java
  20. 20. HOOKED ON STASH NamingConventionHook.java
  21. 21. HOOKED ON STASH NamingConventionHook.java
  22. 22. HOOKED ON STASH static/config.soy
  23. 23. HOOKED ON STASH static/config.soy
  24. 24. HOOKED ON STASH static/config.soy
  25. 25. HOOKED ON STASH static/config.soy
  26. 26. HOOKED ON STASH static/config.soy
  27. 27. Naming Convention Hook Demo
  28. 28. Naming Convention Hook Demo
  29. 29. Naming Convention Hook Demo
  30. 30. Naming Convention Hook Demo
  31. 31. Naming Convention Hook Demo
  32. 32. Naming Convention Hook Demo
  33. 33. Too much to handle GETTING STARTED HOOKED ON STASH TOO MUCH TO HANDLE QUESTIONS & REFERENCES
  34. 34. TOO MUCH TO HANDLE 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
  35. 35. TOO MUCH TO HANDLE File & Diff Handlers • Examples • 3D models • CSV • PDF • Adobe Photoshop
  36. 36. Example: STL Handler
  37. 37. TOO MUCH TO HANDLE atlassian-plugin.xml
  38. 38. TOO MUCH TO HANDLE atlassian-plugin.xml
  39. 39. TOO MUCH TO HANDLE atlassian-plugin.xml
  40. 40. TOO MUCH TO HANDLE atlassian-plugin.xml
  41. 41. TOO MUCH TO HANDLE stl-handler.js
  42. 42. TOO MUCH TO HANDLE stl-handler.js
  43. 43. TOO MUCH TO HANDLE stl-handler.js
  44. 44. TOO MUCH TO HANDLE stl-handler.js
  45. 45. TOO MUCH TO HANDLE stl-handler.js
  46. 46. STL Handler Demo
  47. 47. STL Handler Demo
  48. 48. Questions? GETTING STARTED HOOKED ON STASH TOO MUCH TO HANDLE QUESTIONS & REFERENCES
  49. 49. QUESTIONS & REFERENCES 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/
  50. 50. Thank you! JASON HINCH • DEVELOPER • ATLASSIAN • @j_hinch

×