Skip to content

Commit ba3748e

Browse files
authored
Add GE remote cache to examples project (#4855)
Als add GE build scans for examples project
1 parent e70782a commit ba3748e

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

examples/settings.gradle

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ buildscript {
77
dependencies {
88
classpath "gradle.plugin.ch.myniva.gradle:s3-build-cache:0.10.0"
99
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.8"
10+
classpath "com.gradle:common-custom-user-data-gradle-plugin:1.6.2"
1011
}
1112
}
1213

13-
apply plugin: 'ch.myniva.s3-build-cache'
1414
apply plugin: 'com.gradle.enterprise'
15+
apply plugin: "com.gradle.common-custom-user-data-gradle-plugin"
1516

1617
rootProject.name = 'testcontainers-examples'
1718

@@ -32,23 +33,30 @@ include 'cucumber'
3233
include 'spring-boot-kotlin-redis'
3334
include 'spock'
3435

35-
ext.isMasterBuild = false ||
36-
(System.getenv("GITHUB_REF") == "refs/heads/master") ||
37-
(System.getenv("BUILD_SOURCEBRANCHNAME") == "master")
36+
ext.isCI = System.getenv("CI") != null
3837

3938
buildCache {
4039
local {
41-
enabled = !isMasterBuild
40+
enabled = !isCI
4241
}
42+
remote(HttpBuildCache) {
43+
push = isCI && !System.getenv("READ_ONLY_REMOTE_GRADLE_CACHE")
44+
enabled = true
45+
url = 'https://ge.testcontainers.org/cache/'
46+
credentials {
47+
username = 'ci'
48+
password = System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")
49+
}
50+
}
51+
}
4352

44-
remote(ch.myniva.gradle.caching.s3.AwsS3BuildCache) {
45-
endpoint = 'fra1.digitaloceanspaces.com'
46-
region = 'fra1'
47-
bucket = 'testcontainers'
48-
path = 'cache'
49-
push = isMasterBuild && !System.getenv("READ_ONLY_REMOTE_GRADLE_CACHE")
50-
headers = [
51-
'x-amz-acl': 'public-read'
52-
]
53+
gradleEnterprise {
54+
buildScan {
55+
server = "https://ge.testcontainers.org/"
56+
publishAlways()
57+
publishIfAuthenticated()
58+
uploadInBackground = !isCI
59+
captureTaskInputFiles = true
5360
}
61+
5462
}

settings.gradle

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ buildscript {
55
}
66
}
77
dependencies {
8-
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.7.2"
9-
classpath "com.gradle:common-custom-user-data-gradle-plugin:1.6.1"
8+
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.8"
9+
classpath "com.gradle:common-custom-user-data-gradle-plugin:1.6.2"
1010
}
1111
}
1212

@@ -32,10 +32,6 @@ include ':docs:examples:spock:redis'
3232

3333
include 'test-support'
3434

35-
ext.isMasterBuild = false ||
36-
(System.getenv("GITHUB_REF") == "refs/heads/master") ||
37-
(System.getenv("BUILD_SOURCEBRANCHNAME") == "master")
38-
3935
ext.isCI = System.getenv("CI") != null
4036

4137
buildCache {

0 commit comments

Comments
 (0)