chore(gitlab-ci): disable (comment-out) previous ci defs

This commit is contained in:
Sarah Vaupel 2024-08-19 02:13:13 +02:00
parent 2356ff4b53
commit 93cbea6bd9

View File

@ -15,12 +15,6 @@ variables:
AWS_SHARED_CREDENTIALS_FILE: "/etc/aws/credentials" AWS_SHARED_CREDENTIALS_FILE: "/etc/aws/credentials"
TRANSFER_METER_FREQUENCY: "2s" TRANSFER_METER_FREQUENCY: "2s"
# Docker
ENV_USER: fradrive-env
# Backend
STACK_ROOT: "${CI_PROJECT_DIR}/.stack"
default: default:
image: image:
@ -39,32 +33,32 @@ default:
interruptible: true interruptible: true
# TODO: Rethink and reintroduce stages stages:
# stages: - build images
# - setup - compile
# - build - lint
# - lint - test
# - test - push images
# - container - release # TODO
# - prepare release
# - release
frontend image: frontend image:
stage: build images
script: script:
# TODO: define make target for this # TODO: define make target for this?
- make -- --docker-build-frontend-build FRADRIVE_DOCKERFILE=frontend - make -- --docker-build-frontend-build FRADRIVE_SERVICE=frontend
- docker image save frontend | gzip > docker/frontend/image.tar.gz - docker image save frontend | gzip > docker/frontend/image.tar.gz
artifacts: artifacts:
paths: paths:
- docker/frontend/image.tar.gz - docker/frontend/image.tar.gz
frontend build: frontend build:
stage: compile
needs: needs:
- job: frontend image - job: frontend image
artifacts: true artifacts: true
script: script:
- zcat docker/frontend/image.tar.gz | docker image load - &load-frontend-image zcat docker/frontend/image.tar.gz | docker image load
- docker run --rm -it -v ${CI_PROJECT_DIR}:/fradrive --env FRADRIVE_MAKE_TARGET=frontend-build frontend # TODO: define new make target or make current target compatible - make -- --docker-run-frontend-build FRADRIVE_SERVICE=frontend
artifacts: artifacts:
paths: paths:
- /fradrive/node_modules - /fradrive/node_modules
@ -77,25 +71,41 @@ frontend build:
- /fradrive/.well-known-cache/ - /fradrive/.well-known-cache/
frontend lint: frontend lint:
stage: lint
needs: needs:
- job: frontend image - job: frontend image
artifacts: true artifacts: true
script:
- *load-frontend-image
- make -- --docker-run-frontend-lint FRADRIVE_SERVICE=frontend
cache: *frontend-cache
frontend test: frontend test:
stage: test
needs: needs:
- job: frontend image - job: frontend image
artifacts: true artifacts: true
- job: frontend build - job: frontend build
artifacts: true artifacts: true
script:
- *load-frontend-image
- make -- --docker-run-frontend-test FRADRIVE_SERVICE=frontend
push image(s): cache: *frontend-cache
push frontend image:
stage: push images
needs: needs:
- job: frontend image - job: frontend image
artifacts: true artifacts: true
- job: frontend build
artifacts: false
- job: frontend test
artifacts: false
script: script:
- docker load ... - *load-frontend-image
- docker tag ... # - docker image tag
- docker push ... - docker push frontend
# frontend dependencies: # frontend dependencies:
# stage: setup # stage: setup
@ -144,304 +154,304 @@ push image(s):
# - .stack/ # - .stack/
# - .stack-work/ # - .stack-work/
frontend build: # frontend build:
stage: build
cache:
- *frontend-cache
script:
- make frontend-build
needs:
- job: frontend dependencies
artifacts: true
- job: well-known
artifacts: true
artifacts:
paths:
- static/
- config/webpack.yml
# TODO: .stack-work cache not working
backend build:
stage: build
cache:
- *stack-cache
script:
- make bin/uniworx
# - find .stack-work
# - cp $(stack path --dist-dir)/build/hlint/hlint bin/test-hlint
# - cp $(stack path --dist-dir)/build/yesod/yesod bin/test-yesod
needs:
- job: frontend dependencies # transitive
artifacts: false
- job: well-known
artifacts: true
- job: backend dependencies
artifacts: true
- job: frontend build
artifacts: true
artifacts:
paths:
- bin/
resource_group: ram
# TODO: part of backend build; probably deprecated
# uniworxdb:
# stage: build # stage: build
# cache:
# - *frontend-cache
# script: # script:
# - make bin/uniworxdb # - make frontend-build
# needs: # needs:
# # TODO: no frontend needed # - job: frontend dependencies
# - job: frontend dependencies # transitive # artifacts: true
# artifacts: false # - job: well-known
# - job: frontend build # transitive # artifacts: true
# artifacts: false
# artifacts: # artifacts:
# paths: # paths:
# - bin/uniworxdb # - static/
# - config/webpack.yml
# TODO: part of backend build; probably deprecated # # TODO: .stack-work cache not working
# TODO: rewrite # backend build:
# uniworx:exe:uniworxload:
# stage: build # stage: build
# cache:
# - *stack-cache
# script: # script:
# - xzcat uniworx:lib:uniworx.nar.xz | nix-store --import # - make bin/uniworx
# - nix -L build -o result ".#uniworx:exe:uniworxload" # # - find .stack-work
# - nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxload.nar.xz # # - cp $(stack path --dist-dir)/build/hlint/hlint bin/test-hlint
# # - cp $(stack path --dist-dir)/build/yesod/yesod bin/test-yesod
# needs:
# - job: frontend dependencies # transitive
# artifacts: false
# - job: well-known
# artifacts: true
# - job: backend dependencies
# artifacts: true
# - job: frontend build
# artifacts: true
# artifacts:
# paths:
# - bin/
# resource_group: ram
# # TODO: part of backend build; probably deprecated
# # uniworxdb:
# # stage: build
# # script:
# # - make bin/uniworxdb
# # needs:
# # # TODO: no frontend needed
# # - job: frontend dependencies # transitive
# # artifacts: false
# # - job: frontend build # transitive
# # artifacts: false
# # artifacts:
# # paths:
# # - bin/uniworxdb
# # TODO: part of backend build; probably deprecated
# # TODO: rewrite
# # uniworx:exe:uniworxload:
# # stage: build
# # script:
# # - 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
# # needs:
# # - job: frontend dependencies # transitive
# # artifacts: false
# # - job: frontend build # transitive
# # artifacts: false
# # artifacts:
# # paths:
# # - uniworx:exe:uniworxload.nar.xz
# frontend lint:
# stage: lint
# script:
# - make frontend-lint
# cache:
# - *frontend-cache
# needs:
# - job: frontend dependencies
# artifacts: true
# - job: well-known # TODO: is this really needed?
# artifacts: true
# backend lint:
# stage: lint
# cache:
# - *stack-cache
# script:
# # TODO: - make backend-lint-dev
# - make backend-lint-prod
# needs:
# - job: backend dependencies
# artifacts: true
# - job: backend build
# artifacts: true
# - job: frontend build
# artifacts: true
# - job: well-known
# artifacts: true
# frontend test:
# stage: test
# script:
# - make frontend-test
# cache: *frontend-cache
# needs:
# - job: frontend dependencies
# artifacts: true
# # TODO: configure report artifacts
# backend test:
# stage: test
# script:
# - make backend-test-prod
# cache: *stack-cache
# needs:
# - job: well-known
# artifacts: true
# - job: frontend build
# artifacts: true
# - job: backend dependencies
# artifacts: true
# - job: backend build
# artifacts: true
# # TODO: configure report artifacts
# # TODO: unify prod and test versions
# # TODO: rewrite
# container:
# stage: 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
# needs: # needs:
# - job: frontend dependencies # transitive # - job: frontend dependencies # transitive
# artifacts: false # artifacts: false
# - job: frontend build # transitive # - job: frontend build # transitive
# artifacts: false # artifacts: false
# - job: frontend test # sanity
# artifacts: false
# - job: backend test # sanity
# artifacts: false
# artifacts: # artifacts:
# paths: # paths:
# - uniworx:exe:uniworxload.nar.xz # - uniworx.tar.gz
# rules: &release-rules
# - if: $CI_COMMIT_TAG =~ /^v/
# # TODO: rewrite
# test container:
# stage: 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
# needs:
# - job: frontend dependencies # transitive
# artifacts: false
# - job: frontend build # transitive
# artifacts: false
# - job: frontend test # sanity
# artifacts: false
# - job: backend test # sanity
# artifacts: false
# artifacts:
# paths:
# - uniworx.tar.gz
# rules: &test-release-rules
# - if: $CI_COMMIT_TAG =~ /^t/
frontend lint: # # TODO: unify prod and test versions
stage: lint # # TODO: rewrite
script: # parse changelog:
- make frontend-lint # stage: prepare release
cache: # needs:
- *frontend-cache # - job: frontend dependencies
needs: # artifacts: true
- job: frontend dependencies # rules: *release-rules
artifacts: true # script:
- job: well-known # TODO: is this really needed? # - xzcat node-dependencies.nar.xz | nix-store --import
artifacts: true # - nix -L run ".#jqChangelogJson" -- -r '.versions[0].version' > .current-version
# - nix -L run ".#jqChangelogJson" -- -r '.versions[0].body' > .current-changelog.md
# - echo "VERSION=$(cat .current-version)" >> build.env
# artifacts:
# reports:
# dotenv: build.env
# paths:
# - .current-version
# - .current-changelog.md
# name: "changelog-${CI_COMMIT_SHORT_SHA}"
# expire_in: "1 day"
# # TODO: rewrite
# parse test changelog:
# stage: prepare release
# needs:
# - job: frontend dependencies
# artifacts: true
# rules: *test-release-rules
# script:
# - xzcat node-dependencies.nar.xz | nix-store --import
# - nix -L run ".#jqChangelogJson" -- -r '.versions[0].version' > .current-version
# - nix -L run ".#jqChangelogJson" -- -r '.versions[0].body' > .current-changelog.md
# - echo "VERSION=$(cat .current-version)" >> build.env
# artifacts:
# reports:
# dotenv: build.env
# paths:
# - .current-version
# - .current-changelog.md
# name: "changelog-${CI_COMMIT_SHORT_SHA}"
backend lint: # # TODO: unify prod and test versions
stage: lint # # TODO: rewrite
cache: # upload container:
- *stack-cache # variables:
script: # GIT_STRATEGY: none
# TODO: - make backend-lint-dev # stage: release
- make backend-lint-prod # image: quay.io/skopeo/stable:latest
needs: # script:
- job: backend dependencies # - skopeo --insecure-policy copy --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker-archive://$(pwd)/uniworx.tar.gz docker://${CI_REGISTRY_IMAGE}:${VERSION}
artifacts: true # - 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
- job: backend build # needs:
artifacts: true # - job: frontend dependencies # transitive
- job: frontend build # artifacts: false
artifacts: true # - job: frontend build # transitive
- job: well-known # artifacts: false
artifacts: true # - job: container
# artifacts: true
# - job: parse changelog
# artifacts: true
# - job: frontend test # sanity
# artifacts: false
# - job: backend test # sanity
# artifacts: false
# rules: *release-rules
# # TODO: rewrite
# upload test container:
# variables:
# GIT_STRATEGY: none
# stage: release
# image: quay.io/skopeo/stable:latest
# script:
# - 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: frontend dependencies # transitive
# artifacts: false
# - job: frontend build # transitive
# artifacts: false
# - job: test container
# artifacts: true
# - job: parse test changelog
# artifacts: true
# - job: frontend test # sanity
# artifacts: false
# - job: backend test # sanity
# artifacts: false
# rules: *test-release-rules
frontend test: # # TODO: unify prod and test versions
stage: test # # TODO: rewrite
script: # release:
- make frontend-test # variables:
cache: *frontend-cache # GIT_STRATEGY: none
needs: # stage: release
- job: frontend dependencies # image: registry.gitlab.com/gitlab-org/release-cli:latest
artifacts: true # rules: *release-rules
# TODO: configure report artifacts # script:
# - echo "Will create release ${VERSION}..."
backend test: # release:
stage: test # name: '$VERSION'
script: # tag_name: '$CI_COMMIT_TAG'
- make backend-test-prod # description: .current-changelog.md
cache: *stack-cache # needs:
needs: # - job: frontend test # sanity
- job: well-known # artifacts: false
artifacts: true # - job: backend test # sanity
- job: frontend build # artifacts: false
artifacts: true # - job: parse changelog
- job: backend dependencies # artifacts: true
artifacts: true # retry: 0
- job: backend build # # TODO: rewrite
artifacts: true # test release:
# TODO: configure report artifacts # variables:
# GIT_STRATEGY: none
# TODO: unify prod and test versions # stage: release
# TODO: rewrite # image: registry.gitlab.com/gitlab-org/release-cli:latest
container: # rules: *test-release-rules
stage: container # script:
script: # - echo "Will create test release ${VERSION}-test..."
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import # release:
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxDocker") uniworx.tar.gz # name: "${VERSION}-test"
needs: # tag_name: '$CI_COMMIT_TAG'
- job: frontend dependencies # transitive # description: .current-changelog.md
artifacts: false # needs:
- job: frontend build # transitive # - job: frontend test # sanity
artifacts: false # artifacts: false
- job: frontend test # sanity # - job: backend test # sanity
artifacts: false # artifacts: false
- job: backend test # sanity # - job: parse test changelog
artifacts: false # artifacts: true
artifacts: # retry: 0
paths:
- uniworx.tar.gz
rules: &release-rules
- if: $CI_COMMIT_TAG =~ /^v/
# TODO: rewrite
test container:
stage: 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
needs:
- job: frontend dependencies # transitive
artifacts: false
- job: frontend build # transitive
artifacts: false
- job: frontend test # sanity
artifacts: false
- job: backend test # sanity
artifacts: false
artifacts:
paths:
- uniworx.tar.gz
rules: &test-release-rules
- if: $CI_COMMIT_TAG =~ /^t/
# TODO: unify prod and test versions
# TODO: rewrite
parse changelog:
stage: prepare release
needs:
- job: frontend dependencies
artifacts: true
rules: *release-rules
script:
- xzcat node-dependencies.nar.xz | nix-store --import
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].version' > .current-version
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].body' > .current-changelog.md
- echo "VERSION=$(cat .current-version)" >> build.env
artifacts:
reports:
dotenv: build.env
paths:
- .current-version
- .current-changelog.md
name: "changelog-${CI_COMMIT_SHORT_SHA}"
expire_in: "1 day"
# TODO: rewrite
parse test changelog:
stage: prepare release
needs:
- job: frontend dependencies
artifacts: true
rules: *test-release-rules
script:
- xzcat node-dependencies.nar.xz | nix-store --import
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].version' > .current-version
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].body' > .current-changelog.md
- echo "VERSION=$(cat .current-version)" >> build.env
artifacts:
reports:
dotenv: build.env
paths:
- .current-version
- .current-changelog.md
name: "changelog-${CI_COMMIT_SHORT_SHA}"
# TODO: unify prod and test versions
# TODO: rewrite
upload container:
variables:
GIT_STRATEGY: none
stage: release
image: quay.io/skopeo/stable:latest
script:
- 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: frontend dependencies # transitive
artifacts: false
- job: frontend build # transitive
artifacts: false
- job: container
artifacts: true
- job: parse changelog
artifacts: true
- job: frontend test # sanity
artifacts: false
- job: backend test # sanity
artifacts: false
rules: *release-rules
# TODO: rewrite
upload test container:
variables:
GIT_STRATEGY: none
stage: release
image: quay.io/skopeo/stable:latest
script:
- 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: frontend dependencies # transitive
artifacts: false
- job: frontend build # transitive
artifacts: false
- job: test container
artifacts: true
- job: parse test changelog
artifacts: true
- job: frontend test # sanity
artifacts: false
- job: backend test # sanity
artifacts: false
rules: *test-release-rules
# TODO: unify prod and test versions
# TODO: rewrite
release:
variables:
GIT_STRATEGY: none
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules: *release-rules
script:
- echo "Will create release ${VERSION}..."
release:
name: '$VERSION'
tag_name: '$CI_COMMIT_TAG'
description: .current-changelog.md
needs:
- job: frontend test # sanity
artifacts: false
- job: backend test # sanity
artifacts: false
- job: parse changelog
artifacts: true
retry: 0
# TODO: rewrite
test release:
variables:
GIT_STRATEGY: none
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules: *test-release-rules
script:
- echo "Will create test release ${VERSION}-test..."
release:
name: "${VERSION}-test"
tag_name: '$CI_COMMIT_TAG'
description: .current-changelog.md
needs:
- job: frontend test # sanity
artifacts: false
- job: backend test # sanity
artifacts: false
- job: parse test changelog
artifacts: true
retry: 0