Skip to content
Snippets Groups Projects
Verified Commit 29a63fcc authored by Martin Weise's avatar Martin Weise
Browse files

Fixed the testcontainers socket override

parent a2280a8b
No related branches found
No related tags found
2 merge requests!395Library,!394Grafana
This commit is part of merge request !394. Comments created here will be created in the context of that merge request.
...@@ -143,6 +143,94 @@ lint-open-api-version: ...@@ -143,6 +143,94 @@ lint-open-api-version:
- yq '.info.version' ./.docs/.openapi/api.base.yaml | grep -o "${APP_VERSION}" > ./openapi-app-version.txt - yq '.info.version' ./.docs/.openapi/api.base.yaml | grep -o "${APP_VERSION}" > ./openapi-app-version.txt
- diff ./openapi-app-version.txt ./app-version.txt - diff ./openapi-app-version.txt ./app-version.txt
build-metadata-service:
image: maven:3-openjdk-${JAVA_VERSION}
stage: build
only:
- merge_requests
- master
script:
- "mvn -f ./dbrepo-metadata-service/pom.xml clean install $MAVEN_OPTS -DskipTests"
# Compiled classes are needed for SonarQube in later stages
artifacts:
when: always
paths:
- ./dbrepo-metadata-service/test/target/classes
- ./dbrepo-metadata-service/services/target/classes
- ./dbrepo-metadata-service/repositories/target/classes
- ./dbrepo-metadata-service/rest-service/target/classes
- ./dbrepo-metadata-service/api/target/classes
- ./dbrepo-metadata-service/oai/target/classes
- ./dbrepo-metadata-service/entities/target/classes
expire_in: 1 days
build-analyse-service:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: build
only:
- merge_requests
- master
variables:
PIPENV_PIPFILE: "./dbrepo-analyse-service/Pipfile"
script:
- "pip install pipenv"
- "pipenv install gunicorn && pipenv install --dev --system --deploy"
build-lib:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: build
only:
- merge_requests
- master
variables:
PIPENV_PIPFILE: "./lib/python/Pipfile"
script:
- "pip install pipenv"
- "pipenv install gunicorn && pipenv install --dev --system --deploy"
build-data-service:
image: maven:3-openjdk-${JAVA_VERSION}
stage: build
only:
- merge_requests
- master
needs:
- build-metadata-service
dependencies:
- build-metadata-service
before_script:
- "mvn -f ./dbrepo-metadata-service/pom.xml clean install $MAVEN_OPTS -DskipTests"
script:
- "mvn -f ./dbrepo-data-service/pom.xml clean package $MAVEN_OPTS -DskipTests"
# Compiled classes are needed for SonarQube in later stages
artifacts:
when: always
paths:
- ./dbrepo-data-service/services/target/classes
- ./dbrepo-data-service/rest-service/target/classes
- ./dbrepo-data-service/querystore/target/classes
expire_in: 1 days
build-ui:
image: oven/bun:${BUN_VERSION}-alpine
stage: build
only:
- merge_requests
- master
script:
- "cd ./dbrepo-ui && bun install && bun run build"
build-search-service:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: build
only:
- merge_requests
- master
before_script:
- "pip install pipenv"
script:
- "cd dbrepo-search-service && pipenv install --system --deploy"
build-dashboard-service: build-dashboard-service:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION} image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: build stage: build
...@@ -154,6 +242,167 @@ build-dashboard-service: ...@@ -154,6 +242,167 @@ build-dashboard-service:
script: script:
- "cd dbrepo-dashboard-service && pipenv install --system --deploy" - "cd dbrepo-dashboard-service && pipenv install --system --deploy"
build-images:
image: docker.io/docker:${DOCKER_VERSION}-dind
stage: build
only:
- merge_requests
- master
before_script:
- "apk add --no-cache make"
- echo "$CI_REGISTRY_PASSWORD" | docker login --username "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY_URL
script:
- docker build -q --network=host -t dbrepo-metadata-service:build --target build dbrepo-metadata-service
- docker build -q --network=host -t dbrepo-data-service:build --target build dbrepo-data-service
- docker compose build -q --parallel
build-helm:
image: docker.io/docker:${DOCKER_VERSION}-dind
stage: build
only:
- merge_requests
- tags
- /^release-.*/
before_script:
- apk add --no-cache helm make
- echo "$CI_GPG_KEYRING" | base64 -d > ./secring.gpg
- echo "$CI_REGISTRY_PASSWORD" | docker login --username "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY_URL
script:
- make build-helm
test-metadata-service:
image: maven:3-openjdk-${JAVA_VERSION}
stage: test
only:
- merge_requests
- master
needs:
- build-metadata-service
dependencies:
- build-metadata-service
script:
- "mvn -f ./dbrepo-metadata-service/pom.xml clean test verify $MAVEN_OPTS"
- "cat ./dbrepo-metadata-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'"
artifacts:
when: always
paths:
- ./dbrepo-metadata-service/report/target/site/jacoco-aggregate/
- ./dbrepo-metadata-service/rest-service/target/surefire-reports/
expire_in: 1 days
reports:
junit: ./dbrepo-metadata-service/rest-service/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/'
test-data-service:
image: maven:3-openjdk-${JAVA_VERSION}
stage: test
only:
- merge_requests
- master
needs:
- build-data-service
dependencies:
- build-data-service
script:
- "mvn -f ./dbrepo-metadata-service/pom.xml clean install -DskipTests $MAVEN_OPTS"
- "mvn -f ./dbrepo-data-service/pom.xml clean test verify $MAVEN_OPTS"
- "cat ./dbrepo-data-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'"
artifacts:
when: always
paths:
- ./dbrepo-data-service/report/target/site/jacoco-aggregate/
- ./dbrepo-data-service/rest-service/target/surefire-reports/
expire_in: 1 days
reports:
junit: ./dbrepo-data-service/rest-service/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/'
test-analyse-service:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: test
only:
- merge_requests
- master
variables:
PIPENV_PIPFILE: "./dbrepo-analyse-service/Pipfile"
needs:
- build-analyse-service
dependencies:
- build-analyse-service
script:
- "pip install pipenv"
- "pipenv install gunicorn && pipenv install --dev --system --deploy"
- cd ./dbrepo-analyse-service/ && coverage run --rcfile=.coveragerc -m pytest tests/test_determine_dt.py tests/test_determine_pk.py tests/test_s3_client.py && coverage html && coverage xml && coverage report > ./coverage.txt
- "cat ./coverage.txt | grep -o 'TOTAL[^%]*%'"
artifacts:
when: always
paths:
- ./dbrepo-analyse-service/coverage.xml
- ./dbrepo-analyse-service/coverage.txt
expire_in: 1 days
reports:
junit: ./dbrepo-analyse-service/coverage.xml
coverage: '/TOTAL.*?([0-9]{1,3})%/'
test-auth-service-init:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: test
only:
- merge_requests
- master
variables:
PIPENV_PIPFILE: "./dbrepo-auth-service/init/Pipfile"
before_script:
- "apk add --no-cache alpine-sdk gcc python3-dev mariadb-connector-c-dev"
- "pip install pipenv"
- "pipenv install gunicorn && pipenv install --dev --system --deploy"
script:
- cd ./dbrepo-auth-service/init/ && coverage run --rcfile=.coveragerc -m pytest tests/test_unit_app.py && coverage html && coverage xml && coverage report > ./coverage.txt
- "cat ./coverage.txt | grep -o 'TOTAL[^%]*%'"
artifacts:
when: always
paths:
- ./dbrepo-auth-service/init/coverage.xml
- ./dbrepo-auth-service/init/coverage.txt
expire_in: 1 days
reports:
junit: ./dbrepo-auth-service/init/coverage.xml
coverage: '/TOTAL.*?([0-9]{1,3})%/'
test-search-service:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: test
only:
- merge_requests
- master
variables:
PIPENV_PIPFILE: "./dbrepo-search-service/Pipfile"
needs:
- build-search-service
dependencies:
- build-search-service
before_script:
- "cp -r ./dbrepo-search-service/init/clients ./dbrepo-search-service"
- "cp -r ./dbrepo-search-service/init/omlib ./dbrepo-search-service"
- "cp -r ./dbrepo-search-service/init/tests/rsa ./dbrepo-search-service/tests"
- "cp ./dbrepo-search-service/init/tests/test_keycloak_client.py ./dbrepo-search-service/tests"
- "cp ./dbrepo-search-service/init/tests/test_opensearch_client.py ./dbrepo-search-service/tests"
- "cp ./dbrepo-search-service/init/friendly_names_overrides.json ./dbrepo-search-service/friendly_names_overrides.json"
script:
- "pip install pipenv"
- "pipenv install gunicorn && pipenv install --dev --system --deploy"
- cd ./dbrepo-search-service/ && coverage run --rcfile=.coveragerc -m pytest tests/test_app.py tests/test_jwt.py tests/test_opensearch_client.py tests/test_keycloak_client.py && coverage html && coverage xml && coverage report > ./coverage.txt
- "cat ./coverage.txt | grep -o 'TOTAL[^%]*%'"
artifacts:
when: always
paths:
- ./dbrepo-search-service/coverage.xml
- ./dbrepo-search-service/coverage.txt
expire_in: 1 days
reports:
junit: ./dbrepo-search-service/coverage.xml
coverage: '/TOTAL.*?([0-9]{1,3})%/'
test-dashboard-service: test-dashboard-service:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION} image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: test stage: test
...@@ -172,7 +421,6 @@ test-dashboard-service: ...@@ -172,7 +421,6 @@ test-dashboard-service:
- "cp -r ./dbrepo-dashboard-service/init/tests/rsa ./dbrepo-dashboard-service/tests" - "cp -r ./dbrepo-dashboard-service/init/tests/rsa ./dbrepo-dashboard-service/tests"
- "cp -r ./dbrepo-dashboard-service/init/tests/conftest.py ./dbrepo-dashboard-service/tests" - "cp -r ./dbrepo-dashboard-service/init/tests/conftest.py ./dbrepo-dashboard-service/tests"
script: script:
- echo "${TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE}"
- "pip install pipenv" - "pip install pipenv"
- "pipenv install gunicorn && pipenv install --dev --system --deploy" - "pipenv install gunicorn && pipenv install --dev --system --deploy"
- cd ./dbrepo-dashboard-service/ && coverage run --rcfile=.coveragerc -m pytest tests/test_integration_app.py && coverage html && coverage xml && coverage report > ./coverage.txt - cd ./dbrepo-dashboard-service/ && coverage run --rcfile=.coveragerc -m pytest tests/test_integration_app.py && coverage html && coverage xml && coverage report > ./coverage.txt
...@@ -200,7 +448,6 @@ test-dashboard-service-init: ...@@ -200,7 +448,6 @@ test-dashboard-service-init:
dependencies: dependencies:
- build-dashboard-service - build-dashboard-service
script: script:
- echo "${TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE}"
- "pip install pipenv" - "pip install pipenv"
- "pipenv install gunicorn && pipenv install --dev --system --deploy" - "pipenv install gunicorn && pipenv install --dev --system --deploy"
- cd ./dbrepo-dashboard-service/init/ && coverage run --rcfile=.coveragerc -m pytest tests/test_app.py tests/test_integration_dashboard.py && coverage html && coverage xml && coverage report > ./coverage.txt - cd ./dbrepo-dashboard-service/init/ && coverage run --rcfile=.coveragerc -m pytest tests/test_app.py tests/test_integration_dashboard.py && coverage html && coverage xml && coverage report > ./coverage.txt
...@@ -215,3 +462,258 @@ test-dashboard-service-init: ...@@ -215,3 +462,258 @@ test-dashboard-service-init:
junit: ./dbrepo-dashboard-service/init/coverage.xml junit: ./dbrepo-dashboard-service/init/coverage.xml
coverage: '/TOTAL.*?([0-9]{1,3})%/' coverage: '/TOTAL.*?([0-9]{1,3})%/'
test-search-service-init:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: test
only:
- merge_requests
- master
variables:
PIPENV_PIPFILE: "./dbrepo-search-service/init/Pipfile"
needs:
- build-search-service
dependencies:
- build-search-service
script:
- "pip install pipenv"
- "pipenv install gunicorn && pipenv install --dev --system --deploy"
- cd ./dbrepo-search-service/init/ && coverage run --rcfile=.coveragerc -m pytest tests/test_app.py tests/test_keycloak_client.py tests/test_opensearch_client.py && coverage html && coverage xml && coverage report > ./coverage.txt
- "cat ./coverage.txt | grep -o 'TOTAL[^%]*%'"
artifacts:
when: always
paths:
- ./dbrepo-search-service/coverage.xml
- ./dbrepo-search-service/coverage.txt
expire_in: 1 days
reports:
junit: ./dbrepo-search-service/coverage.xml
coverage: '/TOTAL.*?([0-9]{1,3})%/'
test-lib:
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
stage: test
only:
- merge_requests
- master
variables:
PIPENV_PIPFILE: "./lib/python/Pipfile"
needs:
- build-lib
dependencies:
- build-lib
script:
- "pip install pipenv"
- "pipenv install gunicorn && pipenv install --dev --system --deploy"
- cd ./lib/python/ && coverage run --rcfile=.coveragerc -m pytest tests/test_unit_container.py tests/test_unit_messages.py tests/test_unit_image.py tests/test_unit_concept.py tests/test_unit_database.py tests/test_unit_identifier.py tests/test_unit_license.py tests/test_unit_query.py tests/test_unit_rest_client.py tests/test_unit_table.py tests/test_unit_user.py tests/test_unit_view.py tests/test_unit_unit.py && coverage html && coverage xml && coverage report > ./coverage.txt
- "cat ./coverage.txt | grep -o 'TOTAL[^%]*%'"
artifacts:
when: always
paths:
- ./lib/python/coverage.xml
- ./lib/python/coverage.txt
expire_in: 1 days
reports:
junit: ./lib/python/coverage.xml
coverage: '/TOTAL.*?([0-9]{1,3})%/'
test-ui:
image: docker.io/docker:${DOCKER_VERSION}-dind
stage: test
only:
- merge_requests
- master
needs:
- build-ui
dependencies:
- build-ui
before_script:
- "apk add --no-cache bash apache2-utils"
- "docker compose build dbrepo-ui"
- "docker run --name dbrepo-ui -e NODE_OPTIONS='--max_old_space_size=256' -p 3000:3000 -d dbrepo-ui:latest"
script:
- "sleep 30"
- "ENDPOINT=http://localhost:3000 bash ./dbrepo-ui/tests/test_heap.sh"
clean-images:
stage: clean
image: docker:${DOCKER_VERSION}-dind
only:
refs:
- tags
- dev
before_script:
- "docker logout ${CI_REGISTRY_URL}"
- "echo ${CI_REGISTRY_PASSWORD} | docker login --username ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY_URL}"
- "docker logout ${CI_REGISTRY2_URL}"
- "echo ${CI_REGISTRY2_PASSWORD} | docker login --username ${CI_REGISTRY2_USER} --password-stdin ${CI_REGISTRY2_URL}"
- "apk add --no-cache wget bash"
- "wget -O /usr/local/sbin/regctl https://github.com/regclient/regclient/releases/download/v0.8.2/regctl-linux-amd64"
- "chmod +x /usr/local/sbin/regctl"
script:
- bash ./.gitlab/remove-unsupported-images.sh
release-images:
stage: release
image: docker:${DOCKER_VERSION}-dind
dependencies:
- clean-images
- test-analyse-service
- test-auth-service-init
- test-data-service
- test-lib
- test-metadata-service
- test-search-service
- test-search-service-init
- test-ui
only:
- tags
- dev
before_script:
- "docker logout ${CI_REGISTRY_URL}"
- "echo ${CI_REGISTRY_PASSWORD} | docker login --username ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY_URL}"
- "docker logout ${CI_REGISTRY2_URL}"
- "echo ${CI_REGISTRY2_PASSWORD} | docker login --username ${CI_REGISTRY2_USER} --password-stdin ${CI_REGISTRY2_URL}"
script:
- docker build -q --network=host -t dbrepo-metadata-service:build --target build dbrepo-metadata-service
- docker build -q --network=host -t dbrepo-data-service:build --target build dbrepo-data-service
- docker compose build -q --parallel
- docker tag dbrepo-analyse-service:latest "${CI_REGISTRY2_URL}/analyse-service:${APP_VERSION}${BUILD_VERSION}"
- docker tag dbrepo-dashboard-service:latest "${CI_REGISTRY2_URL}/dashboard-service:${APP_VERSION}${BUILD_VERSION}"
- docker tag dbrepo-ui:latest "${CI_REGISTRY2_URL}/ui:${APP_VERSION}${BUILD_VERSION}"
- docker tag dbrepo-data-service:latest "${CI_REGISTRY2_URL}/data-service:${APP_VERSION}${BUILD_VERSION}"
- docker tag dbrepo-auth-service-init:latest "${CI_REGISTRY2_URL}/auth-service-init:${APP_VERSION}${BUILD_VERSION}"
- docker tag dbrepo-metadata-service:latest "${CI_REGISTRY2_URL}/metadata-service:${APP_VERSION}${BUILD_VERSION}"
- docker tag dbrepo-search-db:latest "${CI_REGISTRY2_URL}/search-db:${APP_VERSION}${BUILD_VERSION}"
- docker tag dbrepo-search-service:latest "${CI_REGISTRY2_URL}/search-service:${APP_VERSION}${BUILD_VERSION}"
- docker tag dbrepo-search-service-init:latest "${CI_REGISTRY2_URL}/search-service-init:${APP_VERSION}${BUILD_VERSION}"
- docker tag dbrepo-storage-service-init:latest "${CI_REGISTRY2_URL}/storage-service-init:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/analyse-service:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/dashboard-service:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/ui:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/data-service:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/auth-service-init:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/search-db:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/metadata-service:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/search-service:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/search-service-init:${APP_VERSION}${BUILD_VERSION}"
- docker push "${CI_REGISTRY2_URL}/storage-service-init:${APP_VERSION}${BUILD_VERSION}"
release-helm:
stage: release
image: docker:${DOCKER_VERSION}-dind
only:
- tags
needs:
- build-helm
dependencies:
- build-helm
before_script:
- "apk add --no-cache sed helm make"
- "docker logout ${CI_REGISTRY_URL}"
- "echo ${CI_REGISTRY_PASSWORD} | docker login --username ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY_URL}"
- "docker logout ${CI_REGISTRY2_URL}"
- "echo ${CI_REGISTRY2_PASSWORD} | docker login --username ${CI_REGISTRY2_USER} --password-stdin ${CI_REGISTRY2_URL}"
- "mkdir -p ~/.gnupg"
- echo "$CI_GPG_KEYRING" | base64 -d > ./secring.gpg
- echo "$CI_GPG_KEYRING2" | base64 -d > ./pubring.gpg
- helm registry login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY_URL}"
- helm registry login --username "${CI_REGISTRY2_USER}" --password "${CI_REGISTRY2_PASSWORD}" "${CI_REGISTRY2_URL}"
- make build-helm
- "helm package ./helm/dbrepo --sign --key 'Martin Weise' --keyring ./secring.gpg --destination ./build"
- "helm plugin install https://github.com/sigstore/helm-sigstore"
script:
- "helm push ./build/dbrepo-${CHART_VERSION}.tgz oci://${CI_REGISTRY2_URL}/helm"
- "helm sigstore upload --keyring ./pubring.gpg ./build/dbrepo-${CHART_VERSION}.tgz"
release-docs:
stage: release
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
only:
refs:
- /^release-.*/
before_script:
- "apk add --no-cache alpine-sdk bash sed wget openssh jq curl"
- "pip install pipenv"
- "pipenv install --dev --system --deploy"
- "mkdir -p ./final/${DOC_VERSION}/rest"
- "mkdir -p ./final/${APP_VERSION}"
script:
- "make gen-lib-doc gen-docs-doc package-config"
- "cp -r ./lib/python/docs/build/html ./final/${DOC_VERSION}/python" # sphinx
- "cp .docs/.openapi/api.yaml ./final/${DOC_VERSION}/rest/api.yaml" # openapi
- "cp .docs/.openapi/swagger-ui.html ./final/${DOC_VERSION}/rest/index.html" # openapi
- "cp .docs/.openapi/custom.css ./final/${DOC_VERSION}/rest/custom.css" # openapi
- "cp -r ./site/* ./final/${DOC_VERSION}" # mkdocs
- "cp .docker/dist.tar.gz ./final/${APP_VERSION}/dist.tar.gz" # dist
- "cp .docs/index.html.tpl ./final/index.html" # redirect patch docs
- sed -i "s/DOC_VERSION/$DOC_VERSION/g" ./final/index.html
- "bash ./.gitlab/gen-badge.sh"
- eval $(ssh-agent -s)
- "mkdir -p /root/.ssh"
- echo "$CI_KEY_PRIVATE" > /root/.ssh/id_rsa && chmod 0600 /root/.ssh/id_rsa
- echo "$CI_KEY_PUBLIC" > /root/.ssh/id_rsa.pub
- echo "$CI_DOC_ID" > ~/.ssh/known_hosts
- tar czf ./final.tar.gz ./final
- "scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa final.tar.gz $CI_DOC_USER@$CI_DOC_IP:final.tar.gz"
- "scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa versions.json $CI_DOC_USER@$CI_DOC_IP:/system/user/ifs/infrastructures/public_html/dbrepo/versions.json"
- "scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa .docs/index.html.tpl $CI_DOC_USER@$CI_DOC_IP:/system/user/ifs/infrastructures/public_html/dbrepo/index.html"
- 'ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa $CI_DOC_USER@$CI_DOC_IP "rm -rf /system/user/ifs/infrastructures/public_html/dbrepo/${DOC_VERSION}; tar xzf ./final.tar.gz; rm -f ./final.tar.gz; cp -r ./final/* /system/user/ifs/infrastructures/public_html/dbrepo; rm -rf ./final"'
release-libs:
stage: release
image: docker.io/python:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
only:
- tags
variables:
PIPENV_PIPFILE: "./dbrepo-analyse-service/Pipfile"
before_script:
- "apk add sed bash"
- "pip install pipenv twine build"
- "pipenv install gunicorn && pipenv install --dev --system --deploy"
script:
- bash ./lib/python/package.sh
- bash ./lib/python/release.sh
verify-install-script:
image: docker.io/docker:${DOCKER_VERSION}-dind
stage: verify
only:
refs:
- /^release-.*/
variables:
SKIP_CHECKS: 1
before_script:
- "apk add bash curl"
script:
- "curl -sSL https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${DOC_VERSION}/install.sh | bash | grep 'Success!'"
verify-dist:
image: docker.io/alpine:${ALPINE_VERSION}
stage: verify
only:
refs:
- /^release-.*/
before_script:
- "apk add curl"
script:
- "curl -v --output /dev/null --fail https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/${APP_VERSION}/dist.tar.gz"
scan-sonarqube:
image: sonarsource/sonar-scanner-cli:${SONARQUBE_VERSION}
stage: scan
only:
- master
needs:
- build-data-service
- build-metadata-service
dependencies:
- build-data-service
- build-metadata-service
script:
- 'sonar-scanner -Dsonar.token="${CI_SONAR_TOKEN}"'
allow_failure: true
cache:
policy: pull
key: "${CI_COMMIT_SHORT_SHA}"
paths:
- sonar-scanner/
...@@ -3,7 +3,6 @@ import os ...@@ -3,7 +3,6 @@ import os
import pytest import pytest
from app import app
from clients.grafana_client import GrafanaClient from clients.grafana_client import GrafanaClient
from tests.grafana import GrafanaContainer from tests.grafana import GrafanaContainer
...@@ -11,13 +10,7 @@ logging.basicConfig(level=logging.DEBUG) ...@@ -11,13 +10,7 @@ logging.basicConfig(level=logging.DEBUG)
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def app_context(): def session(request):
with app.app_context():
yield
@pytest.fixture(scope="session")
def session(request, app_context):
""" """
Create one Grafana container per test run only (admin:admin) Create one Grafana container per test run only (admin:admin)
:param request: / :param request: /
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment