-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
110 lines (102 loc) · 2.51 KB
/
.gitlab-ci.yml
File metadata and controls
110 lines (102 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
image: harbor.uni-muenster.de/proxy-docker/library/node:latest
stages:
- test
- build
- deploy
.default_rules_tag:
rules:
- if: $CI_COMMIT_TAG =~ /^\d+.\d+.\d+/ # describe how your version tags look like!
build-and-run-tests:
stage: test
cache:
key:
files:
- package-lock.json
prefix: npm
paths:
- node_modules/
script:
- npm install
- npm run build
- npm run test
artifacts:
paths:
- dist
# build-demo:
# stage: build
# cache:
# key:
# files:
# - package-lock.json
# prefix: npm
# paths:
# - node_modules/
# script:
# - npm install
# - npm run demo
# artifacts:
# paths:
# - demo
docs:
stage: build
cache:
key:
files:
- package-lock.json
prefix: npm
paths:
- node_modules/
script:
- npm run doc
artifacts:
paths:
- docs
# push to npm package registry
deploy:
stage: deploy
script:
- echo "@scdh:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" > .npmrc
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
- cat .npmrc
- npm --no-git-tag-version version $CI_COMMIT_TAG
- npm publish
rules:
- !reference [ .default_rules_tag, rules ]
deploy webjar:
stage: deploy
variables:
UPLOAD_LOCATION: $CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven/de/wwu/scdh/seed/seed-frontend-components-webjar/$CI_COMMIT_TAG/seed-frontend-components-webjar-$CI_COMMIT_TAG
UPLOAD_FILE: target/seed-frontend-components-webjar-$CI_COMMIT_TAG
HEADER: "JOB-TOKEN: $CI_JOB_TOKEN"
before_script:
- apt-get update
- apt-get -y install zip
- 'echo "upload location: $UPLOAD_LOCATION"'
- 'echo "upload file: $UPLOAD_FILE"'
- 'echo "header: $HEADER"'
script:
- npm run webjar
- 'curl --request PUT --upload-file $UPLOAD_FILE.jar --header "$HEADER" $UPLOAD_LOCATION.jar'
- 'curl --request PUT --upload-file $UPLOAD_FILE.pom --header "$HEADER" $UPLOAD_LOCATION.pom'
rules:
- !reference [ .default_rules_tag, rules ]
pages:
stage: deploy
script:
- mkdir -p public
- ls -l
- ls -l dist
- cp -av --recursive dist/* public/
- cp -av --recursive docs public/
# - ls -l demo
# - cp -av --recursive demo/* public/
- ls -lR public
artifacts:
paths:
- public
- public/*
needs:
- docs
- build-and-run-tests
rules:
- !reference [ .default_rules_tag, rules ]