@@ -24,15 +24,23 @@ define grafana_port
24
24
$(shell kubectl --context ${PROFILE} get --namespace grafana -o jsonpath="{.spec.ports[0].nodePort}" services grafana)
25
25
endef
26
26
27
+ define sonar_ip
28
+ $(shell kubectl --context ${PROFILE} get nodes --namespace sonarqube -o jsonpath="{.items[0].status.addresses[0].address}")
29
+ endef
30
+
31
+ define sonar_port
32
+ $(shell kubectl --context ${PROFILE} get --namespace sonarqube -o jsonpath="{.spec.ports[0].nodePort}" services sonarqube-sonarqube)
33
+ endef
34
+
27
35
image-client :
28
36
@docker build --build-arg VERSION=${VERSION} -t ${IMAGE_NAME} :${VERSION} --file client.Dockerfile .
29
37
30
38
image-server :
31
39
@docker build --build-arg VERSION=${VERSION} -t ${SERVER_IMAGE_NAME} :${VERSION} --file server.Dockerfile .
32
40
33
41
image-test-server :
34
- @docker build --build-arg VERSION=${VERSION} -t ${SERVER_IMAGE_NAME} -test:${VERSION} --file server.Dockerfile --target go-test .
35
- @docker run --rm ${SERVER_IMAGE_NAME} -test:${VERSION}
42
+ @docker build --build-arg VERSION=${VERSION} --build-arg SONAR_ADDRESS=http:// $( call sonar_ip) : $( call sonar_port) - t ${SERVER_IMAGE_NAME} -test:${VERSION} --file server.Dockerfile --target go-test .
43
+ @docker run --rm --net=host ${SERVER_IMAGE_NAME} -test:${VERSION}
36
44
37
45
image-client-debug :
38
46
@docker build --build-arg VERSION=${VERSION} -t ${IMAGE_NAME} -debug:${VERSION} --file client.Dockerfile --target mvn-build .
@@ -70,7 +78,8 @@ observability-minikube:
70
78
@helm --kube-context ${PROFILE} -n fluent install --create-namespace fluent-bit fluent/fluent-bit --version=0.29.0 -f observability/fluentbit_values.yaml --wait || true
71
79
@helm --kube-context ${PROFILE} -n tempo install --create-namespace tempo grafana/tempo --version=1.0.0 -f observability/tempo_values.yaml --wait || true
72
80
@helm --kube-context ${PROFILE} -n monitoring install --create-namespace kube-prometheus-stack prometheus/kube-prometheus-stack --version=45.23.0 -f observability/prometheus_values.yaml --wait || true
73
- @helm --kube-context ${PROFILE} -n grafana install --create-namespace grafana grafana/grafana --version=6.50.7 -f observability/grafana_values.yaml --wait
81
+ @helm --kube-context ${PROFILE} -n grafana install --create-namespace grafana grafana/grafana --version=6.50.7 -f observability/grafana_values.yaml --wait || true
82
+ @helm --kube-context ${PROFILE} -n sonarqube install --create-namespace sonarqube sonarqube/sonarqube --version=10.0.0 -f observability/sonarqube_values.yaml --wait || true
74
83
75
84
clean-observability-minikube :
76
85
@helm --kube-context ${PROFILE} -n elasticsearch delete elasticsearch --wait
@@ -85,10 +94,17 @@ clean-fluent:
85
94
clean-grafana :
86
95
@helm --kube-context ${PROFILE} -n grafana delete grafana --wait
87
96
97
+ clean-sonar :
98
+ @helm --kube-context ${PROFILE} -n sonarqube delete sonarqube --wait
99
+
88
100
grafana :
89
101
@echo http://$(call grafana_ip) :$(call grafana_port)
90
102
@python -mwebbrowser http://$(call grafana_ip) :$(call grafana_port)
91
103
104
+ sonar :
105
+ @echo http://$(call sonar_ip) :$(call sonar_port)
106
+ @python -mwebbrowser http://$(call sonar_ip) :$(call sonar_port)
107
+
92
108
load :
93
109
@minikube -p ${PROFILE} image load ${SERVER_IMAGE_NAME} :${VERSION}
94
110
@@ -122,6 +138,7 @@ dependencies-helm:
122
138
@helm repo add fluent https://fluent.github.io/helm-charts
123
139
@helm repo add grafana https://grafana.github.io/helm-charts
124
140
@helm repo add prometheus https://prometheus-community.github.io/helm-charts
141
+ @helm repo add sonarqube https://SonarSource.github.io/helm-chart-sonarqube
125
142
@cd charts/librarygames; \
126
143
helm dependencies update; \
127
144
helm dependencies build; \
0 commit comments