Skip to content

Commit 0bf68e9

Browse files
britterrnorth
authored andcommitted
Activate gradle build scans for CI builds (#916)
As discussed [via twitter](https://twitter.com/Kiview/status/1050713692541734913) this PR will activate build scans for CI builds. For an example see [this scan](https://scans.gradle.com/s/i4grzev4man3y) of a local build on my machine. I had to add some configuration to `build.gralde` for this: - The build scan plugin is applied first. Otherwise it will [not collect all data for Gradle < 4.3](https://docs.gradle.com/build-scan-plugin/#for_individual_builds). - The terms of service are accepted via the corresponding configuration in `build.gradle`. Every build that is called with the `--scan` option will be published. @melix [suggested](https://twitter.com/CedricChampeau/status/1050717559006392320) to add a [more sophisticated configuration](https://github.com/apache/groovy/blob/master/gradle/build-scans.gradle), that will also publish all local builds if user accept it. For now I've only added the simple configuration. Furthermore I've added the `--scan` option to all travis stages.
1 parent 0b04261 commit 0bf68e9

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ services:
77
- docker
88

99
install:
10-
- ./gradlew build -x check
10+
- ./gradlew build -x check --scan
1111

1212
jobs:
1313
include:
1414
- stage: test
1515
env: [ NAME=core ]
16-
script: ./gradlew testcontainers:check javadoc
16+
script: ./gradlew testcontainers:check javadoc --scan
1717

1818
- stage: test
1919
env: [ NAME=core ]
2020
jdk: openjdk11
21-
script: ./gradlew testcontainers:check
21+
script: ./gradlew testcontainers:check --scan
2222

2323
- env: [ NAME=selenium ]
24-
script: ./gradlew selenium:check
24+
script: ./gradlew selenium:check --scan
2525

2626
- env: [ NAME=modules ]
27-
script: ./gradlew check -x testcontainers:check -x selenium:check
27+
script: ./gradlew check -x testcontainers:check -x selenium:check --scan
2828

2929
# Run Docker-in-Docker tests inside Alpine
3030
- env: [ NAME="docker-in-alpine-docker" ]
@@ -36,7 +36,7 @@ jobs:
3636
-v "$(pwd)":"$(pwd)" \
3737
-w "$(pwd)" \
3838
openjdk:8-jdk-alpine \
39-
./gradlew --no-daemon testcontainers:test --tests '*GenericContainerRuleTest'
39+
./gradlew --no-daemon testcontainers:test --tests '*GenericContainerRuleTest' --scan
4040
4141
- stage: deploy
4242
sudo: false
@@ -45,7 +45,7 @@ jobs:
4545
script: skip
4646
deploy:
4747
provider: script
48-
script: ./gradlew -Pversion=$TRAVIS_TAG release
48+
script: ./gradlew -Pversion=$TRAVIS_TAG release --scan
4949
on:
5050
tags: true
5151
branch: master

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
plugins {
2+
id 'com.gradle.build-scan' version '1.16'
23
id 'io.franzbecker.gradle-lombok' version '1.14'
34
id 'nebula.provided-base' version '3.0.3'
45
id 'com.github.johnrengelman.shadow' version '2.0.2'
@@ -94,3 +95,8 @@ subprojects {
9495
testCompile 'ch.qos.logback:logback-classic:1.2.3'
9596
}
9697
}
98+
99+
buildScan {
100+
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
101+
termsOfServiceAgree = 'yes'
102+
}

circle.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
steps:
66
- checkout
77
- run:
8-
command: ./gradlew testcontainers:check
8+
command: ./gradlew testcontainers:check --scan
99
- run:
1010
name: Save test results
1111
command: |
@@ -22,7 +22,7 @@ jobs:
2222
- run:
2323
command: |
2424
echo "transport.type=okhttp" >> core/src/test/resources/testcontainers.properties
25-
./gradlew testcontainers:check
25+
./gradlew testcontainers:check --scan
2626
- run:
2727
name: Save test results
2828
command: |
@@ -35,7 +35,7 @@ jobs:
3535
steps:
3636
- checkout
3737
- run:
38-
command: ./gradlew check -x testcontainers:check -x selenium:check -x jdbc-test:check
38+
command: ./gradlew check -x testcontainers:check -x selenium:check -x jdbc-test:check --scan
3939
environment:
4040
# Oracle JDBC drivers require a timezone to be set
4141
TZ: "/usr/share/zoneinfo/ETC/UTC"
@@ -53,7 +53,7 @@ jobs:
5353
steps:
5454
- checkout
5555
- run:
56-
command: ./gradlew jdbc-test:check
56+
command: ./gradlew jdbc-test:check --scan
5757
environment:
5858
# Oracle JDBC drivers require a timezone to be set
5959
TZ: "/usr/share/zoneinfo/ETC/UTC"
@@ -71,7 +71,7 @@ jobs:
7171
steps:
7272
- checkout
7373
- run:
74-
command: ./gradlew selenium:check
74+
command: ./gradlew selenium:check --scan
7575
- run:
7676
name: Save test results
7777
command: |

0 commit comments

Comments
 (0)