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.

SF Gradle Meetup - Netflix OSS

1,721 views

Published on

Published in: Technology
  • Be the first to comment

SF Gradle Meetup - Netflix OSS

  1. 1. Netflix OSS With Gradle@netflixoss
  2. 2. @NetflixOSS ProgressionCuratorAutoScalingAstyanaxServoPriamJmeterforC*ExhibitorArchaiusAsgardChaosMonkeyEurekaGovernatorBlitz4JHystrixTurbineJanitorMonkeyRibbonRxJavaEVCacheDenominatorKaryonNeJlixGraphRecipeAppCI/CloudbeesAminator2012 2013
  3. 3. http://netflix.github.io/
  4. 4. My Role• Engineering Tools• We help, when and where we can• Build, Bake, Deploy, Monkey• Lead on internal Gradle and Ant builds
  5. 5. EnvironmentsAll of Maven CentralPublish to SonatypeMaven On The OutsideDone in the publicSetup everythingNo Maven CentralPublish to ArtifactoryIvy On The InsideLegacy ConventionsMinimal Setup
  6. 6. Phase 0: Use Gradle
  7. 7. Phase 1: Naive Approach• Copyable build• build.gradle• gradle/conventions.gradle• gradle/maven.gradle• gradle/netflix-oss.gradle• Decent examples onlinehttp://jedicoder.blogspot.com/2011/11/automated-gradle-project-deployment-to.html
  8. 8. ext.releaseVersion = 1.1.3 // TEMPLATEext.githubName = project.name // TEMPLATEapply from: file(gradle/convention.gradle)apply from: file(gradle/maven.gradle)apply from: file(gradle/check.gradle)group = com.netflixrepositories {mavenCentral()}dependencies { // TEMPLATEcompile javax.ws.rs:jsr311-api:1.1.1compile com.sun.jersey:jersey-core:1.11testCompile org.testng:testng:6.1.1testCompile org.mockito:mockito-core:1.8.5}build.gradle
  9. 9. ext.performingRelease = project.hasProperty(release) &&Boolean.parseBoolean(project.release)def versionPostfix = performingRelease?:-SNAPSHOTversion = "${releaseVersion}${versionPostfix}"status = performingRelease?release:snapshotapply plugin: java // Plugin as major conventionssourceCompatibility = 1.6// GRADLE-2087 workaround, perform after java pluginstatus = rootProject.statustask sourcesJar(type: Jar, dependsOn:classes) {classifier = sourcesfrom sourceSets.main.allSource}task javadocJar(type: Jar, dependsOn:javadoc) {classifier = javadoc  from javadoc.destinationDir}convention.gradle
  10. 10. apply plugin: mavenapply plugin: signingsigning { sign configurations.archives}task uploadMavenCentral(type:Upload) {configuration = configurations.archivesdependsOn signArchivesdoFirst.repositories.mavenDeployer {beforeDeployment { signing.signPom(it) }repository(url: http://oss.sonatype.org/services/local/staging/deploy/maven2/) {authentication(userName: rroject.sonatypeUsername, password:project.sonatypePassword)}pom.project {url "https://github.com/Netflix/${project.githubName}"...}}}maven.gradle
  11. 11. apply from: http://artifacts.netflix.com/gradle-netflix-local/artifactory.gradlenetflix-oss.gradle
  12. 12. gradle-template• Be as visible as possible• Meant to be synced with (#git #ftw)• Templates for multiple-module and single-moduleprojects• Used by other companies• https://github.com/Netflix/gradle-template
  13. 13. Phase 2: Full Build• Release plugin [gradle-release]• Publish snapshots, candidates and releases• Simpler signing in Jenkins• License and Copyright Headers [license-gradle-plugin]• Any plugins in Bintray• Publishing Javadoc• More code quality checks
  14. 14. Continuous Integration• Jenkins Internally• Performs releases• Has Keys• Access to AWS• CloudBees DEV@CLOUD Externally• Builds Pull Requests• Shows Code Quality Metrics
  15. 15. Problem Areas• Java plugin required for conf2scope mappings to work• Java plugin resets status [GRADLE-2087]• Parent poms caused problems, but aren’t needed• Sonatype username/password• Signing keys needed locally with special properties• Not all plugins were available
  16. 16. Future• Roll features into plugins• Merge with internal build• Hire more engineers to work on Gradle
  17. 17. @quidryan@quidryanhttp://www.slideshare.net/quidryanThank YouQuestions?@netflixoss #cloudprize

×