60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
stages:
|
|
- build
|
|
- package
|
|
|
|
build_backend:
|
|
stage: build
|
|
image: reg.gitlab.mattv.de/root/docker-images/ubuntu_build_base:latest
|
|
cache:
|
|
key: backend
|
|
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
|
|
|
|
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
|
|
before_script: []
|
|
needs:
|
|
- job: build_backend
|
|
artifacts: true
|
|
- job: test_and_build_frontend
|
|
artifacts: true
|
|
script:
|
|
- mkdir static
|
|
- mv frontend/dist/* static/
|
|
artifacts:
|
|
paths:
|
|
- server
|
|
- static/
|