2021-10-17 10:07:39 +02:00
|
|
|
BINARY_NAME=gitea-sonarqube-bot
|
|
|
|
|
|
|
|
export GO111MODULE=on
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Make Routines:"
|
|
|
|
@echo " - build Build the bot"
|
|
|
|
@echo " - run Start the bot"
|
|
|
|
@echo " - clean Delete generated files"
|
2021-10-17 10:53:54 +02:00
|
|
|
@echo " - test Run full test suite"
|
|
|
|
@echo " - test p=./path/to/package Run test suite for specific package"
|
|
|
|
@echo " - test\#SpecificTestName Run a specific"
|
|
|
|
@echo " - coverage Run full test suite and generates coverage report as HTML file"
|
2022-05-14 01:10:07 +02:00
|
|
|
@echo " - helm-params Auto-generates 'Parameters' section of 'helm/README.md' based on comments in values.yaml"
|
|
|
|
@echo " - helm-pack Prepares Helm Chart release artifacts for pushing to 'charts' branch"
|
2021-10-17 10:07:39 +02:00
|
|
|
@echo " - dep Dependency maintenance (tidy, vendor, verify)"
|
2022-05-14 02:22:00 +02:00
|
|
|
@echo " - dep-up Dependency upgrade (including auto-sync + auto-test)"
|
2021-10-17 10:07:39 +02:00
|
|
|
@echo " - vet Examine Go source code and reports suspicious parts"
|
|
|
|
@echo " - fmt Format the Go code"
|
|
|
|
@echo " - help Print this help"
|
|
|
|
|
|
|
|
build:
|
2021-10-17 10:53:54 +02:00
|
|
|
GOARCH=amd64 GOOS=linux go build -mod=vendor -o ${BINARY_NAME} ./cmd/gitea-sonarqube-bot/
|
2021-10-17 10:07:39 +02:00
|
|
|
|
|
|
|
run:
|
|
|
|
./${BINARY_NAME}
|
|
|
|
|
|
|
|
clean:
|
|
|
|
go clean
|
|
|
|
rm -f ${BINARY_NAME}
|
2021-10-17 12:16:42 +02:00
|
|
|
rm -f cover.out cover.html test-report.out
|
2021-10-17 10:07:39 +02:00
|
|
|
|
|
|
|
test:
|
2021-10-17 10:53:54 +02:00
|
|
|
ifdef p
|
|
|
|
go test -v -mod=vendor $(p)
|
|
|
|
else
|
|
|
|
go test -v -mod=vendor ./...
|
|
|
|
endif
|
|
|
|
|
|
|
|
test\#%:
|
|
|
|
go test -mod=vendor -run $(subst .,/,$*) ./...
|
2021-10-17 10:07:39 +02:00
|
|
|
|
2021-10-17 12:16:42 +02:00
|
|
|
test-ci:
|
|
|
|
go test -mod=vendor -coverprofile=cover.out -json ./... > test-report.out
|
|
|
|
|
2021-10-17 10:07:39 +02:00
|
|
|
coverage:
|
2021-10-17 10:53:54 +02:00
|
|
|
go test -coverprofile=cover.out ./...
|
2021-10-17 10:07:39 +02:00
|
|
|
go tool cover -html=cover.out -o cover.html
|
|
|
|
|
2022-05-14 01:10:07 +02:00
|
|
|
helm-params:
|
|
|
|
npm install
|
|
|
|
npm run helm-params
|
|
|
|
|
|
|
|
helm-pack:
|
|
|
|
rm -rf ./helm-releases/
|
|
|
|
helm package ./helm/ -d ./helm-releases/
|
|
|
|
curl -L -o ./helm-releases/index.yaml https://codeberg.org/justusbunsi/gitea-sonarqube-bot/raw/branch/charts/index.yaml
|
|
|
|
helm repo index ./helm-releases/ --url https://codeberg.org/justusbunsi/gitea-sonarqube-bot/raw/branch/charts/ --merge ./helm-releases/index.yaml
|
|
|
|
|
2021-10-17 10:07:39 +02:00
|
|
|
dep:
|
|
|
|
go mod tidy
|
|
|
|
go mod vendor
|
|
|
|
go mod verify
|
|
|
|
|
2022-05-14 02:22:00 +02:00
|
|
|
dep-bump:
|
|
|
|
go get -t -u ./...
|
|
|
|
|
|
|
|
dep-up: dep-bump dep test
|
|
|
|
|
2021-10-17 10:07:39 +02:00
|
|
|
vet:
|
|
|
|
go vet ./...
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
go fmt ./...
|