fileserver/.gitlab-ci.yml

64 lines
1.5 KiB
YAML
Raw Normal View History

2022-08-28 16:29:11 +00:00
image: ubuntu:latest
stages:
- build
- package
build_backend:
stage: build
2022-08-28 16:50:22 +00:00
cache:
2022-08-31 12:55:44 +00:00
key: backend
2022-08-28 16:50:22 +00:00
paths:
2022-08-31 12:41:55 +00:00
- vcpkg_cache
2022-08-28 16:29:11 +00:00
script:
- apt-get update
- apt-get install g++ gcc make cmake git curl zip unzip tar python3 pkg-config -y
- SRC="$PWD"
- TMP=$(mktemp -d)
- cd $TMP
- git clone https://github.com/Microsoft/vcpkg.git .
- ./bootstrap-vcpkg.sh -disableMetrics
- cd $SRC
2022-08-31 12:55:44 +00:00
- mkdir -p vcpkg_cache
2022-08-31 12:41:55 +00:00
- VCPKG_DEFAULT_BINARY_CACHE=$SRC/vcpkg_cache cmake -B build -S backend -DCMAKE_TOOLCHAIN_FILE=$TMP/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release
2022-08-28 16:29:11 +00:00
- cmake --build build
- cp build/backend server
artifacts:
paths:
2022-08-28 16:50:22 +00:00
- server
2022-08-28 16:29:11 +00:00
expire_in: 1h
test_and_build_frontend:
image: node:latest
stage: build
cache:
2022-08-31 12:55:44 +00:00
key: frontend
2022-08-28 16:29:11 +00:00
paths:
- frontend/.yarn
- frontend/node_modules
script:
- cd frontend
- yarn install --cache-folder .yarn --frozen-lockfile
- yarn lint
- yarn build
artifacts:
paths:
- frontend/dist/
expire_in: 1h
package_server:
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/