<type>(scope): <description>

[body]

[footer(s)]
This commit is contained in:
ITQ
2025-11-22 18:26:15 +03:00
parent 8a57f9a910
commit 420823f188
+19 -35
View File
@@ -229,6 +229,7 @@ build-ml:
IMAGE_NAME: $BASE_IMAGE_NAME/ml IMAGE_NAME: $BASE_IMAGE_NAME/ml
CONTAINERFILE: Containerfile CONTAINERFILE: Containerfile
BUILDTARGET: ml BUILDTARGET: ml
when: manual
lint: lint:
<<: *uv-job <<: *uv-job
@@ -245,55 +246,37 @@ lint:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
test: test:
<<: *buildah-job
stage: test stage: test
tags:
- self-hosted
variables: variables:
COMPOSE_PROFILES: | COMPOSE_PROFILES: |
--profile migrations --profile migrations
--profile tests --profile tests
PODMAN_IGNORE_CGROUPSV1_WARNING: True before_script:
tags: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- self-hosted
script: script:
- dnf -y install podman podman-compose
# - cp ./infrastructure/configs/podman/ci.conf /etc/containers/containers.conf
- cp "$TEST_STAGE_FIREBASE_CONF" ./infrastructure/configs/backend/firebase.json
- podman info --format '{{.Host.EventLogger}}'
- export PROFILES="$(printf '%s ' $COMPOSE_PROFILES)" - export PROFILES="$(printf '%s ' $COMPOSE_PROFILES)"
- cp "$TEST_STAGE_FIREBASE_CONF" ./infrastructure/configs/backend/firebase.json
- | - |
( (
while true; do while true; do
podman-compose -f compose.yaml $PROFILES logs 2>&1 docker compose -f compose.yaml $PROFILES logs -f 2>&1
sleep 30 sleep 1
done done
) | grep "Error: no container" -v | tee -a compose.log & ) | tee -a compose.log &
- LOGS_PID=$! - LOGS_PID=$!
- |
(
while true; do
echo "Containers $(date)"
podman ps -a
sleep 10
done
) &
- | - |
REGISTRY_PREFIX=$CI_REGISTRY_IMAGE IMAGE_TAG=$CI_COMMIT_SHA \ REGISTRY_PREFIX=$CI_REGISTRY_IMAGE IMAGE_TAG=$CI_COMMIT_SHA \
podman-compose -f compose.yaml -f compose.prod.yaml \ docker compose -f compose.yaml -f compose.prod.yaml \
$PROFILES up -d --no-build --pull 2>&1 | tee compose.log $PROFILES up -d --quiet-pull --quiet-build 2>&1 | tee compose.log
TEST_CONTAINER_ID=$( - |
podman-compose ps --all --format json \ TEST_CONTAINER_ID=$(docker compose -f compose.yaml $PROFILES ps -q tests -a)
| jq -r '.[] | select(.Labels["io.podman.compose.service"] == "tests") | .Id' timeout 600 docker wait "$TEST_CONTAINER_ID"
) TEST_EXIT_CODE=$(docker inspect --format "{{.State.ExitCode}}" "$TEST_CONTAINER_ID")
if [ -z "$TEST_CONTAINER_ID" ]; then
echo "Tests container not found."
exit 1
fi
timeout 600 podman wait "$TEST_CONTAINER_ID"
TEST_EXIT_CODE=$(podman inspect --format "{{.State.ExitCode}}" "$TEST_CONTAINER_ID")
if [ "$TEST_EXIT_CODE" -eq 0 ]; then if [ "$TEST_EXIT_CODE" -eq 0 ]; then
echo "Tests passed." echo "Tests passed."
@@ -301,8 +284,7 @@ test:
echo "Tests failed with exit code $TEST_EXIT_CODE." echo "Tests failed with exit code $TEST_EXIT_CODE."
exit 1 exit 1
fi fi
- | - docker compose -f compose.yaml $PROFILES down
podman-compose -f compose.yaml $PROFILES down
- cat .cov/coverage.txt - cat .cov/coverage.txt
artifacts: artifacts:
paths: paths:
@@ -357,6 +339,7 @@ sast-image-ml:
IMAGE_TYPE: ml IMAGE_TYPE: ml
dependencies: dependencies:
- build-ml - build-ml
when: manual
tag-runtime: tag-runtime:
<<: *tag-config <<: *tag-config
@@ -377,6 +360,7 @@ tag-ml:
<<: *tag-config <<: *tag-config
variables: variables:
IMAGE_NAME: $BASE_IMAGE_NAME/ml IMAGE_NAME: $BASE_IMAGE_NAME/ml
when: manual
webhook-migrations-deploy: webhook-migrations-deploy:
<<: *webhook-config <<: *webhook-config