ops: update CI
This commit is contained in:
parent
527a671a75
commit
6a0bbad108
@ -1,49 +1,23 @@
|
|||||||
|
# CI for services, check gitlab repo for python package CI
|
||||||
include:
|
include:
|
||||||
- project: "Gitlab/gitlab"
|
- project: "Gitlab/gitlab"
|
||||||
ref: 0.3.0
|
ref: main
|
||||||
file: "/ci-templates/research/python_pkg_venv_test_build_release_gitlab-ci.yml"
|
file: "/ci-templates/research/python_pkg-test-build-release.gitlab-ci.yml"
|
||||||
|
|
||||||
default:
|
|
||||||
image: python:3.10
|
|
||||||
|
|
||||||
|
# set project variables here
|
||||||
variables:
|
variables:
|
||||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
NEXUS_PROJECT_DIR: research # subfolder in Nexus docker-gin where your container will be stored
|
||||||
GITLAB_PYPI_URL: https://gitlab.knecon.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi
|
IMAGENAME: $CI_PROJECT_NAME # if the project URL is gitlab.example.com/group-name/project-1, CI_PROJECT_NAME is project-1
|
||||||
PYPI_REGISTRY_RESEARCH: https://gitlab.knecon.com/api/v4/groups/19/-/packages/pypi
|
REPORTS_DIR: reports
|
||||||
POETRY_SOURCE_REF_RESEARCH: gitlab-research
|
FF_USE_FASTZIP: "true" # enable fastzip - a faster zip implementation that also supports level configuration.
|
||||||
PYPI_REGISTRY_RED: https://gitlab.knecon.com/api/v4/groups/12/-/packages/pypi
|
ARTIFACT_COMPRESSION_LEVEL: default # can also be set to fastest, fast, slow and slowest. If just enabling fastzip is not enough try setting this to fastest or fast.
|
||||||
POETRY_SOURCE_REF_RED: gitlab-red
|
CACHE_COMPRESSION_LEVEL: default # same as above, but for caches
|
||||||
PYPI_REGISTRY_FFORESIGHT: https://gitlab.knecon.com/api/v4/groups/269/-/packages/pypi
|
# TRANSFER_METER_FREQUENCY: 5s # will display transfer progress every 5 seconds for artifacts and remote caches. For debugging purposes.
|
||||||
POETRY_SOURCE_REF_FFORESIGHT: gitlab-fforesight
|
|
||||||
# POETRY_HOME: /opt/poetry
|
|
||||||
|
|
||||||
setup-poetry-venv:
|
|
||||||
stage: setup
|
|
||||||
script:
|
|
||||||
- env # check env vars
|
|
||||||
# install poetry & return versions
|
|
||||||
- pip install --upgrade pip
|
|
||||||
- pip -V
|
|
||||||
- python -V
|
|
||||||
- pip install poetry
|
|
||||||
- poetry -V
|
|
||||||
# configure poetry
|
|
||||||
- poetry config installer.max-workers 10
|
|
||||||
- poetry config virtualenvs.in-project true
|
|
||||||
- poetry config repositories.${POETRY_SOURCE_REF_RESEARCH} ${PYPI_REGISTRY_RESEARCH}
|
|
||||||
- poetry config http-basic.${POETRY_SOURCE_REF_RESEARCH} ${CI_REGISTRY_USER} ${CI_JOB_TOKEN}
|
|
||||||
- poetry config repositories.${POETRY_SOURCE_REF_RED} ${PYPI_REGISTRY_RED}
|
|
||||||
- poetry config http-basic.${POETRY_SOURCE_REF_RED} ${CI_REGISTRY_USER} ${CI_JOB_TOKEN}
|
|
||||||
- poetry config repositories.${POETRY_SOURCE_REF_FFORESIGHT} ${PYPI_REGISTRY_FFORESIGHT}
|
|
||||||
- poetry config http-basic.${POETRY_SOURCE_REF_FFORESIGHT} ${CI_REGISTRY_USER} ${CI_JOB_TOKEN}
|
|
||||||
# create and activate venv
|
|
||||||
- poetry env use $(which python)
|
|
||||||
- source .venv/bin/activate
|
|
||||||
- python -m ensurepip
|
|
||||||
- env # check env vars again
|
|
||||||
# install from poetry.lock file
|
|
||||||
- poetry install --all-extras -vvv
|
|
||||||
|
|
||||||
run-tests:
|
############
|
||||||
script:
|
# UNIT TESTS
|
||||||
- echo "Disabled until we have an automated way to run docker compose before tests."
|
unit-tests:
|
||||||
|
variables:
|
||||||
|
###### UPDATE/EDIT ######
|
||||||
|
UNIT_TEST_DIR: "tests/unit_test"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user