Skip to content

Commit 32b6566

Browse files
committed
final?
1 parent 22bd0ec commit 32b6566

File tree

5 files changed

+44
-7
lines changed

5 files changed

+44
-7
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ build:
1515

1616
pytest:
1717
stage: tests
18-
image: python:3.12-slim
18+
image: python:3.13-slim
1919
allow_failure: false
2020
tags:
2121
- kubernetes
@@ -64,13 +64,13 @@ deploy-staging-cyrus:
6464
<<: *deploy_configuration
6565
variables:
6666
ARGOCD_APP_NAME: "cyrus-staging-ingestion-engine-subscriptions"
67-
script: ./ci/deploy.sh staging-cyrus
67+
script: ./ci/deploy.sh staging/cyrus
6868

6969
deploy-production-creo:
7070
<<: *deploy_configuration
7171
only:
7272
- tags
7373
variables:
74-
ARGOCD_APP_NAME: "waw3-2-general-01-prod-catalogue-subscriptions"
74+
ARGOCD_APP_NAME: "stac-fastapi-os"
7575
script:
76-
- ./ci/deploy.sh production-waw3-2-general-01
76+
- ./ci/deploy.sh prod/waw3-2-general-01

ci/before_tests.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pip install --upgrade pip setuptools wheel
1111
pip install ./stac_fastapi/core
1212
pip install ./stac_fastapi/sfeos_helpers
1313
pip install ./stac_fastapi/opensearch[dev,server]
14-
pip install pytest-timeout
1514

1615
echo "Waiting for OpenSearch"
1716
timeout 100 bash -c 'until curl -f http://opensearch:9200/_cluster/health; do sleep 5; done'

ci/deploy.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ -z "$1" ]; then
6+
echo "Environment name is required. Possible options are: 'production-creo', 'production-lta'..."
7+
exit 1
8+
fi
9+
10+
11+
ENV=$1;
12+
13+
# Download operations repo and prepare for changes.
14+
apk add --no-cache git
15+
if [ -z "$CI_COMMIT_TAG" ]; then export APP_VERSION="${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}"; else APP_VERSION="${CI_COMMIT_TAG}"; fi
16+
if [ -z "$CI_COMMIT_TAG" ]; then export DOCKER_IMAGE="$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}"; else DOCKER_IMAGE="$CI_REGISTRY_IMAGE:${CI_COMMIT_TAG}"; fi
17+
git remote set-url origin https://oauth2:"${GITLAB_PUSH_TOKEN}"@gitlab.cloudferro.com/stac/operations.git
18+
git config --global user.email "[email protected]"
19+
git config --global user.name "GitLab CI/CD"
20+
git clone https://oauth2:"${GITLAB_PUSH_TOKEN}"@gitlab.cloudferro.com/stac/operations.git
21+
cd operations
22+
git checkout -B master
23+
24+
# Change deployment configuration operations.
25+
sed -i "s~'registry.cloudferro.com/stac/sfeos.*~'${DOCKER_IMAGE}',~" environments/"${ENV}"/stac-fastapi-os/main.jsonnet
26+
git add environments/"${ENV}"/stac-fastapi-os/main.jsonnet
27+
git commit -m "[${ENV}] stac-fastapi-os ${APP_VERSION}"
28+
git push origin master

ci/pytest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
set -e
33

4-
echo "Running OpenSearch tests..."
5-
pytest -sv --timeout=10 stac_fastapi/tests/
4+
echo "Running OpenSearch tests"
5+
pytest -v --timeout=10 --log-cli-level=ERROR stac_fastapi/tests/
66

ci/tag_image.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
export DOCKER_IMAGE="${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}"
6+
export TAGGED_IMAGE="$CI_REGISTRY_IMAGE:${CI_COMMIT_TAG}"
7+
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"},\"https://index.docker.io/v1/\":{\"auth\":\"$HUB_BASE64\"}}}" > /kaniko/.docker/config.json
8+
echo "FROM $DOCKER_IMAGE TO $TAGGED_IMAGE"
9+
echo "FROM ${DOCKER_IMAGE}" | /kaniko/executor --context $CI_PROJECT_DIR --dockerfile /dev/stdin --destination ${TAGGED_IMAGE}
10+
echo "Docker image -- $TAGGED_IMAGE"

0 commit comments

Comments
 (0)