-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
79 lines (67 loc) · 1.35 KB
/
.gitlab-ci.yml
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
variables:
MAVEN_OPTS: -Dmaven.repo.local=.m2/repository
image: maven:latest
stages:
- build
- test
- sonarqube
- deploy
cache:
paths:
- .m2/repository
- target
build:
stage: build
only:
- master
script:
- cd backend
- mvn clean install -DskipTests=true
frontend:
image: cypress/browsers:node12.14.1-chrome85-ff81
stage: build
only:
- master
script:
- cd frontend
- npm install
# test:
# stage: test
# script:
# - cd backend
# - mvn test
end-to-end:
image: cypress/browsers:node12.14.1-chrome85-ff81
stage: test
only:
- master
script:
- cd frontend
# install dependencies
- npm ci
# run Cypress tests
- npm run cypress
sonarqube:
stage: sonarqube
only:
- master
script:
- cd backend
- mvn clean package sonar:sonar -Dsonar.login=$SONAR_LOGIN -Dsonar.password=$SONAR_PASSWORD -Dsonar.projectKey=tune-in -Dsonar.qualitygate.wait=false
deploy_local:
stage: deploy
only:
- master
script:
- cd backend
- mvn package
deploy_prod:
stage: deploy
image: google/cloud-sdk:alpine
# only:
# - master
script:
- echo $GCP_SA_KEY > gcloud-service-key.json
- gcloud auth activate-service-account --key-file gcloud-service-key.json
- gcloud config set project $GCP_PROJECT_ID
- gcloud builds submit . --config=cloudbuild.yaml