Skip to content

Commit

Permalink
switch to circleci 2.0, bump gradle, implement lib caching (linkedin#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
radai-rosenblatt authored and smccauliff committed Jul 19, 2017
1 parent b11fd83 commit be33bfe
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 18 deletions.
56 changes: 56 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: 2

jobs:

build:
working_directory: ~/workspace
docker:
- image: circleci/openjdk:8-jdk
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "build.gradle" }}
- run:
command: ./gradlew resolveDependencies
- save_cache:
key: dependency-cache-{{ checksum "build.gradle" }}
paths:
- ~/.gradle/caches
- ~/.gradle/wrapper
- run:
command: ./gradlew clean build
- run:
command: mkdir ~/test-results
- run:
command: find ~/workspace -type f -regex ".*/test-results/.*xml" -exec ln {} ~/test-results/ \;
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results
- store_artifacts:
path: build/libs

publish:
working_directory: ~/workspace
docker:
- image: circleci/openjdk:8-jdk
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "build.gradle" }}
- run:
command: ./gradlew assemble testJar
- run:
command: ./.circleci/publishOnCommitMsg.sh

workflows:
version: 2
build-and-publish:
jobs:
- build
- publish:
requires:
- build
filters:
branches:
only: master
10 changes: 10 additions & 0 deletions .circleci/publishOnCommitMsg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

if git log -1 --pretty=%B | grep "^RELEASE.*";
then
echo "Publishing a release"
./gradlew distributeBuild
else
echo "Not a release"
fi

14 changes: 9 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
* See License in the project root for license information.
*/

import com.linkedin.gradle.build.DistributeTask

group = 'com.linkedin.kafka.clients'

buildscript {
repositories {
jcenter()
Expand All @@ -17,6 +13,14 @@ buildscript {
}
}

plugins {
id 'io.ehdev.gradle.dependency-resolve' version '0.0.24'
}

group = 'com.linkedin.kafka.clients'

import com.linkedin.gradle.build.DistributeTask

apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'eclipse'
Expand Down Expand Up @@ -164,5 +168,5 @@ task distributeBuild(type: DistributeTask) {
//wrapper generation task

task wrapper(type: Wrapper) {
gradleVersion = '3.3'
gradleVersion = '3.5'
}
10 changes: 0 additions & 10 deletions circle.yml

This file was deleted.

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Feb 14 15:08:09 PST 2017
#Wed Jul 19 11:36:50 PDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
8 changes: 7 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/*
* Copyright 2017 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License").
 See License in the project root for license information.
*/

pluginManagement {
repositories {
gradlePluginPortal()
maven { url 'https://dl.bintray.com/ethankhall/crom/' }
maven { url 'https://dl.bintray.com/ethankhall/gradle-plugins/' }
}
}

0 comments on commit be33bfe

Please sign in to comment.