This is an automated email from the ASF dual-hosted git repository.
mpochatkin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 01a43fc0bb9 IGNITE-27297 Use proxy repositories for maven and docker
(#7245)
01a43fc0bb9 is described below
commit 01a43fc0bb9b1eb8eeae14957516d0881c935f23
Author: Artem Egorov <[email protected]>
AuthorDate: Wed Dec 24 16:02:02 2025 +0200
IGNITE-27297 Use proxy repositories for maven and docker (#7245)
---
.teamcity/_Self/Project.kt | 3 +
.teamcity/build/Project.kt | 2 +-
.teamcity/build/build_types/ApacheIgnite3.kt | 2 +-
.teamcity/build/distributions/OdbcDeb.kt | 5 +
.teamcity/build/distributions/OdbcRpm.kt | 5 +
.teamcity/build/distributions/OdbcZip.kt | 5 +
.teamcity/build/distributions/Project.kt | 2 +-
.teamcity/files/scripts/bash/DockerImagePrune.sh | 3 +-
.teamcity/files/scripts/bash/SetupDockerProxy.sh | 112 ++++++++
.teamcity/files/scripts/python/SetupMavenProxy.py | 290 +++++++++++++++++++++
.../teamcity/ApacheIgnite3CustomBuildType.kt | 1 +
.../org/apache/ignite/teamcity/CustomBuildSteps.kt | 24 ++
.../org/apache/ignite/teamcity/CustomBuildType.kt | 15 ++
.teamcity/test/platform_tests/Project.kt | 2 +-
.teamcity/test/sanity_check/Project.kt | 2 +-
.teamcity/test/template_types/OtherTestsModule.kt | 4 +
.teamcity/test/template_types/Tests.kt | 4 +-
.teamcity/test/template_types/TestsModule.kt | 7 +
settings.gradle | 13 +
19 files changed, 493 insertions(+), 8 deletions(-)
diff --git a/.teamcity/_Self/Project.kt b/.teamcity/_Self/Project.kt
index 9b6a7d4bf5f..33b593a7a05 100644
--- a/.teamcity/_Self/Project.kt
+++ b/.teamcity/_Self/Project.kt
@@ -2,6 +2,7 @@ package _Self
import jetbrains.buildServer.configs.kotlin.DslContext
import jetbrains.buildServer.configs.kotlin.Project
+import org.apache.ignite.teamcity.Teamcity.Companion.hiddenPassword
import org.apache.ignite.teamcity.Teamcity.Companion.hiddenText
/**
@@ -17,6 +18,8 @@ object Project : Project({
* Project-wide params
*/
params {
+ hiddenText("DOCKERPROXY_USERNAME", "robot\$ignite-3")
+ hiddenPassword("DOCKERPROXY_PASSWORD",
"credentialsJSON:56ca9b55-a5ad-4244-a5c1-5b4f062366dd")
hiddenText("system.lastCommitHash", "%build.vcs.number%")
hiddenText("IGNITE_CI", "true")
hiddenText("env.GRADLE_OPTS", "-Dorg.gradle.caching=true")
diff --git a/.teamcity/build/Project.kt b/.teamcity/build/Project.kt
index 5270de323b6..1e25ce1f2bd 100644
--- a/.teamcity/build/Project.kt
+++ b/.teamcity/build/Project.kt
@@ -19,7 +19,7 @@ object Project : Project({
buildType(
ApacheIgnite3CustomBuildType.Builder(ApacheIgnite3)
- .ignite3VCS()
+ .ignite3VCS().setupMavenProxy()
.defaultBuildTypeSettings().requireLinux()
.build().buildType
)
diff --git a/.teamcity/build/build_types/ApacheIgnite3.kt
b/.teamcity/build/build_types/ApacheIgnite3.kt
index a2ecc6c7ae1..da9fe6bf6b0 100644
--- a/.teamcity/build/build_types/ApacheIgnite3.kt
+++ b/.teamcity/build/build_types/ApacheIgnite3.kt
@@ -15,7 +15,7 @@ object ApacheIgnite3 : BuildType({
customScript(type = "bash") {
name = "Clean up local maven repository"
}
-
+
customGradle {
name = "Build Apache Ignite 3"
tasks = "assemble integrationTestClasses testClasses"
diff --git a/.teamcity/build/distributions/OdbcDeb.kt
b/.teamcity/build/distributions/OdbcDeb.kt
index de3b2f7fe30..8817f62784f 100644
--- a/.teamcity/build/distributions/OdbcDeb.kt
+++ b/.teamcity/build/distributions/OdbcDeb.kt
@@ -4,6 +4,7 @@ import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.buildSteps.GradleBuildStep
import org.apache.ignite.teamcity.CustomBuildSteps.Companion.customGradle
import jetbrains.buildServer.configs.kotlin.buildSteps.script
+import org.apache.ignite.teamcity.CustomBuildSteps.Companion.customScript
object OdbcDeb : BuildType({
name = "[7] ODBC Deb package"
@@ -19,6 +20,10 @@ object OdbcDeb : BuildType({
}
steps {
+ customScript(type = "bash") {
+ name = "Setup Docker Proxy"
+ }
+
script {
name = "Check env"
scriptContent = """
diff --git a/.teamcity/build/distributions/OdbcRpm.kt
b/.teamcity/build/distributions/OdbcRpm.kt
index 72921bcc6b2..30b08b58278 100644
--- a/.teamcity/build/distributions/OdbcRpm.kt
+++ b/.teamcity/build/distributions/OdbcRpm.kt
@@ -5,6 +5,7 @@ import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.buildSteps.GradleBuildStep
import org.apache.ignite.teamcity.CustomBuildSteps.Companion.customGradle
import jetbrains.buildServer.configs.kotlin.buildSteps.script
+import org.apache.ignite.teamcity.CustomBuildSteps.Companion.customScript
object OdbcRpm : BuildType({
name = "[8] ODBC RPM package"
@@ -17,6 +18,10 @@ object OdbcRpm : BuildType({
}
steps {
+ customScript(type = "bash") {
+ name = "Setup Docker Proxy"
+ }
+
script {
name = "Check env"
scriptContent = """
diff --git a/.teamcity/build/distributions/OdbcZip.kt
b/.teamcity/build/distributions/OdbcZip.kt
index 4fd4f8d2fb2..79aed2bd25f 100644
--- a/.teamcity/build/distributions/OdbcZip.kt
+++ b/.teamcity/build/distributions/OdbcZip.kt
@@ -4,6 +4,7 @@ import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.buildSteps.GradleBuildStep
import org.apache.ignite.teamcity.CustomBuildSteps.Companion.customGradle
import jetbrains.buildServer.configs.kotlin.buildSteps.script
+import org.apache.ignite.teamcity.CustomBuildSteps.Companion.customScript
object OdbcZip : BuildType({
name = "[9] ODBC Zip package"
@@ -19,6 +20,10 @@ object OdbcZip : BuildType({
}
steps {
+ customScript(type = "bash") {
+ name = "Setup Docker Proxy"
+ }
+
script {
name = "Check env"
scriptContent = """
diff --git a/.teamcity/build/distributions/Project.kt
b/.teamcity/build/distributions/Project.kt
index 05984937d75..98f59a2c9e1 100644
--- a/.teamcity/build/distributions/Project.kt
+++ b/.teamcity/build/distributions/Project.kt
@@ -29,7 +29,7 @@ object Project : Project({
).forEach {
buildType(
ApacheIgnite3CustomBuildType.Builder(it)
- .ignite3VCS().ignite3BuildDependency()
+ .ignite3VCS().ignite3BuildDependency().setupMavenProxy()
.defaultBuildTypeSettings().requireLinux()
.build().buildType
)
diff --git a/.teamcity/files/scripts/bash/DockerImagePrune.sh
b/.teamcity/files/scripts/bash/DockerImagePrune.sh
index 62d505a6e95..b81ba6f5e14 100644
--- a/.teamcity/files/scripts/bash/DockerImagePrune.sh
+++ b/.teamcity/files/scripts/bash/DockerImagePrune.sh
@@ -1 +1,2 @@
-docker image prune -f
\ No newline at end of file
+docker image prune -f
+docker logout
\ No newline at end of file
diff --git a/.teamcity/files/scripts/bash/SetupDockerProxy.sh
b/.teamcity/files/scripts/bash/SetupDockerProxy.sh
new file mode 100644
index 00000000000..04671c23f89
--- /dev/null
+++ b/.teamcity/files/scripts/bash/SetupDockerProxy.sh
@@ -0,0 +1,112 @@
+#!/usr/bin/env bash
+
+retry_docker_login() {
+ local registry="$1"
+ local username="$2"
+ local password="$3"
+ local max_attempts=5
+ local attempt=1
+ local sleep_interval=5
+
+ while [ $attempt -le $max_attempts ]; do
+ echo "Attempt $attempt of $max_attempts: docker login $registry"
+ if docker login "$registry" --username "$username" --password
"$password"; then
+ echo "Command succeeded on attempt $attempt"
+ return 0
+ else
+ if [ $attempt -lt $max_attempts ]; then
+ echo "Command failed on attempt $attempt. Retrying in
$sleep_interval seconds..."
+ sleep $sleep_interval
+ fi
+ attempt=$((attempt + 1))
+ fi
+ done
+
+ echo "Command failed after $max_attempts attempts"
+ return 1
+}
+
+retry_docker_login "docker.gridgain.com/dockerhub-proxy/"
'%DOCKERPROXY_USERNAME%' '%DOCKERPROXY_PASSWORD%' || exit 1
+
+echo ""
+echo "========================================="
+echo "Processing Docker images..."
+echo "========================================="
+
+REPO_ROOT="${PWD}"
+
+DOCKER_PROXY_PREFIX="docker.gridgain.com/dockerhub-proxy/"
+DOCKER_FILES_COUNT=0
+DOCKER_REPLACEMENTS=0
+
+DOCKERFILES=$(find "$REPO_ROOT" -name "Dockerfile*" -type f \
+ -not -path "*/.git/*" \
+ -not -path "*/.gradle/*" \
+ -not -path "*/build/*" \
+ -not -path "*/out/*" \
+ -not -path "*/.idea/*" \
+ -not -path "*/node_modules/*" \
+ -not -path "*/.run/*" \
+ 2>/dev/null || true)
+
+if [ -z "$DOCKERFILES" ]; then
+ echo "No Dockerfiles found"
+else
+ echo "Found Dockerfiles:"
+ echo "$DOCKERFILES" | while IFS= read -r dockerfile; do
+ echo " $dockerfile"
+ done
+
+ while IFS= read -r dockerfile; do
+ if [ ! -f "$dockerfile" ]; then
+ continue
+ fi
+
+ echo ""
+ echo "Processing: $dockerfile"
+ DOCKER_FILES_COUNT=$((DOCKER_FILES_COUNT + 1))
+ REPLACEMENT_COUNT=0
+
+ TEMP_FILE=$(mktemp)
+
+ while IFS= read -r line || [ -n "$line" ]; do
+ if echo "$line" | grep -qE "^\s*FROM\s+"; then
+ # Skip if already has proxy prefix
+ if echo "$line" | grep -qF "$DOCKER_PROXY_PREFIX"; then
+ echo "$line" >> "$TEMP_FILE"
+ continue
+ fi
+ # Skip special cases: scratch, --platform
+ if echo "$line" | grep -qE "(scratch|--platform)"; then
+ echo "$line" >> "$TEMP_FILE"
+ continue
+ fi
+ # Replace: FROM image -> FROM
docker.proxy.example/dockerhub-proxy/image
+ # Handle: FROM image:tag, FROM image@digest, FROM image AS
alias
+ NEW_LINE=$(echo "$line" | sed -E
"s|^(\s*FROM\s+)([^[:space:]]+)(.*)$|\1${DOCKER_PROXY_PREFIX}\2\3|")
+ echo "$NEW_LINE" >> "$TEMP_FILE"
+ REPLACEMENT_COUNT=$((REPLACEMENT_COUNT + 1))
+ else
+ # Keep other lines as-is
+ echo "$line" >> "$TEMP_FILE"
+ fi
+ done < "$dockerfile"
+
+ if [ $REPLACEMENT_COUNT -gt 0 ]; then
+ mv "$TEMP_FILE" "$dockerfile"
+ DOCKER_REPLACEMENTS=$((DOCKER_REPLACEMENTS + REPLACEMENT_COUNT))
+ echo " Updated with $REPLACEMENT_COUNT replacement(s)"
+ else
+ rm -f "$TEMP_FILE"
+ echo " No changes needed"
+ fi
+ done <<< "$DOCKERFILES"
+fi
+
+echo ""
+echo "========================================="
+echo "Summary:"
+echo " Dockerfiles processed: $DOCKER_FILES_COUNT"
+echo " Docker replacements: $DOCKER_REPLACEMENTS"
+echo "========================================="
+echo "Done!"
diff --git a/.teamcity/files/scripts/python/SetupMavenProxy.py
b/.teamcity/files/scripts/python/SetupMavenProxy.py
new file mode 100644
index 00000000000..4c442b6c09d
--- /dev/null
+++ b/.teamcity/files/scripts/python/SetupMavenProxy.py
@@ -0,0 +1,290 @@
+#!/usr/bin/env python3
+import json
+import os
+import re
+import sys
+from pathlib import Path
+from urllib.request import urlopen, Request
+
+CONFIG = {
+ 'nexus_api_url': 'https://nexus.gridgain.com/service/rest/v1/repositories',
+ 'repo_root': os.getcwd(),
+ 'maven_file_patterns': ['build.gradle', 'settings.gradle',
'gradle-wrapper.properties'],
+ 'cmake_file_pattern': 'dependencies.cmake',
+ 'exclude_dirs': ['.git', '.gradle', 'build', 'out', '.idea',
'node_modules', '.run'],
+ 'github_repo_name': 'github-raw',
+ 'github_url_prefix': 'https://github.com/',
+}
+
+def safe_request(url):
+ try:
+ req = Request(url)
+ with urlopen(req, timeout=30) as response:
+ return response.read().decode('utf-8')
+ except Exception:
+ return None
+
+def find_files(root, patterns, exclude_dirs):
+ root_path = Path(root)
+ files = []
+ for pattern in patterns:
+ for file_path in root_path.rglob(pattern):
+ parts = file_path.parts
+ if any(exclude in parts for exclude in exclude_dirs):
+ continue
+ files.append(file_path)
+ return sorted(set(files))
+
+def normalize_url(url):
+ return url.rstrip('/')
+
+def escape_regex(text):
+ return re.escape(text)
+
+def escape_gradle_url(url):
+ return url.replace('://', '\\://')
+
+def unescape_gradle_url(url):
+ return url.replace('\\://', '://')
+
+def replace_in_file(file_path, search_url, replace_url, use_slash_version,
use_escaped=False):
+ try:
+ content = file_path.read_text(encoding='utf-8')
+ original_content = content
+
+ if use_escaped:
+ search_pattern = escape_gradle_url(search_url if use_slash_version
else normalize_url(search_url))
+ replace_pattern = escape_gradle_url(replace_url if
use_slash_version else normalize_url(replace_url))
+ else:
+ search_pattern = search_url if use_slash_version else
normalize_url(search_url)
+ replace_pattern = replace_url if use_slash_version else
normalize_url(replace_url)
+
+ escaped_search = escape_regex(search_pattern)
+ matches_before = len(re.findall(escaped_search, content))
+ content = re.sub(escaped_search, replace_pattern, content)
+
+ if content != original_content:
+ file_path.write_text(content, encoding='utf-8')
+ return matches_before
+ return 0
+ except Exception:
+ return 0
+
+def process_maven_replacements(repo_root, maven_file_patterns, exclude_dirs,
proxy_mappings):
+ total_files = 0
+ total_replacements = 0
+
+ files = find_files(repo_root, maven_file_patterns, exclude_dirs)
+
+ for remote_url, nexus_url in proxy_mappings.items():
+ if not remote_url:
+ continue
+
+ print(f"\nReplacing: {remote_url} -> {nexus_url}")
+
+ matching_files = []
+ for file_path in files:
+ try:
+ content = file_path.read_text(encoding='utf-8')
+ is_gradle_wrapper = file_path.name ==
'gradle-wrapper.properties'
+ escaped_remote = escape_gradle_url(remote_url) if
is_gradle_wrapper else None
+ escaped_normalized =
escape_gradle_url(normalize_url(remote_url)) if is_gradle_wrapper else None
+
+ if remote_url in content or normalize_url(remote_url) in
content:
+ matching_files.append(file_path)
+ elif is_gradle_wrapper and (escaped_remote and escaped_remote
in content or escaped_normalized and escaped_normalized in content):
+ matching_files.append(file_path)
+ except Exception:
+ continue
+
+ if not matching_files:
+ print(f" No files found containing this URL")
+ continue
+
+ print(f" Found {len(matching_files)} file(s) to process")
+
+ for file_path in matching_files:
+ try:
+ content = file_path.read_text(encoding='utf-8')
+ is_gradle_wrapper = file_path.name ==
'gradle-wrapper.properties'
+
+ count_with_slash = content.count(remote_url)
+ count_without_slash = content.count(normalize_url(remote_url))
+ escaped_remote = escape_gradle_url(remote_url) if
is_gradle_wrapper else None
+ escaped_normalized =
escape_gradle_url(normalize_url(remote_url)) if is_gradle_wrapper else None
+ count_escaped_slash = content.count(escaped_remote) if
escaped_remote else 0
+ count_escaped_no_slash = content.count(escaped_normalized) if
escaped_normalized else 0
+
+ if count_with_slash > 0:
+ count = count_with_slash
+ use_slash = True
+ use_escaped = False
+ elif count_without_slash > 0:
+ count = count_without_slash
+ use_slash = False
+ use_escaped = False
+ elif count_escaped_slash > 0:
+ count = count_escaped_slash
+ use_slash = True
+ use_escaped = True
+ elif count_escaped_no_slash > 0:
+ count = count_escaped_no_slash
+ use_slash = False
+ use_escaped = True
+ else:
+ count = 0
+ use_slash = False
+ use_escaped = False
+
+ if count > 0:
+ total_files += 1
+ print(f" Processing: {file_path} (found {count}
occurrence(s))")
+ print(f" Replacing: {remote_url} -> {nexus_url}")
+
+ replacements = replace_in_file(file_path, remote_url,
nexus_url, use_slash, use_escaped)
+ total_replacements += replacements
+
+ try:
+ new_content = file_path.read_text(encoding='utf-8')
+ escaped_nexus = escape_gradle_url(nexus_url) if
is_gradle_wrapper else None
+ escaped_nexus_normalized =
escape_gradle_url(normalize_url(nexus_url)) if is_gradle_wrapper else None
+
+ if nexus_url in new_content or
normalize_url(nexus_url) in new_content:
+ print(f" ✓ Replacement successful")
+ elif is_gradle_wrapper and (escaped_nexus and
escaped_nexus in new_content or escaped_nexus_normalized and
escaped_nexus_normalized in new_content):
+ print(f" ✓ Replacement successful")
+ else:
+ print(f" ⚠ Warning: Replacement may have failed
- URL not found after replacement")
+ except Exception:
+ pass
+ except Exception:
+ continue
+
+ return total_files, total_replacements
+
+def process_github_replacements(repo_root, cmake_file_pattern, exclude_dirs,
github_proxy_prefix):
+ if not github_proxy_prefix:
+ print("Skipping GitHub URL replacements (proxy not configured)")
+ return 0, 0
+
+ files = find_files(repo_root, [cmake_file_pattern], exclude_dirs)
+
+ if not files:
+ print("No dependencies.cmake files found")
+ return 0, 0
+
+ print("Found dependencies.cmake files:")
+ for file_path in files:
+ print(f" {file_path}")
+
+ total_files = 0
+ total_replacements = 0
+
+ for file_path in files:
+ try:
+ content = file_path.read_text(encoding='utf-8')
+ lines = content.splitlines(keepends=True)
+ new_lines = []
+ replacement_count = 0
+
+ for line in lines:
+ if CONFIG['github_url_prefix'] in line:
+ if github_proxy_prefix in line:
+ new_lines.append(line)
+ else:
+ new_line = line.replace(CONFIG['github_url_prefix'],
github_proxy_prefix)
+ new_lines.append(new_line)
+ replacement_count += 1
+ else:
+ new_lines.append(line)
+
+ if replacement_count > 0:
+ total_files += 1
+ total_replacements += replacement_count
+ print(f"\nProcessing: {file_path}")
+ print(f" Updated with {replacement_count} replacement(s)")
+ file_path.write_text(''.join(new_lines), encoding='utf-8')
+ else:
+ print(f"\nProcessing: {file_path}")
+ print(f" No changes needed")
+ except Exception:
+ continue
+
+ return total_files, total_replacements
+
+def main():
+ print("Fetching proxy repositories from Nexus...")
+ print(f"REPO_ROOT is set to: {CONFIG['repo_root']}")
+
+ repos_json_str = safe_request(CONFIG['nexus_api_url'])
+ if not repos_json_str:
+ print("Warning: Failed to fetch repositories from Nexus. Continuing
without proxy replacements.", file=sys.stderr)
+ sys.exit(0)
+
+ try:
+ repos_data = json.loads(repos_json_str)
+ except Exception:
+ print("Warning: Failed to parse Nexus response. Continuing without
proxy replacements.", file=sys.stderr)
+ sys.exit(0)
+
+ proxy_mappings = {}
+ for repo in repos_data:
+ if repo.get('type') == 'proxy' and 'attributes' in repo:
+ proxy_attrs = repo.get('attributes', {}).get('proxy', {})
+ remote_url = proxy_attrs.get('remoteUrl')
+ nexus_url = repo.get('url')
+ if remote_url and nexus_url:
+ proxy_mappings[remote_url] = nexus_url
+
+ if not proxy_mappings:
+ print("Warning: No proxy repositories found. Continuing without proxy
replacements.", file=sys.stderr)
+ sys.exit(0)
+
+ print("Found proxy repositories:")
+ for remote_url, nexus_url in proxy_mappings.items():
+ print(f" {remote_url} -> {nexus_url}")
+
+ maven_files, maven_replacements = process_maven_replacements(
+ CONFIG['repo_root'],
+ CONFIG['maven_file_patterns'],
+ CONFIG['exclude_dirs'],
+ proxy_mappings
+ )
+
+ print("\n=========================================")
+ print("Processing GitHub URLs in dependencies.cmake files...")
+ print("=========================================")
+
+ github_proxy_url = None
+ for repo in repos_data:
+ if repo.get('name') == CONFIG['github_repo_name']:
+ github_proxy_url = repo.get('url')
+ break
+
+ if github_proxy_url:
+ github_proxy_prefix = f"{github_proxy_url.rstrip('/')}/"
+ print(f"Using GitHub proxy: {github_proxy_prefix}")
+ else:
+ print("Warning: GitHub proxy repository not found in Nexus. Skipping
GitHub URL replacements.")
+ github_proxy_prefix = None
+
+ cmake_files, cmake_replacements = process_github_replacements(
+ CONFIG['repo_root'],
+ CONFIG['cmake_file_pattern'],
+ CONFIG['exclude_dirs'],
+ github_proxy_prefix
+ )
+
+ print("\n=========================================")
+ print("Summary:")
+ print(f" Maven files processed: {maven_files}")
+ print(f" Maven replacements: {maven_replacements}")
+ print(f" dependencies.cmake files processed: {cmake_files}")
+ print(f" GitHub URL replacements: {cmake_replacements}")
+ print("=========================================")
+ print("Done!")
+ sys.exit(0)
+
+if __name__ == '__main__':
+ main()
+
diff --git
a/.teamcity/org/apache/ignite/teamcity/ApacheIgnite3CustomBuildType.kt
b/.teamcity/org/apache/ignite/teamcity/ApacheIgnite3CustomBuildType.kt
index c3077319bbd..856a2388170 100644
--- a/.teamcity/org/apache/ignite/teamcity/ApacheIgnite3CustomBuildType.kt
+++ b/.teamcity/org/apache/ignite/teamcity/ApacheIgnite3CustomBuildType.kt
@@ -5,6 +5,7 @@ import jetbrains.buildServer.configs.kotlin.AbsoluteId
import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.FailureAction
import jetbrains.buildServer.configs.kotlin.buildFeatures.commitStatusPublisher
+import jetbrains.buildServer.configs.kotlin.buildSteps.script
import org.apache.ignite.teamcity.Teamcity.Companion.hiddenText
diff --git a/.teamcity/org/apache/ignite/teamcity/CustomBuildSteps.kt
b/.teamcity/org/apache/ignite/teamcity/CustomBuildSteps.kt
index 83e7d8656d0..79fda852218 100644
--- a/.teamcity/org/apache/ignite/teamcity/CustomBuildSteps.kt
+++ b/.teamcity/org/apache/ignite/teamcity/CustomBuildSteps.kt
@@ -89,5 +89,29 @@ class CustomBuildSteps {
step(result)
return result
}
+
+
+ /**
+ * Custom PYTHON build step
+ *
+ * @param filename: name of script file (without path)
+ * @param scriptArgs: arguments for running python script
+ */
+ fun BuildSteps.customPython(
+ filename: String = "",
+ scriptArgs: String = "",
+ init: PythonBuildStep.() -> Unit
+ ): PythonBuildStep {
+ val result = PythonBuildStep(init)
+ val file = if (filename == "")
Teamcity.getBashScriptFileName(result.name) else filename
+
+ val scriptContent = PythonBuildStep.Command.Script()
+ scriptContent.content =
File("files/scripts/python/${file}.py").readText()
+ scriptContent.scriptArguments = scriptArgs
+ result.command = scriptContent
+
+ step(result)
+ return result
+ }
}
}
\ No newline at end of file
diff --git a/.teamcity/org/apache/ignite/teamcity/CustomBuildType.kt
b/.teamcity/org/apache/ignite/teamcity/CustomBuildType.kt
index 36447bf0268..f173fb707e1 100644
--- a/.teamcity/org/apache/ignite/teamcity/CustomBuildType.kt
+++ b/.teamcity/org/apache/ignite/teamcity/CustomBuildType.kt
@@ -3,6 +3,7 @@ package org.apache.ignite.teamcity
import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.BuildTypeSettings.Type
import jetbrains.buildServer.configs.kotlin.CheckoutMode
+import org.apache.ignite.teamcity.CustomBuildSteps.Companion.customPython
import
org.apache.ignite.teamcity.CustomFailureConditions.Companion.failOnExactText
@Suppress("unused")
@@ -96,6 +97,20 @@ open class CustomBuildType(open val buildType: BuildType) {
}
+ /**
+ * Replace maven repos with proxy repositories
+ */
+ fun setupMavenProxy() = apply {
+ buildType.steps {
+ customPython {
+ name = "Setup Maven Proxy"
+ workingDir = "%VCSROOT__IGNITE3%"
+ }
+ items.add(0, items[items.lastIndex])
+ items.removeAt(items.lastIndex)
+ }
+ }
+
/**
* Return updated BuildType object
*/
diff --git a/.teamcity/test/platform_tests/Project.kt
b/.teamcity/test/platform_tests/Project.kt
index 1976d516a34..d2640e038d1 100644
--- a/.teamcity/test/platform_tests/Project.kt
+++ b/.teamcity/test/platform_tests/Project.kt
@@ -20,7 +20,7 @@ object Project : Project({
).forEach {
buildType(
ApacheIgnite3CustomBuildType.Builder(it)
- .ignite3VCS().ignite3BuildDependency()
+ .ignite3VCS().ignite3BuildDependency().setupMavenProxy()
.defaultBuildTypeSettings().requireLinux()
.build().buildType
)
diff --git a/.teamcity/test/sanity_check/Project.kt
b/.teamcity/test/sanity_check/Project.kt
index 0383a1bb6c3..e493a53af0c 100644
--- a/.teamcity/test/sanity_check/Project.kt
+++ b/.teamcity/test/sanity_check/Project.kt
@@ -19,7 +19,7 @@ object Project : Project({
).forEach {
buildType(
ApacheIgnite3CustomBuildType.Builder(it)
- .ignite3VCS().ignite3BuildDependency()
+ .ignite3VCS().ignite3BuildDependency().setupMavenProxy()
.defaultBuildTypeSettings().requireLinux()
.build().buildType
)
diff --git a/.teamcity/test/template_types/OtherTestsModule.kt
b/.teamcity/test/template_types/OtherTestsModule.kt
index 4533655b4f3..e8dbafa5d4a 100644
--- a/.teamcity/test/template_types/OtherTestsModule.kt
+++ b/.teamcity/test/template_types/OtherTestsModule.kt
@@ -35,6 +35,10 @@ class OtherTestsModule(
name = "Clean Up Remaining Processes"
}
+ customScript(type = "bash") {
+ name = "Setup Docker Proxy"
+ }
+
customGradle {
id = "RunTests"
name = "Run tests"
diff --git a/.teamcity/test/template_types/Tests.kt
b/.teamcity/test/template_types/Tests.kt
index b68e0413bb0..4e81ffc59b6 100644
--- a/.teamcity/test/template_types/Tests.kt
+++ b/.teamcity/test/template_types/Tests.kt
@@ -13,7 +13,7 @@ data class Tests(
fun buildType(): List<BuildType> {
val map = modules.map {
ApacheIgnite3CustomBuildType.Builder(TestsModule(configuration,
it))
- .ignite3VCS().ignite3BuildDependency()
+ .ignite3VCS().ignite3BuildDependency().setupMavenProxy()
.defaultBuildTypeSettings().requireLinux()
.testsFailureCondition()
.build().buildType
@@ -21,7 +21,7 @@ data class Tests(
if (enableOthers) {
val otherModules =
ApacheIgnite3CustomBuildType.Builder(OtherTestsModule(configuration, modules +
excludeOnlyModules))
- .ignite3VCS().ignite3BuildDependency()
+ .ignite3VCS().ignite3BuildDependency().setupMavenProxy()
.defaultBuildTypeSettings().requireLinux()
.testsFailureCondition()
.build().buildType
diff --git a/.teamcity/test/template_types/TestsModule.kt
b/.teamcity/test/template_types/TestsModule.kt
index 3489a22f43e..da76b2a1ae2 100644
--- a/.teamcity/test/template_types/TestsModule.kt
+++ b/.teamcity/test/template_types/TestsModule.kt
@@ -32,6 +32,11 @@ class TestsModule(
customScript(type = "bash") {
name = "Clean Up Remaining Processes"
}
+
+ customScript(type = "bash") {
+ name = "Setup Docker Proxy"
+ }
+
customGradle {
name = "Run tests"
tasks = module.buildTask(configuration.testTask)
@@ -42,9 +47,11 @@ class TestsModule(
%JVM_ARGS%
""".trimIndent()
}
+
customScript(type = "bash") {
name = "Clean Up Remaining Processes"
}
+
customScript(type = "bash") {
id = "PruneDockerImages"
name = "DockerImagePrune"
diff --git a/settings.gradle b/settings.gradle
index 19454784815..24af08b7697 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -15,6 +15,14 @@
* limitations under the License.
*/
+pluginManagement {
+ repositories {
+ maven {
+ url "https://plugins.gradle.org/m2/"
+ }
+ }
+}
+
rootProject.name = 'Apache Ignite 3'
include(':ignite-page-memory')
include(':ignite-storage-api')
@@ -221,6 +229,11 @@ def ignite2Version =
properties["ignite2.version"].toString()
def ignite2Vendor = properties["ignite2.vendor"].toString()
dependencyResolutionManagement {
+ repositories {
+ maven { url 'https://plugins.gradle.org/m2/' }
+ maven { url 'https://repo.maven.apache.org/maven2/' }
+ }
+
versionCatalogs {
libs {
version('ignite2', ignite2Version)