You've already forked RekomenciBackend
<type>(scope): <description>
[body] [footer(s)]
This commit is contained in:
+19
-35
@@ -229,6 +229,7 @@ build-ml:
|
||||
IMAGE_NAME: $BASE_IMAGE_NAME/ml
|
||||
CONTAINERFILE: Containerfile
|
||||
BUILDTARGET: ml
|
||||
when: manual
|
||||
|
||||
lint:
|
||||
<<: *uv-job
|
||||
@@ -245,55 +246,37 @@ lint:
|
||||
- if: $CI_COMMIT_TAG
|
||||
|
||||
test:
|
||||
<<: *buildah-job
|
||||
stage: test
|
||||
tags:
|
||||
- self-hosted
|
||||
variables:
|
||||
COMPOSE_PROFILES: |
|
||||
--profile migrations
|
||||
--profile tests
|
||||
PODMAN_IGNORE_CGROUPSV1_WARNING: True
|
||||
tags:
|
||||
- self-hosted
|
||||
before_script:
|
||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
|
||||
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)"
|
||||
- cp "$TEST_STAGE_FIREBASE_CONF" ./infrastructure/configs/backend/firebase.json
|
||||
|
||||
- |
|
||||
(
|
||||
while true; do
|
||||
podman-compose -f compose.yaml $PROFILES logs 2>&1
|
||||
sleep 30
|
||||
docker compose -f compose.yaml $PROFILES logs -f 2>&1
|
||||
sleep 1
|
||||
done
|
||||
) | grep "Error: no container" -v | tee -a compose.log &
|
||||
) | tee -a compose.log &
|
||||
- LOGS_PID=$!
|
||||
- |
|
||||
(
|
||||
while true; do
|
||||
echo "Containers $(date)"
|
||||
podman ps -a
|
||||
sleep 10
|
||||
done
|
||||
) &
|
||||
|
||||
- |
|
||||
REGISTRY_PREFIX=$CI_REGISTRY_IMAGE IMAGE_TAG=$CI_COMMIT_SHA \
|
||||
podman-compose -f compose.yaml -f compose.prod.yaml \
|
||||
$PROFILES up -d --no-build --pull 2>&1 | tee compose.log
|
||||
docker compose -f compose.yaml -f compose.prod.yaml \
|
||||
$PROFILES up -d --quiet-pull --quiet-build 2>&1 | tee compose.log
|
||||
|
||||
TEST_CONTAINER_ID=$(
|
||||
podman-compose ps --all --format json \
|
||||
| jq -r '.[] | select(.Labels["io.podman.compose.service"] == "tests") | .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")
|
||||
- |
|
||||
TEST_CONTAINER_ID=$(docker compose -f compose.yaml $PROFILES ps -q tests -a)
|
||||
timeout 600 docker wait "$TEST_CONTAINER_ID"
|
||||
TEST_EXIT_CODE=$(docker inspect --format "{{.State.ExitCode}}" "$TEST_CONTAINER_ID")
|
||||
|
||||
if [ "$TEST_EXIT_CODE" -eq 0 ]; then
|
||||
echo "Tests passed."
|
||||
@@ -301,8 +284,7 @@ test:
|
||||
echo "Tests failed with exit code $TEST_EXIT_CODE."
|
||||
exit 1
|
||||
fi
|
||||
- |
|
||||
podman-compose -f compose.yaml $PROFILES down
|
||||
- docker compose -f compose.yaml $PROFILES down
|
||||
- cat .cov/coverage.txt
|
||||
artifacts:
|
||||
paths:
|
||||
@@ -357,6 +339,7 @@ sast-image-ml:
|
||||
IMAGE_TYPE: ml
|
||||
dependencies:
|
||||
- build-ml
|
||||
when: manual
|
||||
|
||||
tag-runtime:
|
||||
<<: *tag-config
|
||||
@@ -377,6 +360,7 @@ tag-ml:
|
||||
<<: *tag-config
|
||||
variables:
|
||||
IMAGE_NAME: $BASE_IMAGE_NAME/ml
|
||||
when: manual
|
||||
|
||||
webhook-migrations-deploy:
|
||||
<<: *webhook-config
|
||||
|
||||
Reference in New Issue
Block a user