chore(gitlab-ci): use make in pipeline
This commit is contained in:
parent
9c0c013b97
commit
16fa964893
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,6 +34,7 @@ test.log
|
|||||||
*.dump-splices
|
*.dump-splices
|
||||||
/.stack-work.lock
|
/.stack-work.lock
|
||||||
/.npmrc
|
/.npmrc
|
||||||
|
/.npm/
|
||||||
/config/webpack.yml
|
/config/webpack.yml
|
||||||
tunnel.log
|
tunnel.log
|
||||||
/static
|
/static
|
||||||
|
|||||||
204
.gitlab-ci.yml
204
.gitlab-ci.yml
@ -1,4 +1,4 @@
|
|||||||
# SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor@kleen.consulting>
|
# SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor@kleen.consulting>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
@ -8,13 +8,14 @@
|
|||||||
# - if: $CI_MERGE_REQUEST_ID
|
# - if: $CI_MERGE_REQUEST_ID
|
||||||
# - if: $CI_COMMIT_TAG =~ /^v/
|
# - if: $CI_COMMIT_TAG =~ /^v/
|
||||||
# - if: $CI_COMMIT_TAG =~ /^t/
|
# - if: $CI_COMMIT_TAG =~ /^t/
|
||||||
|
# - if: $CI_COMMIT_TAG =~ /^d/
|
||||||
|
|
||||||
default:
|
default:
|
||||||
image:
|
image:
|
||||||
name: registry.uniworx.de/uniworx/containers/nix-attic:latest
|
name: registry.uniworx.de/uniworx/containers/nix-attic:latest
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
NIX_PATH: "nixpkgs=http://nixos.org/channels/nixos-21.05/nixexprs.tar.xz"
|
NIX_PATH: "nixpkgs=http://nixos.org/channels/nixos-23.11/nixexprs.tar.xz"
|
||||||
AWS_SHARED_CREDENTIALS_FILE: "/etc/aws/credentials"
|
AWS_SHARED_CREDENTIALS_FILE: "/etc/aws/credentials"
|
||||||
|
|
||||||
TRANSFER_METER_FREQUENCY: "2s"
|
TRANSFER_METER_FREQUENCY: "2s"
|
||||||
@ -24,18 +25,24 @@ variables:
|
|||||||
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
|
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- frontend:build
|
- setup
|
||||||
- backend:build
|
- lint
|
||||||
|
- build
|
||||||
- test
|
- test
|
||||||
- container:build
|
- container
|
||||||
- prepare release
|
- prepare release
|
||||||
- release
|
- release
|
||||||
|
|
||||||
node dependencies:
|
node modules:
|
||||||
stage: frontend:build
|
stage: setup
|
||||||
|
cache:
|
||||||
|
- &npm-cache
|
||||||
|
key: default-npm
|
||||||
|
paths:
|
||||||
|
- .npm
|
||||||
|
- node_modules
|
||||||
script:
|
script:
|
||||||
- nix -L build -o result ".#uniworxNodeDependencies"
|
- "nix shell .#gnumake .#gup .#nodejs_21 --command make node_modules"
|
||||||
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > node-dependencies.nar.xz
|
|
||||||
before_script: &nix-before
|
before_script: &nix-before
|
||||||
- git config --global init.defaultBranch master
|
- git config --global init.defaultBranch master
|
||||||
- install -v -m 0700 -d ~/.ssh
|
- install -v -m 0700 -d ~/.ssh
|
||||||
@ -45,113 +52,100 @@ node dependencies:
|
|||||||
- install -v -T -m 0644 "${NIX_NETRC}" /etc/nix/netrc
|
- install -v -T -m 0644 "${NIX_NETRC}" /etc/nix/netrc
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- node-dependencies.nar.xz
|
- node_modules/
|
||||||
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
|
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
|
||||||
expire_in: "1 day"
|
expire_in: "1 day"
|
||||||
retry: 2
|
retry: 2
|
||||||
interruptible: true
|
interruptible: true
|
||||||
|
|
||||||
well known:
|
frontend lint:
|
||||||
stage: frontend:build
|
stage: lint
|
||||||
script:
|
script:
|
||||||
- xzcat node-dependencies.nar.xz | nix-store --import
|
- "nix shell .#gnumake .#gup .#nodejs_21 --command make frontend-lint"
|
||||||
- nix -L build -o result ".#uniworxWellKnown"
|
|
||||||
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > well-known.nar.xz
|
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
needs:
|
needs:
|
||||||
- job: node dependencies
|
- job: node modules
|
||||||
artifacts: true
|
artifacts: true
|
||||||
|
retry: 2
|
||||||
|
interruptible: true
|
||||||
|
|
||||||
|
frontend build:
|
||||||
|
stage: build
|
||||||
|
cache:
|
||||||
|
- &frontend-cache
|
||||||
|
key: default-frontend
|
||||||
|
paths:
|
||||||
|
- .well-known-cache
|
||||||
|
script:
|
||||||
|
- "nix shell .#gnumake .#gup .#nodejs_21 --command make frontend-build"
|
||||||
|
before_script: *nix-before
|
||||||
|
needs:
|
||||||
|
- job: node modules
|
||||||
|
artifacts: true
|
||||||
|
- job: frontend lint # pipeline performance
|
||||||
|
artifacts: false
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- well-known.nar.xz
|
- static/
|
||||||
|
- well-known/
|
||||||
|
- config/webpack.yml
|
||||||
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
|
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
|
||||||
expire_in: "1 day"
|
expire_in: "1 day"
|
||||||
retry: 2
|
retry: 2
|
||||||
interruptible: true
|
interruptible: true
|
||||||
|
|
||||||
frontend:
|
backend lint:
|
||||||
stage: frontend:build
|
stage: lint
|
||||||
script:
|
script:
|
||||||
- xzcat node-dependencies.nar.xz | nix-store --import
|
- "nix shell .#gnumake .#coreutils .#stack --command make CI=1 backend-lint"
|
||||||
- xzcat well-known.nar.xz | nix-store --import
|
|
||||||
- nix -L build -o result ".#uniworxFrontend"
|
|
||||||
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > frontend.nar.xz
|
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
needs:
|
|
||||||
- job: node dependencies
|
|
||||||
artifacts: true
|
|
||||||
- job: well known
|
|
||||||
artifacts: true
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- frontend.nar.xz
|
|
||||||
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
|
|
||||||
expire_in: "1 day"
|
|
||||||
retry: 2
|
retry: 2
|
||||||
interruptible: true
|
interruptible: true
|
||||||
|
|
||||||
uniworx:lib:uniworx:
|
backend build:
|
||||||
stage: backend:build
|
stage: build
|
||||||
script:
|
cache:
|
||||||
- xzcat frontend.nar.xz | nix-store --import
|
- &stack-cache
|
||||||
- nix -L build -o result ".#uniworx:lib:uniworx"
|
key: default-stack
|
||||||
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:lib:uniworx.nar.xz
|
paths:
|
||||||
before_script: *nix-before
|
- .stack/
|
||||||
needs:
|
- .stack-work/
|
||||||
- job: node dependencies # transitive
|
|
||||||
artifacts: false
|
|
||||||
- job: well known # transitive
|
|
||||||
artifacts: false
|
|
||||||
- job: frontend
|
|
||||||
artifacts: true
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- uniworx:lib:uniworx.nar.xz
|
|
||||||
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
|
|
||||||
expire_in: "1 day"
|
|
||||||
retry: 2
|
|
||||||
interruptible: true
|
|
||||||
|
|
||||||
uniworx:exe:uniworx:
|
|
||||||
stage: backend:build
|
|
||||||
script:
|
script:
|
||||||
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
|
- "nix shell .#gnumake .#coreutils .#stack --command make CI=1 backend-build"
|
||||||
- nix -L build -o result ".#uniworx:exe:uniworx"
|
- cp $(stack path --dist-dir)/build/hlint/hlint bin/test-hlint
|
||||||
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworx.nar.xz
|
- cp $(stack path --dist-dir)/build/yesod/yesod bin/test-yesod
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
needs:
|
needs:
|
||||||
- job: node dependencies # transitive
|
- job: node modules # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: well known # transitive
|
- job: frontend lint # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: frontend # tranitive
|
- job: frontend build
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:lib:uniworx
|
|
||||||
artifacts: true
|
artifacts: true
|
||||||
|
- job: backend lint # pipeline performance
|
||||||
|
artifacts: false
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- uniworx:exe:uniworx.nar.xz
|
- bin/
|
||||||
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
|
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
|
||||||
expire_in: "1 day"
|
expire_in: "1 day"
|
||||||
retry: 2
|
retry: 2
|
||||||
interruptible: true
|
interruptible: true
|
||||||
|
resource_group: ram
|
||||||
|
|
||||||
uniworx:exe:uniworxdb:
|
uniworx:exe:uniworxdb:
|
||||||
stage: backend:build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
|
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
|
||||||
- nix -L build -o result ".#uniworx:exe:uniworxdb"
|
- nix -L build -o result ".#uniworx:exe:uniworxdb"
|
||||||
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxdb.nar.xz
|
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxdb.nar.xz
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
needs:
|
needs:
|
||||||
- job: node dependencies # transitive
|
- job: node modules # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: well known # transitive
|
- job: frontend build # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: frontend # tranitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:lib:uniworx
|
|
||||||
artifacts: true
|
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- uniworx:exe:uniworxdb.nar.xz
|
- uniworx:exe:uniworxdb.nar.xz
|
||||||
@ -161,21 +155,17 @@ uniworx:exe:uniworxdb:
|
|||||||
interruptible: true
|
interruptible: true
|
||||||
|
|
||||||
uniworx:exe:uniworxload:
|
uniworx:exe:uniworxload:
|
||||||
stage: backend:build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
|
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
|
||||||
- nix -L build -o result ".#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
|
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxload.nar.xz
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
needs:
|
needs:
|
||||||
- job: node dependencies # transitive
|
- job: node modules # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: well known # transitive
|
- job: frontend build # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: frontend # tranitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:lib:uniworx
|
|
||||||
artifacts: true
|
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- uniworx:exe:uniworxload.nar.xz
|
- uniworx:exe:uniworxload.nar.xz
|
||||||
@ -192,34 +182,24 @@ check:
|
|||||||
- nix -L flake check .
|
- nix -L flake check .
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
needs:
|
needs:
|
||||||
- job: node dependencies # transitive
|
- job: node modules # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: well known # transitive
|
- job: frontend build
|
||||||
artifacts: false
|
|
||||||
- job: frontend
|
|
||||||
artifacts: true
|
|
||||||
- job: uniworx:lib:uniworx
|
|
||||||
artifacts: true
|
artifacts: true
|
||||||
retry: 2
|
retry: 2
|
||||||
interruptible: true
|
interruptible: true
|
||||||
|
|
||||||
container:
|
container:
|
||||||
stage: container:build
|
stage: container
|
||||||
script:
|
script:
|
||||||
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
|
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
|
||||||
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxDocker") uniworx.tar.gz
|
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxDocker") uniworx.tar.gz
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
needs:
|
needs:
|
||||||
- job: node dependencies # transitive
|
- job: node modules # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: well known # transitive
|
- job: frontend build # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: frontend # tranitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:lib:uniworx # transitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:exe:uniworx
|
|
||||||
artifacts: true
|
|
||||||
- job: check # sanity
|
- job: check # sanity
|
||||||
artifacts: false
|
artifacts: false
|
||||||
artifacts:
|
artifacts:
|
||||||
@ -232,22 +212,16 @@ container:
|
|||||||
rules: &release-rules
|
rules: &release-rules
|
||||||
- if: $CI_COMMIT_TAG =~ /^v/
|
- if: $CI_COMMIT_TAG =~ /^v/
|
||||||
test container:
|
test container:
|
||||||
stage: container:build
|
stage: container
|
||||||
script:
|
script:
|
||||||
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
|
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
|
||||||
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxTestDocker") uniworx.tar.gz
|
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxTestDocker") uniworx.tar.gz
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
needs:
|
needs:
|
||||||
- job: node dependencies # transitive
|
- job: node modules # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: well known # transitive
|
- job: frontend build # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: frontend # tranitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:lib:uniworx # transitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:exe:uniworx
|
|
||||||
artifacts: true
|
|
||||||
- job: check # sanity
|
- job: check # sanity
|
||||||
artifacts: false
|
artifacts: false
|
||||||
artifacts:
|
artifacts:
|
||||||
@ -263,7 +237,7 @@ test container:
|
|||||||
parse changelog:
|
parse changelog:
|
||||||
stage: prepare release
|
stage: prepare release
|
||||||
needs:
|
needs:
|
||||||
- job: node dependencies
|
- job: node modules
|
||||||
artifacts: true
|
artifacts: true
|
||||||
rules: *release-rules
|
rules: *release-rules
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
@ -285,7 +259,7 @@ parse changelog:
|
|||||||
parse test changelog:
|
parse test changelog:
|
||||||
stage: prepare release
|
stage: prepare release
|
||||||
needs:
|
needs:
|
||||||
- job: node dependencies
|
- job: node modules
|
||||||
artifacts: true
|
artifacts: true
|
||||||
rules: *test-release-rules
|
rules: *test-release-rules
|
||||||
before_script: *nix-before
|
before_script: *nix-before
|
||||||
@ -314,15 +288,9 @@ 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 --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
|
- 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:
|
needs:
|
||||||
- job: node dependencies # transitive
|
- job: node modules # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: well known # transitive
|
- job: frontend build # transitive
|
||||||
artifacts: false
|
|
||||||
- job: frontend # tranitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:lib:uniworx # transitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:exe:uniworx # transitive
|
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: container
|
- job: container
|
||||||
artifacts: true
|
artifacts: true
|
||||||
@ -341,15 +309,9 @@ 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 --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
|
- 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:
|
needs:
|
||||||
- job: node dependencies # transitive
|
- job: node modules # transitive
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: well known # transitive
|
- job: frontend build # transitive
|
||||||
artifacts: false
|
|
||||||
- job: frontend # tranitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:lib:uniworx # transitive
|
|
||||||
artifacts: false
|
|
||||||
- job: uniworx:exe:uniworx # transitive
|
|
||||||
artifacts: false
|
artifacts: false
|
||||||
- job: test container
|
- job: test container
|
||||||
artifacts: true
|
artifacts: true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user