Skip to content

Commit

Permalink
Complete Circle CI migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoberstar committed Apr 8, 2018
1 parent 237dc26 commit c806600
Show file tree
Hide file tree
Showing 7 changed files with 394 additions and 75 deletions.
85 changes: 61 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
###############################################################################
# Anchors for common settings
###############################################################################
defaults: &defaults
steps:
- checkout
- restore_cache:
keys:
- v1-gradle-{{ .Revision }}
- v1-gradle-caches-{{ checksum "global.lock" }}
- attach_workspace:
at: '.'
- run:
name: Compile and test
command: ./gradlew clean check
command: ./gradlew clean check --continue
- save_cache:
paths:
- '~/.gradle/caches'
key: v1-gradle-caches-{{ checksum "global.lock" }}
- store_test_results:
path: build/test-results
path: '~/gradle-test-results'
when: always
branches-and-tags: &branches-and-tags
filters:
branches:
ignore: gh-pages
tags:
only: /^\d+\.\d+\.\d+(?:-.+)?$/
tags-only: &tags-only
Expand All @@ -21,71 +32,97 @@ tags-only: &tags-only
tags:
only: /^\d+\.\d+\.\d+(?:-.+)?$/

###############################################################################
# Jobs
###############################################################################
version: 2
jobs:
cache-dependencies:
update-dependencies:
docker:
- image: circleci/openjdk:8-jdk
- image: ajoberstar/circleci-openjdk-gradle:8-jdk
steps:
- checkout
- restore_cache:
keys:
- v1-gradle-{{ .Revision }}
- v1-gradle-caches-{{ checksum "global.lock" }}
- run:
name: Update locks
command: ./gradlew generateGlobalLock saveGlobalLock stutterWriteLocks
- run:
name: Download dependencies
command: ./gradlew dependencies
- save_cache:
name: Diff lock files
command: git --no-pager diff
- persist_to_workspace:
root: '.'
paths:
- ~/.gradle
key: v1-gradle-{{ .Revision }}
- 'global.lock'
- '.stutter/'
- '*/.stutter/'
- '*/*/.stutter/'
build-java-8:
<<: *defaults
docker:
- image: circleci/openjdk:8-jdk
- image: ajoberstar/circleci-openjdk-gradle:8-jdk
build-java-9:
<<: *defaults
docker:
- image: circleci/openjdk:9-jdk
- image: ajoberstar/circleci-openjdk-gradle:9-jdk
build-java-10:
<<: *defaults
docker:
- image: circleci/openjdk:10-jdk
- image: ajoberstar/circleci-openjdk-gradle:10-jdk
publish:
docker:
- image: circleci/openjdk:8-jdk
- image: ajoberstar/circleci-openjdk-gradle:8-jdk
steps:
- checkout
- restore_cache:
keys:
- v1-gradle-{{ .Revision }}
- v1-gradle-caches-{{ checksum "global.lock" }}
- run:
name: Decrypt Gradle properties
command: openssl enc -d -aes256 -base64 -in gradle.properties.enc -out ~/.gradle/gradle.properties -pass 'pass:$GRADLE_PROPS_KEY'
command: openssl enc -d -aes256 -base64 -in gradle.properties.enc -out gradle.properties -pass 'pass:$GRADLE_PROPS_KEY'
- run:
name: Publish Artifacts
command: ./gradlew publish publishPlugins gitPublishPush
command: ./gradlew publish publishPlugins
###############################################################################
# Workflows
###############################################################################
workflows:
version: 2
main:
jobs:
- cache-dependencies:
<<: *branches-and-tags
- build-java-8:
<<: *branches-and-tags
requires:
- cache-dependencies
- build-java-9:
<<: *branches-and-tags
requires:
- cache-dependencies
- build-java-8
- build-java-10:
<<: *branches-and-tags
requires:
- cache-dependencies
- build-java-8
- publish:
<<: *tags-only
requires:
- build-java-8
- build-java-9
- build-java-10
context: ajoberstar
nightly-deps:
triggers:
- schedule:
cron: "0 3 * * *"
filters:
branches:
only: master
jobs:
- update-dependencies
- build-java-8:
requires:
- update-dependencies
- build-java-9:
requires:
- build-java-8
- build-java-10:
requires:
- build-java-8
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ bin
.idea
out
*.sublime-*
gradle.properties
19 changes: 13 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
plugins {
id 'org.ajoberstar.defaults' version '0.8.3'
id 'org.ajoberstar.defaults' version '0.10.0-milestone.12'
id 'groovy'
id 'java-gradle-plugin'
// TODO remove when Gradle dependency locking is available
id 'nebula.dependency-lock' version '5.0.4'
}

group = 'org.ajoberstar'
Expand Down Expand Up @@ -31,11 +33,16 @@ dependencies {
runtime 'com.netflix.nebula:nebula-publishing-plugin:+'
}

model {
bintray {
owner = 'ajoberstar'
repo = 'maven'
pkg = 'gradle-defaults'
publishing {
repositories {
maven {
name = 'bintray'
url = 'https://api.bintray.com/maven/ajoberstar/maven/gradle-defaults/;publish=1'
credentials {
username = System.env['BINTRAY_USER']
password = System.env['BINTRAY_KEY']
}
}
}
}

Expand Down
20 changes: 5 additions & 15 deletions global.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"requested": "+"
},
"org.ajoberstar.reckon:reckon-gradle": {
"locked": "0.5.0-beta.1",
"locked": "0.5.0",
"requested": "+"
},
"org.ajoberstar:gradle-git-publish": {
Expand All @@ -29,16 +29,6 @@
"requested": "+"
}
},
"jacocoAgent": {
"org.jacoco:org.jacoco.agent": {
"locked": "0.8.0"
}
},
"jacocoAnt": {
"org.jacoco:org.jacoco.ant": {
"locked": "0.8.0"
}
},
"runtime": {
"com.diffplug.spotless:spotless-plugin-gradle": {
"locked": "3.10.0",
Expand All @@ -53,7 +43,7 @@
"requested": "+"
},
"org.ajoberstar.reckon:reckon-gradle": {
"locked": "0.5.0-beta.1",
"locked": "0.5.0",
"requested": "+"
},
"org.ajoberstar:gradle-git-publish": {
Expand Down Expand Up @@ -83,7 +73,7 @@
"requested": "+"
},
"org.ajoberstar.reckon:reckon-gradle": {
"locked": "0.5.0-beta.1",
"locked": "0.5.0",
"requested": "+"
},
"org.ajoberstar:gradle-git-publish": {
Expand Down Expand Up @@ -113,7 +103,7 @@
"requested": "+"
},
"org.ajoberstar.reckon:reckon-gradle": {
"locked": "0.5.0-beta.1",
"locked": "0.5.0",
"requested": "+"
},
"org.ajoberstar:gradle-git-publish": {
Expand Down Expand Up @@ -143,7 +133,7 @@
"requested": "+"
},
"org.ajoberstar.reckon:reckon-gradle": {
"locked": "0.5.0-beta.1",
"locked": "0.5.0",
"requested": "+"
},
"org.ajoberstar:gradle-git-publish": {
Expand Down
15 changes: 0 additions & 15 deletions gradle/HEADER

This file was deleted.

Loading

0 comments on commit c806600

Please sign in to comment.