fileserver/.gitlab-ci.yml

79 lines
1.3 KiB
YAML
Raw Normal View History

2022-08-22 15:30:23 +00:00
image: node:latest
stages:
- test
- build
- package
2022-08-22 15:42:11 +00:00
cache:
- key:
files:
2022-08-22 16:10:41 +00:00
- yarn.lock
- frontend/yarn.lock
2022-08-22 15:42:11 +00:00
paths:
2022-08-23 17:30:01 +00:00
- node_modules
2022-08-22 15:42:11 +00:00
- frontend/node_modules
before_script:
2022-08-22 16:10:41 +00:00
- yarn install
2022-08-22 15:42:11 +00:00
- cd frontend
2022-08-22 16:10:41 +00:00
- yarn install
2022-08-22 16:23:29 +00:00
- cd ..
2022-08-22 15:42:11 +00:00
2022-08-22 15:30:23 +00:00
test_backend:
stage: test
script:
2022-08-22 16:10:41 +00:00
- yarn lint
2022-08-22 15:30:23 +00:00
test_frontend:
stage: test
script:
- cd frontend
2022-08-22 16:10:41 +00:00
- yarn lint
2022-08-22 15:30:23 +00:00
build_backend:
stage: build
needs:
- job: test_backend
artifacts: false
script:
2022-08-22 16:10:41 +00:00
- yarn webpack
2022-08-22 15:30:23 +00:00
artifacts:
paths:
- dist/
expire_in: 1h
build_frontend:
stage: build
needs:
- job: test_frontend
artifacts: false
script:
- cd frontend
2022-08-22 16:10:41 +00:00
- yarn build
2022-08-22 15:30:23 +00:00
artifacts:
paths:
- frontend/dist/
expire_in: 1h
package_server:
stage: package
2022-08-22 15:42:11 +00:00
cache: []
before_script: []
2022-08-22 15:30:23 +00:00
needs:
- job: build_backend
artifacts: true
- job: build_frontend
artifacts: true
script:
- TMP=$(mktemp -d)
- mv dist/* "$TMP"
- mkdir "$TMP/frontend"
- mv frontend/dist/* "$TMP/frontend"
- rm -r *
2022-08-22 17:06:20 +00:00
- rm -r .* || true
2022-08-23 09:30:27 +00:00
- mv "$TMP/"* .
2022-08-22 15:30:23 +00:00
artifacts:
paths:
- .