2020-12-23 18:36:41 +01:00
|
|
|
image: node:latest
|
|
|
|
|
|
|
|
stages:
|
2020-12-27 21:14:49 +01:00
|
|
|
- mytest
|
2020-12-27 13:33:53 +01:00
|
|
|
- test
|
|
|
|
- build
|
2020-12-27 15:15:57 +01:00
|
|
|
- deploy
|
2020-12-23 18:36:41 +01:00
|
|
|
|
2020-12-27 14:03:14 +01:00
|
|
|
cache: &global_cache
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package-lock.json
|
|
|
|
policy: pull
|
2020-12-23 20:23:44 +01:00
|
|
|
paths:
|
2020-12-27 17:11:18 +01:00
|
|
|
- .npm/
|
2020-12-27 14:03:14 +01:00
|
|
|
|
2020-12-27 13:33:53 +01:00
|
|
|
lint:
|
|
|
|
stage: test
|
2020-12-27 18:25:06 +01:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline
|
2020-12-23 20:15:28 +01:00
|
|
|
script:
|
|
|
|
- npm run lint
|
2020-12-27 14:03:14 +01:00
|
|
|
cache:
|
|
|
|
<<: *global_cache
|
2020-12-27 18:25:06 +01:00
|
|
|
policy: pull-push
|
2020-12-27 13:33:53 +01:00
|
|
|
|
2020-12-30 21:30:31 +01:00
|
|
|
test:
|
|
|
|
stage: test
|
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline
|
|
|
|
script:
|
|
|
|
- npm test
|
2020-12-30 21:31:35 +01:00
|
|
|
cache:
|
|
|
|
<<: *global_cache
|
2020-12-27 13:33:53 +01:00
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
2020-12-27 18:25:06 +01:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline
|
2020-12-27 13:33:53 +01:00
|
|
|
script:
|
|
|
|
- npm run build
|
2020-12-27 14:03:14 +01:00
|
|
|
cache:
|
|
|
|
<<: *global_cache
|
2020-12-27 15:19:20 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-12-27 15:25:05 +01:00
|
|
|
- dist
|
2020-12-27 16:43:20 +01:00
|
|
|
expire_in: 1 week
|
2020-12-27 16:38:16 +01:00
|
|
|
|
2020-12-27 15:15:57 +01:00
|
|
|
deploy:
|
2020-12-27 20:33:02 +01:00
|
|
|
image: ianayoung/rsync:latest
|
2020-12-27 15:15:57 +01:00
|
|
|
stage: deploy
|
2020-12-27 16:38:16 +01:00
|
|
|
dependencies:
|
|
|
|
- build
|
2020-12-27 15:15:57 +01:00
|
|
|
script:
|
2020-12-28 00:15:53 +01:00
|
|
|
- rsync --delete -az ./dist/ rsync://${DEPLOYMENT_USER}@${DEPLOYMENT_SERVER}:${DEPLOYMENT_PATH}
|
2020-12-27 16:38:16 +01:00
|
|
|
environment:
|
|
|
|
name: production
|
|
|
|
url: https://vtt.f3l.de/
|
2020-12-27 15:15:57 +01:00
|
|
|
only:
|
|
|
|
- master
|