chore(gitlab-ci): cleanup; move before_script to default

This commit is contained in:
Sarah Vaupel 2024-07-08 12:12:15 +02:00
parent 89d9018bc4
commit a6db39c056

View File

@ -12,11 +12,13 @@
default:
image:
name: registry.uniworx.de/fradrive/fradrive/fradrive-env:latest # bookworm # registry.uniworx.de/uniworx/containers/nix-attic:latest
name: registry.uniworx.de/fradrive/fradrive/fradrive-env:latest # bookworm
entrypoint: [""]
docker:
platform: x86_64
user: fradrive-env
before_script:
- chown -R ${ENV_USER} . #
variables:
NIX_PATH: "nixpkgs=http://nixos.org/channels/nixos-23.11/nixexprs.tar.xz"
@ -51,20 +53,7 @@ node modules:
- .npm
- node_modules
script:
- make .npmrc # TODO: debug
- cat .npmrc # TODO: debug
- make node_modules
before_script: &nix-before
- chown -R ${ENV_USER} .
# - git config --global init.defaultBranch master
# - install -v -m 0700 -d ~/.ssh
# - install -v -T -m 0644 "${SSH_KNOWN_HOSTS}" ~/.ssh/known_hosts
# - install -v -T -m 0400 "${SSH_DEPLOY_KEY}" ~/.ssh/deploy && echo "IdentityFile ~/.ssh/deploy" >> ~/.ssh/config;
# - install -v -T -m 0644 "${FONTAWESOME_NPM_AUTH_FILE}" /etc/fontawesome-token
# - echo ${FONTAWESOME_NPM_AUTH_TOKEN} # TODO: debug
# - echo ${FONTAWESOME_NPM_AUTH_TOKEN} > .npmrc
# - cat .npmrc # TODO: debug
# - install -v -T -m 0644 "${NIX_NETRC}" /etc/nix/netrc
artifacts:
paths:
- node_modules/
@ -79,7 +68,6 @@ well-known:
stage: setup
script:
- make well-known
before_script: *nix-before
needs:
- job: node modules
artifacts: true
@ -107,7 +95,6 @@ backend dependencies:
script:
- echo ${LC_ALL} ${LANG}
- make backend-dependencies-prod
before_script: *nix-before
artifacts:
paths:
- .stack
@ -121,7 +108,6 @@ frontend lint:
stage: lint
script:
- make frontend-lint
before_script: *nix-before
cache:
- *frontend-cache
needs:
@ -138,7 +124,6 @@ backend lint:
- *stack-cache
script:
- make backend-lint-prod
before_script: *nix-before
needs:
- job: backend dependencies
artifacts: true
@ -152,7 +137,6 @@ frontend build:
- *frontend-cache
script:
- make frontend-build
before_script: *nix-before
needs:
- job: node modules
artifacts: true
@ -178,7 +162,6 @@ backend build:
- make bin/uniworx
- cp $(stack path --dist-dir)/build/hlint/hlint bin/test-hlint
- cp $(stack path --dist-dir)/build/yesod/yesod bin/test-yesod
before_script: *nix-before
needs:
- job: node modules # transitive
artifacts: false
@ -205,7 +188,6 @@ uniworxdb:
stage: build
script:
- make bin/uniworxdb
before_script: *nix-before
needs:
- job: node modules # transitive
artifacts: false
@ -225,7 +207,6 @@ uniworx:exe:uniworxload:
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
- nix -L build -o result ".#uniworx:exe:uniworxload"
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxload.nar.xz
before_script: *nix-before
needs:
- job: node modules # transitive
artifacts: false
@ -246,7 +227,6 @@ uniworx:exe:uniworxload:
# - xzcat frontend.nar.xz | nix-store --import
# - xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
# - nix -L flake check .
# before_script: *nix-before
# needs:
# - job: node modules # transitive
# artifacts: false
@ -259,7 +239,6 @@ frontend test:
stage: test
script:
- make frontend-test
before_script: *nix-before
cache: *frontend-cache
needs:
- job: node modules
@ -271,7 +250,6 @@ backend test:
stage: test
script:
- "nix shell .#gnumake .#stack --command make backend-test"
before_script: *nix-before
cache: *stack-cache
needs:
- job: backend dependencies
@ -285,7 +263,6 @@ container:
script:
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxDocker") uniworx.tar.gz
before_script: *nix-before
needs:
- job: node modules # transitive
artifacts: false
@ -309,7 +286,6 @@ test container:
script:
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxTestDocker") uniworx.tar.gz
before_script: *nix-before
needs:
- job: node modules # transitive
artifacts: false
@ -335,7 +311,6 @@ parse changelog:
- job: node modules
artifacts: true
rules: *release-rules
before_script: *nix-before
script:
- xzcat node-dependencies.nar.xz | nix-store --import
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].version' > .current-version
@ -357,7 +332,6 @@ parse test changelog:
- job: node modules
artifacts: true
rules: *test-release-rules
before_script: *nix-before
script:
- xzcat node-dependencies.nar.xz | nix-store --import
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].version' > .current-version