Updated ci

This commit is contained in:
Mutzi 2022-10-13 20:55:08 +02:00
parent c10964fdc7
commit 31f8b11201
3 changed files with 41 additions and 61 deletions

View File

@ -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

21
backend/.gitlab-ci.yml Normal file
View File

@ -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

16
frontend/.gitlab-ci.yml Normal file
View File

@ -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/