chore(gitlab-ci): more cleanup

This commit is contained in:
Sarah Vaupel 2024-07-08 12:23:49 +02:00
parent a6db39c056
commit 46a46b9b13

View File

@ -10,29 +10,28 @@
# - if: $CI_COMMIT_TAG =~ /^t/
# - if: $CI_COMMIT_TAG =~ /^d/
variables:
# TODO: old vars; review and maybe remove
AWS_SHARED_CREDENTIALS_FILE: "/etc/aws/credentials"
TRANSFER_METER_FREQUENCY: "2s"
# docker
ENV_USER: "fradrive-env"
# backend
STACK_ROOT: "${CI_PROJECT_DIR}/.stack"
default:
image:
name: registry.uniworx.de/fradrive/fradrive/fradrive-env:latest # bookworm
entrypoint: [""]
docker:
platform: x86_64
user: fradrive-env
user: ${ENV_USER}
before_script:
- chown -R ${ENV_USER} . #
- chown -R ${ENV_USER} . # change project directory ownership to (non-root) user inside docker container
variables:
NIX_PATH: "nixpkgs=http://nixos.org/channels/nixos-23.11/nixexprs.tar.xz"
AWS_SHARED_CREDENTIALS_FILE: "/etc/aws/credentials"
TRANSFER_METER_FREQUENCY: "2s"
NIX_CONFIG: |-
extra-substituters = https://cache.iog.io
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
STACK_ROOT: "${CI_PROJECT_DIR}/.stack"
ENV_USER: "fradrive-env"
stages:
- setup
@ -43,8 +42,9 @@ stages:
- prepare release
- release
# TODO: rename to "frontend dependencies"
node modules:
frontend dependencies:
stage: setup
cache:
- &npm-cache
@ -69,7 +69,7 @@ well-known:
script:
- make well-known
needs:
- job: node modules
- job: frontend dependencies
artifacts: true
cache:
- &frontend-cache
@ -93,7 +93,6 @@ backend dependencies:
paths:
- .stack
script:
- echo ${LC_ALL} ${LANG}
- make backend-dependencies-prod
artifacts:
paths:
@ -111,7 +110,7 @@ frontend lint:
cache:
- *frontend-cache
needs:
- job: node modules
- job: frontend dependencies
artifacts: true
- job: well-known
artifacts: true
@ -138,7 +137,7 @@ frontend build:
script:
- make frontend-build
needs:
- job: node modules
- job: frontend dependencies
artifacts: true
- job: well-known
artifacts: true
@ -163,7 +162,7 @@ backend build:
- cp $(stack path --dist-dir)/build/hlint/hlint bin/test-hlint
- cp $(stack path --dist-dir)/build/yesod/yesod bin/test-yesod
needs:
- job: node modules # transitive
- job: frontend dependencies # transitive
artifacts: false
- job: well-known
artifacts: true
@ -189,7 +188,7 @@ uniworxdb:
script:
- make bin/uniworxdb
needs:
- job: node modules # transitive
- job: frontend dependencies # transitive
artifacts: false
- job: frontend build # transitive
artifacts: false
@ -208,7 +207,7 @@ uniworx:exe:uniworxload:
- nix -L build -o result ".#uniworx:exe:uniworxload"
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxload.nar.xz
needs:
- job: node modules # transitive
- job: frontend dependencies # transitive
artifacts: false
- job: frontend build # transitive
artifacts: false
@ -228,7 +227,7 @@ uniworx:exe:uniworxload:
# - xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
# - nix -L flake check .
# needs:
# - job: node modules # transitive
# - job: frontend dependencies # transitive
# artifacts: false
# - job: frontend build
# artifacts: true
@ -241,7 +240,7 @@ frontend test:
- make frontend-test
cache: *frontend-cache
needs:
- job: node modules
- job: frontend dependencies
artifacts: true
retry: 2
interruptible: true
@ -264,7 +263,7 @@ container:
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxDocker") uniworx.tar.gz
needs:
- job: node modules # transitive
- job: frontend dependencies # transitive
artifacts: false
- job: frontend build # transitive
artifacts: false
@ -287,7 +286,7 @@ test container:
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxTestDocker") uniworx.tar.gz
needs:
- job: node modules # transitive
- job: frontend dependencies # transitive
artifacts: false
- job: frontend build # transitive
artifacts: false
@ -308,7 +307,7 @@ test container:
parse changelog:
stage: prepare release
needs:
- job: node modules
- job: frontend dependencies
artifacts: true
rules: *release-rules
script:
@ -329,7 +328,7 @@ parse changelog:
parse test changelog:
stage: prepare release
needs:
- job: node modules
- job: frontend dependencies
artifacts: true
rules: *test-release-rules
script:
@ -357,7 +356,7 @@ upload container:
- skopeo --insecure-policy copy --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker-archive://$(pwd)/uniworx.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
needs:
- job: node modules # transitive
- job: frontend dependencies # transitive
artifacts: false
- job: frontend build # transitive
artifacts: false
@ -380,7 +379,7 @@ upload test container:
- skopeo --insecure-policy copy --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker-archive://$(pwd)/uniworx.tar.gz docker://${CI_REGISTRY}/fradrive/fradrive/test:${CI_COMMIT_REF_NAME}
- skopeo --insecure-policy copy --src-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker://${CI_REGISTRY}/fradrive/fradrive/test:${CI_COMMIT_REF_NAME} docker://${CI_REGISTRY}/fradrive/fradrive/test:latest
needs:
- job: node modules # transitive
- job: frontend dependencies # transitive
artifacts: false
- job: frontend build # transitive
artifacts: false