Skip to content

Commit

Permalink
Update build cache node to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Chelombitko committed Feb 7, 2025
1 parent 3ad34fd commit f15420e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ package com.malinskiy.marathon.cache.gradle

import org.testcontainers.containers.GenericContainer
import org.testcontainers.containers.wait.strategy.Wait
import org.testcontainers.utility.MountableFile
import java.net.URI
import java.time.Duration

class GradleCacheContainer(image: String = "$DEFAULT_IMAGE_NAME:$DEFAULT_TAG") :
class GradleCacheContainer(image: String = DEFAULT_IMAGE) :
GenericContainer<GradleCacheContainer>(image) {

init {
addExposedPorts(DEFAULT_PORT)
withCommand("start", "--no-warn-anon-cache-write")
withCopyFileToContainer(MountableFile.forClasspathResource("config.yaml"), "/data/conf/config.yaml")
withLogConsumer {
logger().info(it.utf8String)
}
waitStrategy = Wait
.forLogMessage(".*Build cache node started(?s).*", 1)
.withStartupTimeout(Duration.ofSeconds(DEFAULT_STARTUP_TIMEOUT_SECONDS))
Expand All @@ -22,8 +28,7 @@ class GradleCacheContainer(image: String = "$DEFAULT_IMAGE_NAME:$DEFAULT_TAG") :
get() = getMappedPort(DEFAULT_PORT)

private companion object {
private const val DEFAULT_IMAGE_NAME = "gradle/build-cache-node"
private const val DEFAULT_TAG = "9.0"
private const val DEFAULT_IMAGE = "gradle/build-cache-node:20.1"
private const val DEFAULT_PORT = 5071
private const val DEFAULT_STARTUP_TIMEOUT_SECONDS = 60L
}
Expand Down
4 changes: 4 additions & 0 deletions core/src/integrationTest/resources/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 5
cache:
accessControl:
anonymousLevel: "readwrite"

0 comments on commit f15420e

Please sign in to comment.