blob: 051d89f94c64b813d9e61457d51647418910792a [file] [log] [blame]
Joey Armstrong36c9bcd2023-04-05 19:05:56 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong2c039362024-02-04 18:51:52 -05003# Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrong36c9bcd2023-04-05 19:05:56 -04004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.d
16# -----------------------------------------------------------------------
17
18$(if $(DEBUG),$(warning ENTER))
19
20## Docker related -- are these ${shell vars} or $(make macros) ?
21DOCKER_TAG ?= ${VERSION}
22DOCKER_REPOSITORY ?=
23DOCKER_REGISTRY ?=
24DOCKER_RUN_ARGS ?=
25DOCKER_PORTS ?= -p 50070:50070 -p 50060:50060 -p 50071:50071 -p 50072:50072 -p 50073:50073 -p 50074:50074 -p 50075:50075
26TYPE ?= minimal
27
28# tool containers
29VOLTHA_TOOLS_VERSION ?= 2.3.1
30
31docker-run = docker run --rm --user $$(id -u):$$(id -g)# # Docker command stem
32docker-run-app = $(docker-run) -v ${CURDIR}:/app# # w/filesystem mount
Joey Armstrongb98dfe82023-05-16 16:34:34 -040033
34## -----------------------------------------------------------------------
35## --interactive: Attach streams if running interactively (!jenkins)
36## --tty : Attach stdout else jenkins::docker is silent.
37## -----------------------------------------------------------------------
Joey Armstrongf99712c2023-06-01 17:04:38 -040038is-stdin = $(shell test -t 0 && { echo '--interactive'; })
Joey Armstrongb98dfe82023-05-16 16:34:34 -040039is-stdin += --tty
Joey Armstrong36c9bcd2023-04-05 19:05:56 -040040
41# Docker volume mounts: container:/app/release <=> localhost:{pwd}/release
42vee-golang = -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg
43vee-citools = voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}
44
45GO = $(docker-run-app) $(is-stdin) -v gocache:/.cache $(vee-golang) $(vee-citools)-golang go
46GO_SH = $(docker-run-app) $(is-stdin) --env-file ./foobar -v gocache:/.cache $(vee-golang) $(vee-citools)-golang sh -c
47GO_JUNIT_REPORT = $(docker-run-app) -i $(vee-citools)-go-junit-report go-junit-report
48GOCOVER_COBERTURA = $(docker-run) -v ${CURDIR}:/app/src/github.com/opencord/bbsim -i $(vee-citools)-gocover-cobertura gocover-cobertura
49GOLANGCI_LINT = $(docker-run-app) $(is-stdin) -v gocache:/.cache $(vee-golang) $(vee-citools)-golangci-lint golangci-lint
50PROTOC = $(docker-run-app) $(is-stdin) $(vee-golang) $(vee-citools)-protoc protoc
51
52$(if $(DEBUG),$(warning LEAVE))
53
54# [EOF]