34 lines
807 B
YAML
34 lines
807 B
YAML
stages:
|
|
- linting
|
|
- testing
|
|
- build
|
|
- staging
|
|
- production
|
|
|
|
default:
|
|
image: python:3.12-alpine
|
|
|
|
pre_commit:
|
|
stage: linting
|
|
script:
|
|
- apk add git
|
|
- pip install --root-user-action ignore pre-commit
|
|
- pre-commit run -a
|
|
|
|
build_image:
|
|
stage: build
|
|
image: docker
|
|
services:
|
|
- docker
|
|
variables:
|
|
CONTAINER_NAME: ${CI_REGISTRY_IMAGE}/facturio
|
|
before_script:
|
|
- docker login ${CI_REGISTRY} -u gitlab-ci-token -p ${CI_JOB_TOKEN}
|
|
script:
|
|
- docker build -t ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} .
|
|
- docker push ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME}
|
|
- |
|
|
if [[ -n "${CI_COMMIT_TAG}" ]]; then
|
|
docker tag ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} ${CONTAINER_NAME}:${CI_COMMIT_TAG}
|
|
docker push ${CONTAINER_NAME}:${CI_COMMIT_TAG}
|
|
fi
|