Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Gradle Show and Tell

138 vues

Publié le

Over the past few years, Gradle has become a popular build tool in the JVM space. This is not surprising, considering the power and the features it brings, compared with its competitors. However, one thing Gradle lacks is history and the collective knowledge at the same level of other alternatives: how does one organize a Gradle project in an ‘idiomatic’ fashion?

We feel that we’ve put together a decent build pipeline for each of our microservices over the years, and each one starts with their build.gradle file(s). We’d like to share it, although we’re not sure if it’s the ‘correct’ way.

In this talk, we’ll walk through a sample project structure and build process. We’ll discuss the various checks and tools we use (e.g. Sonar, CodeNarc, Jenkins) at each step of the build. We’ll explain how each of the components in the process work for us, and share samples of our Groovy scripts. Most importantly, though, we’d like to hear what the audience are using in their builds!

Publié dans : Technologie
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Gradle Show and Tell

  1. 1. Show and Tell: Our Gradle Build Steve Pember Director of Engineering, Klaviyo Gr8Conf US 2018 @svpember
  2. 2. A Long Time Ago…
  3. 3. @svpember
  4. 4. So. Simple.
  5. 5. @svpember • 1. Checkout from Github • 2. build war
  6. 6. @svpember
  7. 7. @svpember Personally prefer Gradle over Maven • DSL vs XML • Task Graph vs sequential goals • Incrementality • Performance
  8. 8. @svpember
  9. 9. @svpember
  10. 10. Ha ha!
  11. 11. @svpember Agenda • Musings on Builds • Some background on the situation at ThirdChannel • Responsibilities of Gradle • Responsibilities of Jenkins • Let’s look at some code • What did I miss?
  12. 12. @svpember Agenda • Musings on Builds • Some background on the situation at ThirdChannel • Responsibilities of Gradle • Responsibilities of Jenkins • Let’s look at some code • What did I miss?
  13. 13. Continuous Deployment is your Ultimate Goal
  14. 14. Is a Venn Diagram Appropriate?
  15. 15. Continuous Integration: Software -> Quality Checks -> Artifact
  16. 16. @svpember
  17. 17. @svpember
  18. 18. Continuous Delivery -> Reliable, Repeated Deploys
  19. 19. @svpember Agenda • Musings on Builds • Some background on the situation at ThirdChannel
  20. 20. @svpember Our Background • Microservices
  21. 21. @svpember Our Background • Microservices • Multi-Project builds
  22. 22. @svpember
  23. 23. @svpember Our Background • Microservices • Multi-Project builds • Jenkins Continuous Integration Pipelines
  24. 24. @svpember
  25. 25. @svpember
  26. 26. @svpember
  27. 27. @svpember
  28. 28. @svpember Our Background • Microservices • Multi-Project builds • Jenkins Continuous Integration Pipelines • No Real Story on Continuous Delivery
  29. 29. Be Afraid.
  30. 30. Well… it works…
  31. 31. @svpember Agenda • Musings on Builds • Some background on the situation at ThirdChannel • Responsibilities of Gradle
  32. 32. Local Vs Remote Builds
  33. 33. @svpember Local Vs Remote Builds • Local: Fast, with some minimum level of acceptable testing • Remote: thorough testing, with some minimal acceptable build time (15 min?) • Your Gradle file will be more expressive than local needs • Needs to support both Local and Remote in one build
  34. 34. @svpember Parent vs Service Build File • Parent: defines global config • Parent: defines approved dependency versions, with excludes • Service: local overrides
  35. 35. @svpember Our (MY) Requirements: • No building ‘final’ artifact from command line • No deploying from command line • Should act as guardrails for additional services and new engineers
  36. 36. @svpember Quality Gate Checks
  37. 37. @svpember Quality Gate Checks
  38. 38. @svpember Quality Gate Checks
  39. 39. @svpember Quality Gate Checks
  40. 40. @svpember Agenda • Musings on Builds • Some background on the situation at ThirdChannel • Responsibilities of Gradle • Responsibilities of Jenkins
  41. 41. @svpember Jenkins Responsibilities • Repository of Build History • Integration / Communication • Build Planning & Execution • Environment Setup and Isolation • Build Reporting • Artifact Production
  42. 42. @svpember Agenda • Musings on Builds • Some background on the situation at ThirdChannel • Responsibilities of Gradle • Responsibilities of Jenkins • Let’s look at some code
  43. 43. Walkthrough
  44. 44. @svpember
  45. 45. Remote
  46. 46. @svpember
  47. 47. @svpember
  48. 48. @svpember
  49. 49. @svpember
  50. 50. @svpember
  51. 51. @svpember Fail
  52. 52. @svpember Fail
  53. 53. @svpember Success
  54. 54. @svpember Success
  55. 55. @svpember 2 Main Take-aways 1. Pater Build plugin: provides parent POM behavior to your projects 2. Isolated Integration Builds: quality gate checks on every push
  56. 56. @svpember Agenda • Musings on Builds • Some background on the situation at ThirdChannel • Responsibilities of Gradle • Responsibilities of Jenkins • Let’s look at some code • What did I miss?
  57. 57. Anyone want to share?
  58. 58. Thank You! @svpember
  59. 59. @svpember Images • Table Flip: https://knowyourmeme.com/photos/170508-flipping-tables-%E2%95%AF%E2%96%A1%E2%95%AF%EF%B8%B5- %E2%94%BB%E2%94%81%E2%94%BB • Assembly Line: www.solidsmack.com/culture/humans-need-apply-new-short-film-explores-future-robots-manufacturing-automation/ • Poop Hieroglyphic: https://www.wired.com/story/history-of-poop-emoji/ • Civil War: http://nothingbutgeek.com/2016/05/captain-america-civil-war-story-featurette/ • Time Passing: https://themoodcatalogue.com/time-passes-by/o-time-passing-facebook/ • Golden Age / Athens: https://commons.wikimedia.org/wiki/File:School-of-athens2.jpg • No, No, No: https://giphy.com/gifs/no-arrested-development-what-11NBUrJDuMd5As • Box of Shame: https://giphy.com/gifs/shame-for-box-of-eP1fobjusSbu • Pinnacle of the mountain: https://www.outdoorproject.com/adventures/vermont/showshoeing/stowe-pinnacle • Statler and Waldorf: https://vignette.wikia.nocookie.net/muppet/images/3/3d/TMS-Statler%26Waldorf-BalconyBox.jpg • CD vs CD: https://puppet.com/blog/continuous-delivery-vs-continuous-deployment-what-s-diff • Hexagonal Architecture: https://herbertograca.com/2017/09/14/ports-adapters-architecture/#what-is-an-adapter • Canary deployments: http://electric-cloud.com/blog/2015/10/using-canary-releases-and-early-life-support-to-improve-production-releases/ • Sharing: http://business2government.com.au/marketing-to-government/shared-services-in-the-public-sector-lets-focus-on-service-delivery/ • Infinite loop: https://www.atlassian.com/blog/continuous-delivery/practical-continuous-deployment
  60. 60. @svpember Links • Parent Build example file: https://github.com/spember/gradle-parent-example

×