Skip to content

Commit e3388b5

Browse files
committed
Fix gitlab-ci
1 parent 61bff04 commit e3388b5

File tree

1 file changed

+83
-21
lines changed

1 file changed

+83
-21
lines changed

.gitlab-ci.yml

Lines changed: 83 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,104 @@
11
stages:
22
- install
3-
- lint
43
- test
54
- build
65

76
variables:
8-
WORKDIR: frontend-angular
9-
NODE_VERSION: "20"
7+
WORKDIR: backend-springboot
8+
JAVA_IMAGE: maven:3.9-eclipse-temurin-21
109

1110
cache:
12-
key: "node-${CI_COMMIT_REF_SLUG}"
11+
key: "m2-${CI_COMMIT_REF_SLUG}"
1312
paths:
14-
- ${WORKDIR}/node_modules
13+
- .m2/repository
1514

16-
.install_base:
17-
image: node:${NODE_VERSION}
15+
install_backend_springboot:
16+
stage: install
17+
image: ${JAVA_IMAGE}
1818
before_script:
1919
- cd ${WORKDIR}
20-
- npm ci
21-
22-
install:
23-
stage: install
24-
extends: .install_base
2520
script:
26-
- node -v
21+
- mvn -B -DskipTests verify
22+
rules:
23+
- changes:
24+
- ${WORKDIR}/**
2725

28-
lint:
29-
stage: lint
30-
extends: .install_base
26+
test_backend_springboot:
27+
stage: test
28+
image: ${JAVA_IMAGE}
29+
before_script:
30+
- cd ${WORKDIR}
3131
script:
32-
- npm run lint
32+
- mvn -B clean test jacoco:report
33+
artifacts:
34+
when: always
35+
reports:
36+
junit: ${WORKDIR}/target/surefire-reports/*.xml
37+
paths:
38+
- ${WORKDIR}/target/site/jacoco
39+
needs: ["install_backend_springboot"]
40+
rules:
41+
- changes:
42+
- ${WORKDIR}/**
3343

34-
build:
44+
build_backend_springboot:
3545
stage: build
36-
extends: .install_base
46+
image: ${JAVA_IMAGE}
47+
before_script:
48+
- cd ${WORKDIR}
3749
script:
38-
- npm run build -- --configuration=production
50+
- mvn -B -DskipTests package
3951
artifacts:
4052
paths:
41-
- ${WORKDIR}/dist
53+
- ${WORKDIR}/target/*.jar
54+
- ${WORKDIR}/target/*.war
4255
expire_in: 7 days
56+
needs: ["test_backend_springboot"]
57+
rules:
58+
- changes:
59+
- ${WORKDIR}/**
60+
61+
62+
63+
# stages:
64+
# - install
65+
# - lint
66+
# - test
67+
# - build
68+
69+
# variables:
70+
# WORKDIR: frontend-angular
71+
# NODE_VERSION: "20"
72+
73+
# cache:
74+
# key: "node-${CI_COMMIT_REF_SLUG}"
75+
# paths:
76+
# - ${WORKDIR}/node_modules
77+
78+
# .install_base:
79+
# image: node:${NODE_VERSION}
80+
# before_script:
81+
# - cd ${WORKDIR}
82+
# - npm ci
83+
84+
# install:
85+
# stage: install
86+
# extends: .install_base
87+
# script:
88+
# - node -v
89+
90+
# lint:
91+
# stage: lint
92+
# extends: .install_base
93+
# script:
94+
# - npm run lint
95+
96+
# build:
97+
# stage: build
98+
# extends: .install_base
99+
# script:
100+
# - npm run build -- --configuration=production
101+
# artifacts:
102+
# paths:
103+
# - ${WORKDIR}/dist
104+
# expire_in: 7 days

0 commit comments

Comments
 (0)