1 # SPDX-license-identifier: Apache-2.0
2 ##############################################################################
3 # Copyright (c) 2019 Intel Corporation
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
11 VERSION := $(shell git describe --tags)
12 BUILD := $(shell git rev-parse --short HEAD)
13 PROJECTNAME := $(shell basename "$(pwd)")
15 ROOTPATH := $(shell realpath "$(PWD)/../../../../../../")
16 VOP := ${PWD}/build/_output/bin/visualization-operator
17 VOP_LOCAL := ${VOP}-local
18 IMAGE_NAME := dcr.cluster.local:32644/visualization-operator:latest
24 ## build: Generate the k8s and openapi artifacts using operator-sdk
26 GOOS=linux GOARCH=amd64
27 operator-sdk generate k8s --verbose
28 operator-sdk generate openapi --verbose
29 @operator-sdk build ${IMAGE_NAME} --verbose
30 @go build -o ${VOP_LOCAL} visualization-operator/cmd/manager
32 ## clean: clean build artifacts, image, binary
34 @echo "Deleting the Visualization-operator binary"
37 @if docker images $(IMAGE_NAME) | awk '{ print $$2 }' | grep -q -F latest; then echo "Deleting the visualization-operator docker image"; docker rmi ${IMAGE_NAME}; fi
39 ## publish: Push docker image to registry
41 @docker push ${IMAGE_NAME}
43 ## format: format source code
48 ## help: Print help message
51 @echo " Requires Operator SDK v0.8.0+, go1.12.5+"
53 @echo " Choose a command run in "$(PROJECTNAME)":"
55 @sed -n 's/^## //p' $< | column -t -s ':' | sed -e 's/^/ /'