-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (34 loc) · 983 Bytes
/
Copy pathMakefile
File metadata and controls
43 lines (34 loc) · 983 Bytes
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
TEST?=$$(go list ./... | grep -v vendor)
WORKDIR=$$(pwd)
BINARY=$$(pwd | xargs basename)
VERSION=$$(grep version main.go | head -n1 | cut -d\" -f2)
GOBIN=${GOPATH}/bin
default: build
build:
go build -o ${BINARY}
chmod +x ${BINARY}
install: build
mkdir -p ${GOBIN}
mv ${BINARY} ${GOPATH}/bin/${BINARY}
binaries: build
rm -rf packaging/binaries
mkdir -p packaging/binaries
bash packaging/generate-binaries.sh ${BINARY} ${WORKDIR}
package: binaries
bash packaging/generate-containers.sh ${WORKDIR}/packaging
test:
rm -f testdata/history/history.txt
rm -f testdata/configuration/test.json
rm -f coverage.txt profile.out
rm -f gosec-report.json
/bin/sh go.test.sh
test-sonarqube: test
gosec --no-fail -fmt=sonarqube -out gosec-report.json ./...
/opt/sonar-scanner/bin/sonar-scanner
test-view: test
go tool cover -html=coverage.txt
clean:
rm -rf packaging/binaries
rm -rf packaging/containers/rootfs
rm -rf packaging/containers/workdir
rm -rf packaging/workdir