fradrive/.gitlab-ci/frontend.yml
Sarah Vaupel c177ff826e ci(gitlab-ci): separate frontend and backend downstreams
separate dynamic ci-yaml into two dynamic yamls for frontend and backend
2024-08-24 17:30:14 +02:00

80 lines
2.1 KiB
YAML

# SPDX-FileCopyrightText: 2024 Sarah Vaupel <sarah.vaupel@uniworx.de>
#
# 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:
FRONTEND_IMAGE_VERSION: #dyn#
stages:
- container
- compile
- lint
- test
container:
stage: container
image: ${IMAGE_BUILDER}
script:
- buildah bud -t frontend/${CI_COMMIT_REF_SLUG}:${FRONTEND_IMAGE_VERSION} docker/frontend/Dockerfile
- buildah push --creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" frontend/${CI_COMMIT_REF_SLUG}:${FRONTEND_IMAGE_VERSION} ${CI_REGISTRY_IMAGE}/frontend/${CI_COMMIT_REF_SLUG}:${FRONTEND_IMAGE_VERSION}
rules:
- changes:
- docker/frontend/Dockerfile
interruptible: false
compile:
stage: compile
needs:
- job: container
optional: true
image: &frontend-image ${CI_REGISTRY_IMAGE}/frontend/${CI_COMMIT_REF_SLUG}:${FRONTEND_IMAGE_VERSION}
script:
- &load-frontend-image zcat docker/frontend/image.tar.gz | podman image load
- make -- --docker-run-frontend-build FRADRIVE_SERVICE=frontend CONTAINER_RUNNER=podman-compose
artifacts:
paths:
- /fradrive/node_modules
- /fradrive/well-known
cache:
- &frontend-cache
key: default-frontend
paths:
- /fradrive/.npm/
- /fradrive/.well-known-cache/
lint:
stage: lint
needs:
- job: container
optional: true
image: *frontend-image
script:
- *load-frontend-image
- make -- --docker-run-frontend-lint FRADRIVE_SERVICE=frontend CONTAINER_RUNNER=podman-compose
cache: *frontend-cache
test:
stage: test
needs:
- job: container
optional: true
- job: frontend build
artifacts: true
image: *frontend-image
script:
- *load-frontend-image
- make -- --docker-run-frontend-test FRADRIVE_SERVICE=frontend CONTAINER_RUNNER=podman-compose
cache: *frontend-cache