VCS_URL ?=$(shell git config --get remote.origin.url)
IMAGE_NAME =grc-ui
IMAGE_DISPLAY_NAME =GRC Console
ARCH = $(shell uname -m)
ifeq ($(ARCH), x86_64)
	IMAGE_NAME_ARCH =$(IMAGE_NAME)-amd64
else
	IMAGE_NAME_ARCH =$(IMAGE_NAME)-$(ARCH)
endif
IMAGE_MAINTAINER =ycao@us.ibm.com
IMAGE_VENDOR =IBM
IMAGE_VERSION :=$(shell git rev-parse --short HEAD)
IMAGE_DESCRIPTION =ICP GRC UI Container
IMAGE_SUMMARY =$(IMAGE_DESCRIPTION)
IMAGE_OPENSHIFT_TAGS =GRC Console

DOCKER_BUILD_OPTS=--build-arg "VCS_REF=$(SEMVERSION)" \
	--build-arg "VCS_URL=$(VCS_URL)" \
	--build-arg "IMAGE_NAME=$(IMAGE_NAME)" \
	--build-arg "IMAGE_DISPLAY_NAME=$(IMAGE_DISPLAY_NAME)" \
	--build-arg "IMAGE_NAME_ARCH=$(IMAGE_NAME_ARCH)" \
	--build-arg "IMAGE_MAINTAINER=$(IMAGE_MAINTAINER)" \
	--build-arg "IMAGE_VENDOR=$(IMAGE_VENDOR)" \
	--build-arg "IMAGE_VERSION=$(IMAGE_VERSION)" \
	--build-arg "IMAGE_DESCRIPTION=$(IMAGE_DESCRIPTION)" \
	--build-arg "IMAGE_SUMMARY=$(IMAGE_SUMMARY)" \
	--build-arg "IMAGE_OPENSHIFT_TAGS=$(IMAGE_OPENSHIFT_TAGS)"

NODE_ENV ?=development
cfcRouterUrl ?=https://9.42.82.240:8443
WLP_CLIENT_ID ?=
WLP_CLIENT_SECRET ?=
WLP_REDIRECT_URL ?=https://localhost:3000/auth/liberty/callback
GRC_UI_API_URL ?=https://10.10.0.5:4000/grcuiapi

DOCKER_RUN_OPTS=\
	-d \
	-e NODE_ENV=$(NODE_ENV) \
	-e cfcRouterUrl=$(cfcRouterUrl) \
	-e PLATFORM_IDENTITY_PROVIDER_URL=$(PLATFORM_IDENTITY_PROVIDER_URL) \
	-e WLP_CLIENT_ID=$(WLP_CLIENT_ID) \
	-e WLP_CLIENT_SECRET=$(WLP_CLIENT_SECRET) \
	-e WLP_REDIRECT_URL=$(WLP_REDIRECT_URL) \
	-e grcUiApiUrl=$(GRC_UI_API_URL)
