You've already forked RekomenciBackend
<type>(scope): <description>
[body] [footer(s)]
This commit is contained in:
+24
-16
@@ -27,6 +27,13 @@ cache:
|
|||||||
- $UV_PROJECT_ENVIRONMENT
|
- $UV_PROJECT_ENVIRONMENT
|
||||||
policy: pull-push
|
policy: pull-push
|
||||||
|
|
||||||
|
.docker-job: &docker-job
|
||||||
|
image: docker:28.5
|
||||||
|
services:
|
||||||
|
- docker:28.5-dind
|
||||||
|
before_script:
|
||||||
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
|
||||||
.buildah-job: &buildah-job
|
.buildah-job: &buildah-job
|
||||||
image: quay.io/containers/buildah:latest
|
image: quay.io/containers/buildah:latest
|
||||||
variables:
|
variables:
|
||||||
@@ -246,18 +253,18 @@ lint:
|
|||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
<<: *docker-job
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
tags:
|
||||||
- self-hosted
|
- beta
|
||||||
variables:
|
variables:
|
||||||
COMPOSE_PROFILES: |
|
COMPOSE_PROFILES: |
|
||||||
--profile migrations
|
--profile migrations
|
||||||
--profile tests
|
--profile tests
|
||||||
script:
|
script:
|
||||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
|
- apk add --no-cache docker-compose
|
||||||
- export PROFILES="$(printf '%s ' $COMPOSE_PROFILES)"
|
- export PROFILES="$(printf '%s ' $COMPOSE_PROFILES)"
|
||||||
- cp "$TEST_STAGE_FIREBASE_CONF" ./infrastructure/configs/backend/firebase.json
|
- cp "$TEST_STAGE_FIREBASE_CONF" ./infrastructure/configs/backend/firebase.json
|
||||||
|
|
||||||
- |
|
- |
|
||||||
(
|
(
|
||||||
while true; do
|
while true; do
|
||||||
@@ -266,24 +273,23 @@ test:
|
|||||||
done
|
done
|
||||||
) | tee -a compose.log &
|
) | tee -a compose.log &
|
||||||
- LOGS_PID=$!
|
- LOGS_PID=$!
|
||||||
|
|
||||||
- |
|
- |
|
||||||
REGISTRY_PREFIX=$CI_REGISTRY_IMAGE IMAGE_TAG=$CI_COMMIT_SHA \
|
REGISTRY_PREFIX=$CI_REGISTRY_IMAGE IMAGE_TAG=$CI_COMMIT_SHA \
|
||||||
docker compose -f compose.yaml -f compose.prod.yaml \
|
docker compose -f compose.yaml -f compose.prod.yaml \
|
||||||
$PROFILES up -d --quiet-pull --quiet-build 2>&1 | tee compose.log
|
$PROFILES up -d --quiet-pull --quiet-build 2>&1 | tee compose.log
|
||||||
|
|
||||||
- |
|
- |
|
||||||
TEST_CONTAINER_ID=$(docker compose -f compose.yaml $PROFILES ps -q tests -a)
|
TEST_CONTAINER_ID=$(docker compose -f compose.yaml $PROFILES ps -q tests -a)
|
||||||
timeout 600 docker wait "$TEST_CONTAINER_ID"
|
timeout 600 docker wait $TEST_CONTAINER_ID
|
||||||
TEST_EXIT_CODE=$(docker inspect --format "{{.State.ExitCode}}" "$TEST_CONTAINER_ID")
|
TEST_EXIT_CODE=$(docker 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."
|
||||||
else
|
else
|
||||||
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
|
- |
|
||||||
|
docker compose -f compose.yaml $PROFILES down
|
||||||
- cat .cov/coverage.txt
|
- cat .cov/coverage.txt
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
@@ -333,7 +339,6 @@ sast-image-migrations:
|
|||||||
|
|
||||||
# sast-image-ml:
|
# sast-image-ml:
|
||||||
# <<: *trivy-image-scan
|
# <<: *trivy-image-scan
|
||||||
# when: manual
|
|
||||||
# variables:
|
# variables:
|
||||||
# IMAGE_NAME: $BASE_IMAGE_NAME/ml
|
# IMAGE_NAME: $BASE_IMAGE_NAME/ml
|
||||||
# IMAGE_TYPE: ml
|
# IMAGE_TYPE: ml
|
||||||
@@ -357,9 +362,9 @@ tag-migrations:
|
|||||||
|
|
||||||
# tag-ml:
|
# tag-ml:
|
||||||
# <<: *tag-config
|
# <<: *tag-config
|
||||||
# when: manual
|
|
||||||
# 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
|
||||||
@@ -384,12 +389,15 @@ webhook-backend-deploy:
|
|||||||
- build-runtime
|
- build-runtime
|
||||||
- sast-image-runtime
|
- sast-image-runtime
|
||||||
|
|
||||||
ml-deploy:
|
webhook-ml-deploy:
|
||||||
|
<<: *webhook-config
|
||||||
stage: deploy
|
stage: deploy
|
||||||
tags:
|
variables:
|
||||||
- self-hosted
|
WEBHOOK_URL: $WEBHOOK_URL_ML
|
||||||
script:
|
resource_group: staging
|
||||||
ls -l
|
# dependencies:
|
||||||
|
# - build-runtime
|
||||||
|
# - sast-image-runtime
|
||||||
|
|
||||||
workflow:
|
workflow:
|
||||||
rules:
|
rules:
|
||||||
|
|||||||
Reference in New Issue
Block a user