From 31f8b11201281084ce505c630076d8f663359780 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 13 Oct 2022 20:55:08 +0200 Subject: [PATCH] Updated ci --- .gitlab-ci.yml | 65 +++-------------------------------------- backend/.gitlab-ci.yml | 21 +++++++++++++ frontend/.gitlab-ci.yml | 16 ++++++++++ 3 files changed, 41 insertions(+), 61 deletions(-) create mode 100644 backend/.gitlab-ci.yml create mode 100644 frontend/.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2cad9a7..6a4d170 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,69 +1,12 @@ +include: + - local: '/backend/.gitlab-ci.yml' + - local: '/frontend/.gitlab-ci.yml' + stages: - build - package - release -build_backend_glibc: - stage: build - image: reg.gitlab.mattv.de/root/docker-images/ubuntu_build_base:latest - cache: - key: backend_glibc - paths: - - vcpkg_cache - script: - - SRC="$PWD" - - TMP=$(mktemp -d) - - cd $TMP - - git clone https://github.com/Microsoft/vcpkg.git . - - ./bootstrap-vcpkg.sh -disableMetrics - - cd $SRC - - mkdir -p vcpkg_cache - - VCPKG_DEFAULT_BINARY_CACHE=$SRC/vcpkg_cache cmake -B build -S backend -DCMAKE_TOOLCHAIN_FILE=$TMP/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release - - cmake --build build - - cp build/backend server - artifacts: - paths: - - server - -build_backend_muslc: - stage: build - image: reg.gitlab.mattv.de/root/docker-images/alpine_build_base:latest - cache: - key: backend_muslc - paths: - - vcpkg_cache - script: - - SRC="$PWD" - - TMP=$(mktemp -d) - - cd $TMP - - git clone https://github.com/Microsoft/vcpkg.git . - - ./bootstrap-vcpkg.sh -disableMetrics - - cd $SRC - - mkdir -p vcpkg_cache - - VCPKG_FORCE_SYSTEM_BINARIES=1 VCPKG_DEFAULT_BINARY_CACHE=$SRC/vcpkg_cache cmake -B build -S backend -DCMAKE_TOOLCHAIN_FILE=$TMP/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release - - cmake --build build - - cp build/backend server - artifacts: - paths: - - server - -test_and_build_frontend: - image: node:latest - stage: build - cache: - key: frontend - paths: - - frontend/.yarn - - frontend/node_modules - script: - - cd frontend - - yarn install --cache-folder .yarn --frozen-lockfile - - yarn lint - - yarn build - artifacts: - paths: - - frontend/dist/ - .package_server: image: alpine:latest stage: package diff --git a/backend/.gitlab-ci.yml b/backend/.gitlab-ci.yml new file mode 100644 index 0000000..8e5dba0 --- /dev/null +++ b/backend/.gitlab-ci.yml @@ -0,0 +1,21 @@ +build_backend_glibc: + stage: build + image: rust:bullseye + script: + - cd backend + - cargo build --release + - cp target/release/backend_rust ../server + artifacts: + paths: + - server + +build_backend_muslc: + stage: build + image: rust:alpine + script: + - cd backend + - cargo build --release + - cp target/release/backend_rust ../server + artifacts: + paths: + - server diff --git a/frontend/.gitlab-ci.yml b/frontend/.gitlab-ci.yml new file mode 100644 index 0000000..7632836 --- /dev/null +++ b/frontend/.gitlab-ci.yml @@ -0,0 +1,16 @@ +test_and_build_frontend: + image: node:latest + stage: build + cache: + key: frontend + paths: + - frontend/.yarn + - frontend/node_modules + script: + - cd frontend + - yarn install --cache-folder .yarn --frozen-lockfile + - yarn lint + - yarn build + artifacts: + paths: + - frontend/dist/