initial commit

This commit is contained in:
2025-03-04 15:35:36 +03:00
commit 7f3a76c984
28 changed files with 1385 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package util
import groovy.transform.CompileStatic
import groovy.transform.Memoized
@CompileStatic
class DockerLogin {
static void perform() {
loginDockerInternal()
}
@Memoized
private static Object loginDockerInternal() {
// Проверяем на всякий случай, что докер вообще установлен
if (System.findExecutablesInPath(['docker']).isEmpty())
throw new FileNotFoundException("Can't find installed docker-compose at that system!")
// Логинимся в Registry
ScriptLog.printf "Performing login to registry..."
def registryName = System.getGlobalProperty("ci.docker.registry")
def registryUser = System.getGlobalProperty("ci.docker.registry.username")
def registryPassword = System.getGlobalProperty("ci.docker.registry.password")
sh "docker login $registryName -u $registryUser -p $registryPassword"
ScriptLog.printf "Login into docker registry '${registryName}' successful!"
}
}