Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сеньор -> Devops -> Gradle -> Использование кешей сборки в CI #1818

Open
vadimstrya opened this issue Feb 9, 2025 · 0 comments

Comments

@vadimstrya
Copy link

После пункта "Откройте браузер и перейдите на http://your_debian_ip:5071/" необходимо сообщить, что нужно создать нового пользователя в разделе "Build cache -> Settings -> Cache access control" и именно эти данные указывать далее в качестве параметров, а не те, которые получаем командой "docker logs remote-cache". В разделе "UI access control" выбрать "Open", чтобы при каждом запуске не вводить новые сгенерированные данные для входа в UI Develocity Build Cache Node.
По настройке файла settings.gradle.kts в проекте, у меня локально в Идее заработал такой вариант:

val remoteCacheUrl = System.getenv("GRADLE_REMOTE_CACHE_URL") ?: (extra.properties["GRADLE_REMOTE_CACHE_URL"] as? String)
val remoteCachePush = System.getenv("GRADLE_REMOTE_CACHE_PUSH") ?: (extra.properties["GRADLE_REMOTE_CACHE_PUSH"] as? String)
val remoteCacheUsername = System.getenv("GRADLE_REMOTE_CACHE_USERNAME") ?: (extra.properties["GRADLE_REMOTE_CACHE_USERNAME"] as? String)
val remoteCachePassword = System.getenv("GRADLE_REMOTE_CACHE_PASSWORD") ?: (extra.properties["GRADLE_REMOTE_CACHE_PASSWORD"] as? String)

if (remoteCacheUrl != null) {
    buildCache {
        remote<HttpBuildCache> {
            isAllowInsecureProtocol = true
            isAllowUntrustedServer = true

            url = uri(remoteCacheUrl)
            isPush = remoteCachePush.toBoolean()
            credentials {
                username = remoteCacheUsername
                password = remoteCachePassword
            }
        }
    }
}

С вариантом, указанном в задании, Gradle выдавал ошибку при нажатии на "Sync Gradle Changes":

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant