Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c53d9e2f5d | ||
|
|
694daac64c |
@@ -33,7 +33,7 @@ jobs:
|
||||
build-and-push:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
||||
image: git.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
||||
credentials:
|
||||
username: ${{ vars.CI_GITEA_USERNAME }}
|
||||
password: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
[ -z "$_TOKEN" ] && _TOKEN="$DEVELOPER_GITEA_API_TOKEN"
|
||||
[ -z "$_TOKEN" ] && _TOKEN="$CI_GITEA_TOKEN"
|
||||
if [ -z "$_TOKEN" ]; then echo "Gitea API token not set — skipping Docker login"; exit 1; fi
|
||||
echo "$_TOKEN" | docker login git.oblachno.oblachno.fyi -u "$CI_GITEA_USERNAME" --password-stdin
|
||||
echo "$_TOKEN" | docker login git.oblachno.fyi -u "$CI_GITEA_USERNAME" --password-stdin
|
||||
- name: Build and push tier images
|
||||
if: >-
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
@@ -88,21 +88,21 @@ jobs:
|
||||
--dockerfile docker/ci-base/Dockerfile \
|
||||
--name oblachno-oss/runner-images/ci-base \
|
||||
--tag latest \
|
||||
--registry git.oblachno.oblachno.fyi \
|
||||
--registry git.oblachno.fyi \
|
||||
--push --pull
|
||||
# Build ci-quality (FROM ci-base-latest)
|
||||
python3 -m devx.tools.build_image \
|
||||
--dockerfile docker/ci-quality/Dockerfile \
|
||||
--name oblachno-oss/runner-images/ci-quality \
|
||||
--tag latest \
|
||||
--registry git.oblachno.oblachno.fyi \
|
||||
--registry git.oblachno.fyi \
|
||||
--push
|
||||
# Build ci-full (FROM ci-quality-latest)
|
||||
python3 -m devx.tools.build_image \
|
||||
--dockerfile docker/ci-full/Dockerfile \
|
||||
--name oblachno-oss/runner-images/ci-full \
|
||||
--tag latest \
|
||||
--registry git.oblachno.oblachno.fyi \
|
||||
--registry git.oblachno.fyi \
|
||||
--push
|
||||
- name: Notify on failure
|
||||
if: failure()
|
||||
@@ -124,7 +124,7 @@ jobs:
|
||||
if: always() && needs.build-and-push.result == 'success'
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||
image: git.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||
credentials:
|
||||
username: ${{ vars.CI_GITEA_USERNAME }}
|
||||
password: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
validate:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
||||
image: git.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
||||
credentials:
|
||||
username: ${{ vars.CI_GITEA_USERNAME }}
|
||||
password: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||
@@ -173,7 +173,7 @@ jobs:
|
||||
needs.validate.result == 'success'
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||
image: git.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||
credentials:
|
||||
username: ${{ vars.CI_GITEA_USERNAME }}
|
||||
password: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
detect-and-configure:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||
image: git.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||
credentials:
|
||||
username: ${{ vars.CI_GITEA_USERNAME }}
|
||||
password: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||
@@ -109,7 +109,7 @@ jobs:
|
||||
if: always() && needs.detect-and-configure.result == 'success'
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
||||
image: git.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
||||
credentials:
|
||||
username: ${{ vars.CI_GITEA_USERNAME }}
|
||||
password: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Layers on top of ci-quality: adds release tools, molecule, deploy deps,
|
||||
# git-cliff, and OpenTofu.
|
||||
|
||||
FROM git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-quality:latest
|
||||
FROM git.oblachno.fyi/oblachno-oss/runner-images/ci-quality:latest
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# Layers on top of ci-base: adds lint tools + actionlint + checkmake.
|
||||
|
||||
FROM git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||
FROM git.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||
|
||||
# Install devx[lint] from local source (adds ruff, pyright, bandit, etc.)
|
||||
COPY . /tmp/devx
|
||||
|
||||
@@ -117,7 +117,7 @@ def main() -> int:
|
||||
parser.add_argument("--dry-run", action="store_true", help="List without cancelling")
|
||||
parser.add_argument(
|
||||
"--base-url",
|
||||
default=os.environ.get("GITEA_API_URL", "https://git.oblachno.oblachno.fyi"),
|
||||
default=os.environ.get("GITEA_API_URL", "https://git.oblachno.fyi"),
|
||||
help="Gitea base URL",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
+2
-2
@@ -68,8 +68,8 @@ def _get_int(key: str, env_var: str, default: int) -> int:
|
||||
|
||||
|
||||
# API endpoints — override via env vars for different Gitea/Vikunja instances
|
||||
GITEA_API_URL = _get("gitea_api_url", "DEVX_GITEA_API_URL", "https://git.oblachno.oblachno.fyi/api/v1")
|
||||
VIKUNJA_API_URL = _get("vikunja_api_url", "DEVX_VIKUNJA_API_URL", "https://work.oblachno.oblachno.fyi/api/v1")
|
||||
GITEA_API_URL = _get("gitea_api_url", "DEVX_GITEA_API_URL", "https://git.oblachno.fyi/api/v1")
|
||||
VIKUNJA_API_URL = _get("vikunja_api_url", "DEVX_VIKUNJA_API_URL", "https://tasks.oblachno.fyi/api/v1")
|
||||
|
||||
# Organization defaults — each project MUST set DEVX_REPO_OWNER explicitly.
|
||||
# No default: prevents silent 404s when the wrong owner is used.
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
# DEVX_TYPECHECK_PATHS — paths for pyright (default: empty — uses pyright config)
|
||||
# DEVX_COV_PKG — coverage package name (default: src/devx)
|
||||
# DEVX_TEST_PATHS — pytest paths (default: tests/)
|
||||
# DEVX_GITEA_PYPI_HOST — Gitea PyPI host (default: git.oblachno.oblachno.fyi)
|
||||
# DEVX_GITEA_PYPI_HOST — Gitea PyPI host (default: git.oblachno.fyi)
|
||||
# DEVX_GITEA_PYPI_ORG — Gitea PyPI org (default: oblachno-oss)
|
||||
# DEVX_ACTIONLINT_CFG — actionlint config file (default: .gitea/actionlint.yaml)
|
||||
# DEVX_WORKFLOW_DIR — workflow directory (default: .gitea/workflows)
|
||||
@@ -50,7 +50,7 @@ DEVX_BIN ?= $(DEVX_VENV)/bin
|
||||
DEVX_LINT_PATHS ?= src/ tests/
|
||||
DEVX_COV_PKG ?= src/devx
|
||||
DEVX_TEST_PATHS ?= tests/
|
||||
DEVX_GITEA_PYPI_HOST ?= git.oblachno.oblachno.fyi
|
||||
DEVX_GITEA_PYPI_HOST ?= git.oblachno.fyi
|
||||
DEVX_GITEA_PYPI_ORG ?= oblachno-oss
|
||||
DEVX_ACTIONLINT_CFG ?= .gitea/actionlint.yaml
|
||||
DEVX_WORKFLOW_DIR ?= .gitea/workflows
|
||||
@@ -445,11 +445,11 @@ devx-setup-image:
|
||||
# ── Docker image build / push / cleanup ───────────────────────────────────────
|
||||
#
|
||||
# Variables:
|
||||
# DEVX_GITEA_REGISTRY — registry URL (default: git.oblachno.oblachno.fyi)
|
||||
# DEVX_GITEA_REGISTRY — registry URL (default: git.oblachno.fyi)
|
||||
# DEVX_IMAGE_MANIFEST — path to JSON manifest (default: docker/images.json)
|
||||
# DEVX_IMAGE_OWNER — package owner for cleanup (default: oblachno-oss)
|
||||
|
||||
DEVX_GITEA_REGISTRY ?= git.oblachno.oblachno.fyi
|
||||
DEVX_GITEA_REGISTRY ?= git.oblachno.fyi
|
||||
DEVX_IMAGE_MANIFEST ?= docker/images.json
|
||||
DEVX_IMAGE_OWNER ?= oblachno-oss
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ from pathlib import Path
|
||||
PLATFORMS: list[dict[str, str]] = [
|
||||
{
|
||||
"name": "ubuntu-2604",
|
||||
"image": "git.oblachno.oblachno.fyi/oblachno/molecule-test-base:latest",
|
||||
"image": "git.oblachno.fyi/oblachno/molecule-test-base:latest",
|
||||
"command": "sleep infinity",
|
||||
},
|
||||
]
|
||||
|
||||
@@ -22,7 +22,7 @@ Usage::
|
||||
--dockerfile docker/ci-base/Dockerfile \\
|
||||
--tag ci-base:latest \\
|
||||
--tag ci-base:0.19.3 \\
|
||||
--registry git.oblachno.oblachno.fyi \\
|
||||
--registry git.oblachno.fyi \\
|
||||
--push
|
||||
|
||||
# Build multiple images (from a manifest file)
|
||||
|
||||
@@ -6,7 +6,7 @@ loading from environment variables. Supports required and optional modes.
|
||||
|
||||
Usage::
|
||||
|
||||
python3 -m devx.tools.docker_login --registry git.oblachno.oblachno.fyi \\
|
||||
python3 -m devx.tools.docker_login --registry git.oblachno.fyi \\
|
||||
--token-env CI_GITEA_TOKEN --username-env CI_GITEA_USERNAME \\
|
||||
--default-username emil
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ def _configure_tea_login() -> None:
|
||||
click.echo("tea: Gitea API token not set — skipping login configuration.")
|
||||
return
|
||||
|
||||
api_url = os.environ.get("DEVX_GITEA_API_URL", "https://git.oblachno.oblachno.fyi/api/v1")
|
||||
api_url = os.environ.get("DEVX_GITEA_API_URL", "https://git.oblachno.fyi/api/v1")
|
||||
gitea_url = api_url.replace("/api/v1", "")
|
||||
login_name = "devx"
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ def _fallback_to_setup_ci() -> None:
|
||||
)
|
||||
@click.option(
|
||||
"--gitea-host",
|
||||
default="git.oblachno.oblachno.fyi",
|
||||
default="git.oblachno.fyi",
|
||||
show_default=True,
|
||||
help="Gitea host for the PyPI registry.",
|
||||
)
|
||||
|
||||
@@ -86,7 +86,7 @@ class TestPushToBadgesBranch:
|
||||
|
||||
class TestUpdateBadgeUrls:
|
||||
def test_replaces_branch_url(self) -> None:
|
||||
content = "[]"
|
||||
content = "[]"
|
||||
result = push_badges.update_badge_urls(content, "abc123def456")
|
||||
assert "raw/commit/abc123def456/tests.svg" in result
|
||||
assert "raw/branch/badges" not in result
|
||||
@@ -95,7 +95,7 @@ class TestUpdateBadgeUrls:
|
||||
"""Old commit SHA URLs should be replaced with the new one."""
|
||||
old_sha = "aabb123456789012345678901234567890123456" # 40 hex chars
|
||||
new_sha = "ccdd123456789012345678901234567890123456" # 40 hex chars
|
||||
content = f"[]"
|
||||
content = f"[]"
|
||||
result = push_badges.update_badge_urls(content, new_sha)
|
||||
assert f"raw/commit/{new_sha}/tests.svg" in result
|
||||
assert old_sha not in result
|
||||
@@ -107,16 +107,16 @@ class TestUpdateBadgeUrls:
|
||||
|
||||
def test_multiple_badges(self) -> None:
|
||||
content = (
|
||||
"[]\n"
|
||||
"[]\n"
|
||||
"[]"
|
||||
"[]\n"
|
||||
"[]\n"
|
||||
"[]"
|
||||
)
|
||||
result = push_badges.update_badge_urls(content, "abc123def456")
|
||||
assert result.count("raw/commit/abc123def456/") == 3
|
||||
assert "raw/branch/badges" not in result
|
||||
|
||||
def test_preserves_non_badge_urls(self) -> None:
|
||||
content = "[]"
|
||||
content = "[]"
|
||||
result = push_badges.update_badge_urls(content, "abc123")
|
||||
assert result == content
|
||||
|
||||
@@ -124,7 +124,7 @@ class TestUpdateBadgeUrls:
|
||||
class TestUpdateReadmeWithBadgeSha:
|
||||
def test_updates_readme(self, tmp_path: Path) -> None:
|
||||
readme = tmp_path / "README.md"
|
||||
readme.write_text("[]")
|
||||
readme.write_text("[]")
|
||||
with patch("subprocess.run"):
|
||||
push_badges.update_readme_with_badge_sha("abc123def456", repo_root=tmp_path)
|
||||
content = readme.read_text()
|
||||
@@ -147,7 +147,7 @@ class TestUpdateReadmeWithBadgeSha:
|
||||
|
||||
def test_version_verification_stale(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
readme = tmp_path / "README.md"
|
||||
readme.write_text("[]")
|
||||
readme.write_text("[]")
|
||||
monkeypatch.chdir(tmp_path)
|
||||
badges_dir = tmp_path / ".badges"
|
||||
badges_dir.mkdir(exist_ok=True)
|
||||
@@ -159,7 +159,7 @@ class TestUpdateReadmeWithBadgeSha:
|
||||
|
||||
def test_version_verification_current(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
readme = tmp_path / "README.md"
|
||||
readme.write_text("[]")
|
||||
readme.write_text("[]")
|
||||
monkeypatch.chdir(tmp_path)
|
||||
badges_dir = tmp_path / ".badges"
|
||||
badges_dir.mkdir(exist_ok=True)
|
||||
@@ -171,7 +171,7 @@ class TestUpdateReadmeWithBadgeSha:
|
||||
|
||||
def test_version_verification_no_badges_dir(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
readme = tmp_path / "README.md"
|
||||
readme.write_text("[]")
|
||||
readme.write_text("[]")
|
||||
monkeypatch.chdir(tmp_path)
|
||||
# No .badges/version.svg exists — should skip verification gracefully
|
||||
with patch("subprocess.run"):
|
||||
|
||||
@@ -19,12 +19,12 @@ from devx.tools.setup_image import (
|
||||
class TestBuildPipExtraIndexUrl:
|
||||
def test_basic_url(self) -> None:
|
||||
url = _build_pip_extra_index_url(
|
||||
"git.oblachno.oblachno.fyi",
|
||||
"git.oblachno.fyi",
|
||||
"oblachno-oss",
|
||||
"emil",
|
||||
"tok123",
|
||||
)
|
||||
assert url == "https://emil:tok123@git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple/"
|
||||
assert url == "https://emil:tok123@git.oblachno.fyi/api/packages/oblachno-oss/pypi/simple/"
|
||||
|
||||
def test_custom_host_org(self) -> None:
|
||||
url = _build_pip_extra_index_url(
|
||||
@@ -233,7 +233,7 @@ class TestCli:
|
||||
assert call_args[0] == ".venv"
|
||||
assert call_args[1] == "/opt/venv"
|
||||
assert call_args[2] == "" # no extras
|
||||
assert call_args[3] == "git.oblachno.oblachno.fyi"
|
||||
assert call_args[3] == "git.oblachno.fyi"
|
||||
assert call_args[4] == "oblachno-oss"
|
||||
|
||||
@patch("devx.tools.setup_image._fallback_to_setup_ci")
|
||||
|
||||
Reference in New Issue
Block a user