generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
134 lines (92 loc) · 3.17 KB
/
Makefile
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#Purpose - common commands and combinations to assist with build and build reports
#Under linux it also enables commandline autocompletion (using TAB key), so most commands can be invoked with just a couple of keystrokes
#
#
# Usage:
# make dependencies-down
# or make d[TAB]d[TAB]
#
# It includes
# Docker builds
# Gradle builds
# Sonar qube
# Code Coverage Checks (Gradle)
# Reports
#
#Some reports use "open" to open the html file. This is a native mac command, for linux - add this to your ~/.bashrc
#
#
#case "$OSTYPE" in
# cygwin*)
# alias open="cmd /c start"
# ;;
# linux*)
# alias start="xdg-open"
# alias open="xdg-open"
# ;;
# darwin*)
# alias start="open"
# ;;
#esac
##
compose-up:
docker-compose up
compose-down:
docker-compose down
#fires up dependencies for this project
dependencies-up:
docker-compose -f docker-compose-dependencies.yml up
#shuts down dependencies for this project - database content will be reset to a vanilla postgres instance
dependencies-down:
docker-compose -f docker-compose-dependencies.yml down
app-run:
./gradlew bootRun
app-smoke-test:
./gradlew smoke -i
app-run-with-ai:
sudo mkdir -p /opt/app/;sudo chown $$USER /opt/app/;cp lib/* /opt/app/;./gradlew bootRun -i -DJAVA_TOOL_OPTIONS=-javaagent:/opt/app/applicationinsights-agent-2.5.1.jar -DENABLE_SHUTDOWN=false
test-functional:
./gradlew functional -i
test-integration:
./gradlew integration -i
test-code:
./gradlew test -i
check-code:
./gradlew check -i
check-dependencies:
./gradlew dependencyCheckAggregate -i
check-coverage:
./gradlew test integration jacocoTestCoverageVerification jacocoTestReport && open build/reports/jacoco/test/html/index.html
check-all:
./gradlew test integration check dependencyCheckAggregate jacocoTestCoverageVerification jacocoTestReport && open build/reports/jacoco/test/html/index.html
#convenience first time download and run of sonarqube with default username/password of admin/admin
sonarqube-fetch-and-run-sonarqube-latest-with-password-as-admin:
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
sonarqube-run-tests-with-password-as-adminnew:
./gradlew sonarqube -Dsonar.login="admin" -Dsonar.password="adminnew" -Dsonar.host.url="http://localhost:9000/" -i && open http://localhost:9000/
#Note this fails if there is already a container running.
sonarqube-run-local-sonarqube-server:
docker start sonarqube
#convenenience links for all generated reports
report-sonarqube:
open http://localhost:9000/
report-checkstyle:
open build/reports/checkstyle/main.html
report-code-tests:
open build/reports/tests/test/index.html
report-integration-tests:
open build/reports/tests/integration/index.html
report-smoke-tests:
open build/reports/tests/smoke/index.html
report-code-pmd-main:
open build/reports/pmd/main.html
report-code-pmd-test:
open build/reports/pmd/test.html
report-code-pmd-integration-test:
open build/reports/pmd/integrationTest.html
report-code-pmd-smoke-test:
open build/reports/pmd/smokeTest.html
report-dependency-check:
open build/reports/dependency-check-report.html
report-jacoco:
open build/reports/jacoco/test/html/index.html