chore(gitlab-ci): restructure containers stage
This commit is contained in:
parent
200fc96208
commit
0bdc63040d
103
.gitlab-ci.yml
103
.gitlab-ci.yml
@ -14,11 +14,16 @@ variables:
|
|||||||
# TODO: old vars; review and maybe remove
|
# TODO: old vars; review and maybe remove
|
||||||
AWS_SHARED_CREDENTIALS_FILE: "/etc/aws/credentials"
|
AWS_SHARED_CREDENTIALS_FILE: "/etc/aws/credentials"
|
||||||
TRANSFER_METER_FREQUENCY: "2s"
|
TRANSFER_METER_FREQUENCY: "2s"
|
||||||
|
CONTAINER_REGISTRY: registry.uniworx.de/fradrive/fradrive/
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
image:
|
image:
|
||||||
name: registry.uniworx.de/fradrive/fradrive/debian-podman:latest
|
name: registry.uniworx.de/uniworx/containers/debian:12.5
|
||||||
|
entrypoint: [""]
|
||||||
|
docker:
|
||||||
|
platform: x86_64
|
||||||
|
# name: registry.uniworx.de/fradrive/fradrive/debian-podman:latest
|
||||||
# name: registry.uniworx.de/fradrive/fradrive/docker:dind
|
# name: registry.uniworx.de/fradrive/fradrive/docker:dind
|
||||||
# name: registry.uniworx.de/fradrive/fradrive/fradrive-env:latest # Debian 12.5 Bookworm
|
# name: registry.uniworx.de/fradrive/fradrive/fradrive-env:latest # Debian 12.5 Bookworm
|
||||||
# entrypoint: [""]
|
# entrypoint: [""]
|
||||||
@ -37,22 +42,63 @@ default:
|
|||||||
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build images
|
- containers
|
||||||
- compile
|
- compile
|
||||||
- lint
|
- lint
|
||||||
- test
|
- test
|
||||||
- push images
|
|
||||||
- release # TODO
|
- release # TODO
|
||||||
|
|
||||||
|
# TODO: apply rules:changes for image jobs to only execute jobs when Dockerfiles change
|
||||||
|
|
||||||
frontend image:
|
frontend image:
|
||||||
stage: build images
|
stage: containers
|
||||||
|
image: &buildah quay.io/buildah/stable:latest
|
||||||
script:
|
script:
|
||||||
# TODO: define make target for this?
|
- buildah bud -t frontend docker/frontend/Dockerfile
|
||||||
- make -- --docker-build-frontend-build FRADRIVE_SERVICE=frontend CONTAINER_RUNNER=podman-compose
|
- buildah push frontend $CONTAINER_REGISTRY/frontend
|
||||||
- podman image save frontend | gzip > docker/frontend/image.tar.gz
|
# - make -- --docker-build-frontend-build FRADRIVE_SERVICE=frontend CONTAINER_RUNNER=podman-compose
|
||||||
artifacts:
|
# # - podman image save frontend | gzip > docker/frontend/image.tar.gz
|
||||||
paths:
|
# artifacts:
|
||||||
- docker/frontend/image.tar.gz
|
# paths:
|
||||||
|
# - docker/frontend/image.tar.gz
|
||||||
|
|
||||||
|
# push frontend image:
|
||||||
|
# stage: containers
|
||||||
|
# needs:
|
||||||
|
# - job: build frontend image
|
||||||
|
# artifacts: true
|
||||||
|
# image: quay.io/skopeo/stable:latest
|
||||||
|
# script:
|
||||||
|
# - skopeo --insecure-policy copy --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker-archive://$(pwd)/docker/frontend/image.tar.gz docker://${CI_REGISTRY_IMAGE}:${VERSION}
|
||||||
|
# - skopeo --insecure-policy copy --src-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker://${CI_REGISTRY_IMAGE}:${VERSION} docker://${CI_REGISTRY_IMAGE}:latest
|
||||||
|
# #- *load-frontend-image
|
||||||
|
# # - docker image tag
|
||||||
|
# - podman push frontend
|
||||||
|
# # variables:
|
||||||
|
# # GIT_STRATEGY: none
|
||||||
|
|
||||||
|
backend image:
|
||||||
|
stage: containers
|
||||||
|
image: *buildah
|
||||||
|
script:
|
||||||
|
- buildah bud -t backend docker/backend/Dockerfile
|
||||||
|
- buildah push backend $CONTAINER_REGISTRY/backend
|
||||||
|
# script:
|
||||||
|
# - make -- --docker-build-backend-build FRADRIVE_SERVICE=backend CONTAINER_RUNNER=podman-compose
|
||||||
|
# - podman image save backend | gzip > docker/backend/image.tar.gz
|
||||||
|
# artifacts:
|
||||||
|
# paths:
|
||||||
|
# - docker/backend/image.tar.gz
|
||||||
|
|
||||||
|
# push backend image:
|
||||||
|
# stage: containers
|
||||||
|
# needs:
|
||||||
|
# - job: backend image
|
||||||
|
# artifacts: true
|
||||||
|
# script:
|
||||||
|
# - *load-backend-image
|
||||||
|
# - podman push backend
|
||||||
|
|
||||||
|
|
||||||
frontend build:
|
frontend build:
|
||||||
stage: compile
|
stage: compile
|
||||||
@ -96,30 +142,6 @@ frontend test:
|
|||||||
|
|
||||||
cache: *frontend-cache
|
cache: *frontend-cache
|
||||||
|
|
||||||
push frontend image:
|
|
||||||
stage: push images
|
|
||||||
needs:
|
|
||||||
- job: frontend image
|
|
||||||
artifacts: true
|
|
||||||
- job: frontend build
|
|
||||||
artifacts: false
|
|
||||||
- job: frontend test
|
|
||||||
artifacts: false
|
|
||||||
script:
|
|
||||||
- *load-frontend-image
|
|
||||||
# - docker image tag
|
|
||||||
- podman push frontend
|
|
||||||
|
|
||||||
backend image:
|
|
||||||
stage: build images
|
|
||||||
script:
|
|
||||||
# TODO: define make target for this?
|
|
||||||
- make -- --docker-build-backend-build FRADRIVE_SERVICE=backend CONTAINER_RUNNER=podman-compose
|
|
||||||
- podman image save backend | gzip > docker/backend/image.tar.gz
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- docker/backend/image.tar.gz
|
|
||||||
|
|
||||||
backend build:
|
backend build:
|
||||||
stage: compile
|
stage: compile
|
||||||
needs:
|
needs:
|
||||||
@ -158,19 +180,6 @@ backend test:
|
|||||||
- make -- --docker-run-backend-test FRADRIVE_SERVICE=backend CONTAINER_RUNNER=podman-compose
|
- make -- --docker-run-backend-test FRADRIVE_SERVICE=backend CONTAINER_RUNNER=podman-compose
|
||||||
cache: *backend-cache
|
cache: *backend-cache
|
||||||
|
|
||||||
push backend image:
|
|
||||||
stage: push images
|
|
||||||
needs:
|
|
||||||
- job: backend image
|
|
||||||
artifacts: true
|
|
||||||
- job: backend build
|
|
||||||
artifacts: false
|
|
||||||
- job: backend test
|
|
||||||
artifacts: false
|
|
||||||
script:
|
|
||||||
- *load-backend-image
|
|
||||||
- podman push backend
|
|
||||||
|
|
||||||
# frontend dependencies:
|
# frontend dependencies:
|
||||||
# stage: setup
|
# stage: setup
|
||||||
# cache:
|
# cache:
|
||||||
|
|||||||
Reference in New Issue
Block a user