Skip to content
Snippets Groups Projects
Commit 3288b32e authored by Erwan Rouchet's avatar Erwan Rouchet Committed by Bastien Abadie
Browse files

Allow CI jobs using the base image to fail on a base build

parent d90d3fa0
No related branches found
No related tags found
No related merge requests found
image: registry.gitlab.com/arkindex/backend/base:django-3.1.1
stages:
- test
- build
- deploy
# GitLab provides a template to ensure pipelines run only for branches and tags, not for merge requests
# This prevents duplicate pipelines in merge requests.
# See https://docs.gitlab.com/ee/ci/troubleshooting.html#job-may-allow-multiple-pipelines-to-run-for-a-single-action
include:
- template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
# For jobs that run backend scripts directly
.backend-setup:
image: registry.gitlab.com/arkindex/backend/base:django-3.1.1
cache:
paths:
- .cache/pip
......@@ -19,6 +25,13 @@ stages:
- pip install -r tests-requirements.txt codecov
- "echo 'database: {host: postgres, port: 5432}' > $CONFIG_PATH"
# Those jobs require the base image; they might fail if the image is not up to date.
# Allow them to fail when building a new base image, to prevent them from blocking a new base image build
rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^base-.*/'
allow_failure: true
- when: on_success
variables:
# For the postgres image
POSTGRES_DB: arkindex_dev
......@@ -154,6 +167,7 @@ backend-build-binary:
backend-static-deploy:
stage: deploy
image: python:3-slim
# Run this on any version tag except base images
rules:
......@@ -174,6 +188,7 @@ backend-static-deploy:
backend-openapi-deploy:
stage: deploy
image: python:3-slim
# Run on master updates only
only:
......@@ -190,8 +205,8 @@ backend-openapi-deploy:
- aws s3 cp output/schema.yml s3://teklia-assets-release/arkindex/openapi.yml
sentry-release:
image: getsentry/sentry-cli
stage: deploy
image: getsentry/sentry-cli
rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^base-.*/'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment