62 lines
2.0 KiB
YAML
62 lines
2.0 KiB
YAML
# This file is a template, and might need editing before it works on your project.
|
|
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
|
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
|
# This specific template is located at:
|
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
|
|
|
|
# Official language image. Look for the different tagged releases at:
|
|
# https://hub.docker.com/r/library/python/tags/
|
|
image: python:3.8
|
|
|
|
# Change pip's cache directory to be inside the project directory since we can
|
|
# only cache local items.
|
|
variables:
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
# REGISTRY_USERNAME - secret variable
|
|
# REGISTRY_PASSWORD - secret variable
|
|
# REGISTRY_SERVER - secret variable
|
|
IMAGE_NAME: ${REGISTRY_SERVER}/malves/${CI_PROJECT_NAME}
|
|
|
|
# Pip's cache doesn't store the python packages
|
|
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
|
|
#
|
|
# If you want to also cache the installed packages, you have to install
|
|
# them in a virtualenv and cache it as well.
|
|
cache:
|
|
paths:
|
|
- .cache/pip
|
|
- venv/
|
|
|
|
test:
|
|
script:
|
|
- python3 -V # Print out python version for debugging
|
|
- pip3 install pipenv
|
|
- pipenv install --dev --skip-lock
|
|
- pipenv run pytest -v
|
|
- pipenv run halfapi --version
|
|
|
|
run:
|
|
script:
|
|
- python3 -V # Print out python version for debugging
|
|
- pip3 install pipenv
|
|
- pipenv install --dev --skip-lock
|
|
- pipenv run python -m build --sdist
|
|
- pipenv run python -m build --wheel
|
|
artifacts:
|
|
paths:
|
|
- dist/*.whl
|
|
|
|
build:
|
|
image: gite.lirmm.fr:5555/si-v4/docker
|
|
dependencies:
|
|
- build
|
|
before_script:
|
|
- podman version
|
|
- buildah version
|
|
# - podman login --username "${REGISTRY_USERNAME}" --password "${REGISTRY_PASSWORD}" "${REGISTRY_SERVER}"
|
|
script:
|
|
- buildah bud -t ${IMAGE_NAME}:${CI_COMMIT_SHA} .
|
|
# - buildah push ${IMAGE_NAME}:${CI_COMMIT_SHA} docker://${IMAGE_NAME}:${CI_COMMIT_SHA}
|
|
after_script:
|
|
# - podman logout "${REGISTRY_SERVER}"
|