enable profile and race detection builds
Change-Id: If2741164277743be71568c48fe9aebfbe5718f53
diff --git a/Makefile b/Makefile
index e9f436a..ef1dea4 100755
--- a/Makefile
+++ b/Makefile
@@ -82,9 +82,12 @@
## Docker targets
docker-build: local-protos local-lib-go ## Build openonu adapter docker image (set BUILD_PROFILED=true to also build the profiled image)
- docker build $(DOCKER_BUILD_ARGS) --target=${DOCKER_TARGET} -t ${ADAPTER_IMAGENAME} -f docker/Dockerfile.openonu .
+ docker build $(DOCKER_BUILD_ARGS) --target=${DOCKER_TARGET} --build-arg CGO_PARAMETER=0 -t ${ADAPTER_IMAGENAME} -f docker/Dockerfile.openonu .
ifdef BUILD_PROFILED
- docker build $(DOCKER_BUILD_ARGS) --target=${DOCKER_TARGET} --build-arg EXTRA_GO_BUILD_TAGS="-tags profile" -t ${ADAPTER_IMAGENAME}-profile -f docker/Dockerfile.openonu .
+ docker build $(DOCKER_BUILD_ARGS) --target=dev --build-arg CGO_PARAMETER=1 --build-arg EXTRA_GO_BUILD_TAGS="-tags profile" -t ${ADAPTER_IMAGENAME}-profile -f docker/Dockerfile.openonu .
+endif
+ifdef BUILD_RACE
+ docker build $(DOCKER_BUILD_ARGS) --target=dev --build-arg CGO_PARAMETER=1 --build-arg EXTRA_GO_BUILD_TAGS="-race" -t ${ADAPTER_IMAGENAME}-rd -f docker/Dockerfile.openonu .
endif
docker-push: ## Push the docker images to an external repository
@@ -92,6 +95,9 @@
ifdef BUILD_PROFILED
docker push ${ADAPTER_IMAGENAME}-profile
endif
+ifdef BUILD_RACE
+ docker push ${ADAPTER_IMAGENAME}-rd
+endif
docker-kind-load: ## Load docker images into a KinD cluster
@if [ "`kind get clusters | grep voltha-$(TYPE)`" = '' ]; then echo "no voltha-$(TYPE) cluster found" && exit 1; fi
diff --git a/VERSION b/VERSION
index a926e7a..e67ee18 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.3.0-dev190
+1.3.0-dev191
diff --git a/docker/Dockerfile.openonu b/docker/Dockerfile.openonu
index f65a9f9..1aad701 100755
--- a/docker/Dockerfile.openonu
+++ b/docker/Dockerfile.openonu
@@ -26,6 +26,8 @@
ARG EXTRA_GO_BUILD_TAGS=""
+ARG CGO_PARAMETER=0
+
ARG org_label_schema_version=unknown
ARG org_label_schema_vcs_url=unknown
ARG org_label_schema_vcs_ref=unknown
@@ -36,7 +38,7 @@
# Build
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
RUN \
-CGO_ENABLED=0 go build $EXTRA_GO_BUILD_TAGS -mod=vendor -o /app/openonu \
+CGO_ENABLED=$CGO_PARAMETER go build $EXTRA_GO_BUILD_TAGS -mod=vendor -o /app/openonu \
-ldflags \
"-X github.com/opencord/voltha-lib-go/v4/pkg/version.version=$org_label_schema_version \
-X github.com/opencord/voltha-lib-go/v4/pkg/version.vcsRef=$org_label_schema_vcs_ref \