-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
78 lines (70 loc) · 2.18 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
78 lines (70 loc) · 2.18 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
stages:
- test
- install
- sonar
before_script:
- pwd
- echo $CI_BUILD_REF_NAME
- git remote -v
- git reset --hard HEAD
- git stash
- git pull origin $CI_BUILD_REF_NAME
after_script:
- git reset --hard HEAD
- git stash
- git pull origin $CI_BUILD_REF_NAME
pnpm_test:
stage: test
script:
- pwd
- git reset --hard HEAD
- rm -rf node_modules
- pnpm install
- pnpm run test
- pnpm run build
mvn_test:
stage: test
script:
- cd backend
- mvn clean
- mvn test
install:
stage: install
script:
- pwd
- cd $CI_PROJECT_DIR/
- git reset --hard HEAD
- rm -rf node_modules
- pnpm install
- pnpm run build
- cd backend
- pwd
- mvn clean deploy -DskipTests
only:
- master
- dev
sonarqube_backend:
stage: sonar
script:
- cd $CI_PROJECT_DIR/
- cd backend
- mvn sonar:sonar -Dsonar.analysis.mode=preview -Dsonar.projectName=$CI_PROJECT_NAME -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref_name=$CI_BUILD_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID
when: manual
sonarqube_backend_publish:
stage: sonar
script:
- cd $CI_PROJECT_DIR/
- cd backend
- mvn sonar:sonar -Dsonar.analysis.mode=publish -Dsonar.projectName=$CI_PROJECT_NAME -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref_name=$CI_BUILD_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Donar.gitlab.user_token access=a18878c7b5beb401ce2f847537c296b46a3902b8
environment:
name: $CI_COMMIT_REF_NAME
only:
- staging
- dev
when: manual
sonarqube_frontend:
stage: sonar
script:
- sonar-scanner -Dsonar.sources=. -Dsonar.projectKey=$CI_PROJECT_NAME -Dsonar.analysis.mode=preview -Dsonar.login=a02003f1f8f90382d7570b57a85c00c38132f85f -Dsonar.branch=$CI_BUILD_REF_NAME -Dsonar.projectName=$CI_PROJECT_NAME -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref_name=$CI_BUILD_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID
- sonar-scanner -Dsonar.sources=. -Dsonar.projectKey=$CI_PROJECT_NAME -Dsonar.analysis.mode=publish -Dsonar.login=a02003f1f8f90382d7570b57a85c00c38132f85f -Dsonar.branch=$CI_BUILD_REF_NAME -Dsonar.projectName=$CI_PROJECT_NAME
when: manual