Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
Use $USER in make targets for image, as in console plugin (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak authored Feb 3, 2022
1 parent 52e7caf commit d421dff
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
IMAGE ?= quay.io/netobserv/goflow2-kube
VERSION ?= $(shell git describe --long HEAD)
USER ?= netobserv
VERSION ?= latest
IMAGE ?= quay.io/${USER}/goflow2-kube:${VERSION}
GOLANGCI_LINT_VERSION = v1.42.1
COVERPROFILE = coverage.out

Expand Down Expand Up @@ -47,21 +48,21 @@ build:
.PHONY: image
image:
@echo "### Building image with ${OCI_BIN}"
$(OCI_BIN) build --build-arg VERSION="$(VERSION)" -t $(IMAGE):$(VERSION) .
$(OCI_BIN) build --build-arg VERSION="$(VERSION)" -t $(IMAGE) .

.PHONY: push
push:
$(OCI_BIN) push $(IMAGE):$(VERSION)
$(OCI_BIN) push $(IMAGE)

.PHONY: ovnk-deploy
ovnk-deploy:
sed -e 's~quay\.io/netobserv/goflow2-kube:main~$(IMAGE):$(VERSION)~' ./examples/goflow-kube.yaml | kubectl apply -f - && \
sed -e 's~quay\.io/netobserv/goflow2-kube:main~$(IMAGE)~' ./examples/goflow-kube.yaml | kubectl apply -f - && \
GF_IP=`kubectl get svc goflow-kube -ojsonpath='{.spec.clusterIP}'` && echo "Goflow IP: $$GF_IP" && \
kubectl set env daemonset/ovnkube-node -c ovnkube-node -n ovn-kubernetes OVN_IPFIX_TARGETS="$$GF_IP:2055"

.PHONY: cno-deploy
cno-deploy:
sed -e 's~quay\.io/netobserv/goflow2-kube:main~$(IMAGE):$(VERSION)~' ./examples/goflow-kube.yaml | oc apply -f - && \
sed -e 's~quay\.io/netobserv/goflow2-kube:main~$(IMAGE)~' ./examples/goflow-kube.yaml | oc apply -f - && \
GF_IP=`oc get svc goflow-kube -ojsonpath='{.spec.clusterIP}'` && "Goflow IP: $$GF_IP" && \
oc patch networks.operator.openshift.io cluster --type='json' -p "$(sed -e "s/GF_IP/$$GF_IP/" examples/net-cluster-patch.json)"

Expand Down

0 comments on commit d421dff

Please sign in to comment.