ClickHouse/tests/ci/env_helper.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.8 KiB
Python
Raw Permalink Normal View History

2023-09-05 12:37:37 +00:00
#!/usr/bin/env python
2021-11-26 14:00:09 +00:00
import os
from os import path as p
2022-08-09 16:34:12 +00:00
module_dir = p.abspath(p.dirname(__file__))
git_root = p.abspath(p.join(module_dir, "..", ".."))
2024-06-10 09:18:03 +00:00
ROOT_DIR = git_root
2024-06-10 09:18:03 +00:00
IS_CI = bool(os.getenv("CI"))
2022-05-25 13:15:11 +00:00
TEMP_PATH = os.getenv("TEMP_PATH", p.abspath(p.join(module_dir, "./tmp")))
REPORT_PATH = f"{TEMP_PATH}/reports"
# FIXME: latest should not be used in CI, set temporary for transition to "docker with digest as a tag"
DOCKER_TAG = os.getenv("DOCKER_TAG", "latest")
2021-11-26 14:00:09 +00:00
CACHES_PATH = os.getenv("CACHES_PATH", TEMP_PATH)
CLOUDFLARE_TOKEN = os.getenv("CLOUDFLARE_TOKEN")
2022-05-16 18:39:10 +00:00
GITHUB_EVENT_PATH = os.getenv("GITHUB_EVENT_PATH", "")
GITHUB_JOB = os.getenv("GITHUB_JOB_OVERRIDDEN", "") or os.getenv("GITHUB_JOB", "local")
2021-11-26 14:00:09 +00:00
GITHUB_REPOSITORY = os.getenv("GITHUB_REPOSITORY", "ClickHouse/ClickHouse")
GITHUB_RUN_ID = os.getenv("GITHUB_RUN_ID", "0")
2021-11-26 14:00:09 +00:00
GITHUB_SERVER_URL = os.getenv("GITHUB_SERVER_URL", "https://github.com")
2024-05-03 15:45:39 +00:00
GITHUB_UPSTREAM_REPOSITORY = os.getenv(
"GITHUB_UPSTREAM_REPOSITORY", "ClickHouse/ClickHouse"
)
GITHUB_WORKSPACE = os.getenv("GITHUB_WORKSPACE", git_root)
GITHUB_RUN_URL = f"{GITHUB_SERVER_URL}/{GITHUB_REPOSITORY}/actions/runs/{GITHUB_RUN_ID}"
2022-04-07 16:22:29 +00:00
IMAGES_PATH = os.getenv("IMAGES_PATH", TEMP_PATH)
REPO_COPY = os.getenv("REPO_COPY", GITHUB_WORKSPACE)
RUNNER_TEMP = os.getenv("RUNNER_TEMP", p.abspath(p.join(module_dir, "./tmp")))
2021-11-26 14:00:09 +00:00
S3_BUILDS_BUCKET = os.getenv("S3_BUILDS_BUCKET", "clickhouse-builds")
2024-05-23 14:36:24 +00:00
S3_BUILDS_BUCKET_PUBLIC = "clickhouse-builds"
2021-11-26 14:00:09 +00:00
S3_TEST_REPORTS_BUCKET = os.getenv("S3_TEST_REPORTS_BUCKET", "clickhouse-test-reports")
2022-09-07 15:10:58 +00:00
S3_URL = os.getenv("S3_URL", "https://s3.amazonaws.com")
S3_DOWNLOAD = os.getenv("S3_DOWNLOAD", S3_URL)
S3_ARTIFACT_DOWNLOAD_TEMPLATE = (
f"{S3_DOWNLOAD}/{S3_BUILDS_BUCKET}/"
"{pr_or_release}/{commit}/{build_name}/{artifact}"
)
2024-05-31 09:21:18 +00:00
CI_CONFIG_PATH = f"{TEMP_PATH}/ci_config.json"