visualization operator: Add datasource
[demo.git] / vnfs / DAaaS / microservices / visualization-operator / Makefile
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 ##############################################################################
9
10 # Common
11 VERSION := $(shell git describe --tags)
12 BUILD := $(shell git rev-parse --short HEAD)
13 PROJECTNAME := $(shell basename "$(pwd)")
14
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
19
20 export GO111MODULE=on
21
22 .PHONY: clean publish
23
24 ## build: Generate the k8s and openapi artifacts using operator-sdk
25 build: clean 
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
31       
32 ## clean: clean build artifacts, image, binary
33 clean:
34         @echo "Deleting the Visualization-operator binary"
35         @rm -rf ${VOP}
36         @rm -rf ${VOP_LOCAL}
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
38
39 ## publish: Push docker image to registry
40 publish:
41         @docker push ${IMAGE_NAME}
42
43 ## format: format source code
44 format:
45         @go fmt ./...
46
47 .PHONY: help
48 ## help: Print help message
49 help: Makefile
50         @echo
51         @echo " Requires Operator SDK v0.8.0+, go1.12.5+"
52         @echo
53         @echo " Choose a command run in "$(PROJECTNAME)":"
54         @echo
55         @sed -n 's/^## //p' $< | column -t -s ':' |  sed -e 's/^/ /'
56         @echo