# SPDX-FileCopyrightText: 2024 Sarah Vaupel # # SPDX-License-Identifier: AGPL-3.0-or-later ### IMPORTANT NOTICE ### # Our pipeline consists of static and dynamic parts. # # This file only contains the dynamic parts of our pipeline. # Static jobs are defined in .gitlab-ci.yml. # # The marker "#dyn#" (without quotes) will be replaced by concrete values. ### variables: BACKEND_IMAGE_VERSION: #dyn# stages: - container - compile - lint - test container: stage: container image: ${IMAGE_BUILDER} script: - buildah bud -t backend/${CI_COMMIT_REF_SLUG}:${BACKEND_IMAGE_VERSION} docker/backend/Dockerfile - buildah push --creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" backend/${CI_COMMIT_REF_SLUG}:${BACKEND_IMAGE_VERSION} ${CI_REGISTRY_IMAGE}/backend/${CI_COMMIT_REF_SLUG}:${BACKEND_IMAGE_VERSION} rules: - changes: - docker/backend/Dockerfile interruptible: false compile: stage: compile needs: - job: container optional: true image: &backend-image ${CI_REGISTRY_IMAGE}/backend/${CI_COMMIT_REF_SLUG}:${BACKEND_IMAGE_VERSION} script: - &load-backend-image zcat docker/backend/image.tar.gz | podman image load - make -- --docker-run-backend-build FRADRIVE_SERVICE=backend CONTAINER_RUNNER=podman-compose artifacts: paths: - /fradrive/.stack/ - /fradrive/.stack-work/ cache: &backend-cache lint: stage: lint needs: - job: container optional: true image: *backend-image script: - *load-backend-image - make -- --docker-run-backend-lint FRADRIVE_SERVICE=backend CONTAINER_RUNNER=podman-compose cache: *backend-cache test: stage: test needs: - job: container optional: true - job: backend build artifacts: true image: *backend-image script: - *load-backend-image - make -- --docker-run-backend-test FRADRIVE_SERVICE=backend CONTAINER_RUNNER=podman-compose cache: *backend-cache