blob: ac7f994f257bc521530a1a4625409d1344551339 [file] [log] [blame]
Matteo Scandolo9061e432022-05-10 13:56:29 -07001# SPDX-FileCopyrightText: ${today.year}-present Intel Corporation
2#
3# SPDX-License-Identifier: Apache-2.0
4
5# set default shell
6SHELL = bash -e -o pipefail
7
8# Variables
9VERSION ?= $(shell cat ./VERSION)
10
11# tool containers
12VOLTHA_TOOLS_VERSION ?= 2.4.0
13
14GO = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") -v gocache:/.cache -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-golang go
15GO_JUNIT_REPORT = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app -i voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-go-junit-report go-junit-report
16GOCOVER_COBERTURA = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app/src/github.com/opencord/bbsim-sadis-server -i voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-gocover-cobertura gocover-cobertura
17GOLANGCI_LINT = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") -v gocache:/.cache -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-golangci-lint golangci-lint
18HADOLINT = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-hadolint hadolint
19
20## lint and unit tests
21
22lint:
23 @echo "Add lint command for Dockerfile and go modules, see https://github.com/opencord/bbsim-sadis-server/blob/master/Makefile#L83-L103"
24
25sca:
26 @echo "Add static code analysis command for Go code, see https://github.com/opencord/bbsim-sadis-server/blob/master/Makefile#L105-L111"
27
28test:
29 @echo "Add unit test command for Go code, see https://github.com/opencord/bbsim-sadis-server/blob/master/Makefile#L113-L119"