From: Dan Mick Date: Wed, 26 May 2021 02:44:02 +0000 (+0000) Subject: monitoring/grafana/build/Makefile: cleanup, ready for jenkins X-Git-Tag: v17.1.0~1764^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a3b4bc73f7c620394032c30a8ee3becdfc8d7cb0;p=ceph.git monitoring/grafana/build/Makefile: cleanup, ready for jenkins - allow env setting of versions of components - add docker/quay username/password variables - derive container version from grafana version - make arch-specific tags - expand clean target to remove container images - remove release-specific targets, "all" target - move push operations to separate "push" target Signed-off-by: Dan Mick --- diff --git a/monitoring/grafana/build/Makefile b/monitoring/grafana/build/Makefile index 748db6be724..46b1f25c39a 100755 --- a/monitoring/grafana/build/Makefile +++ b/monitoring/grafana/build/Makefile @@ -1,20 +1,23 @@ -GRAFANA_VERSION := 6.7.4-1 -PIECHART_VERSION := "1.4.0" -STATUS_PANEL_VERSION := "1.0.9" +GRAFANA_VERSION ?= 6.7.4-1 +PIECHART_VERSION ?= "1.4.0" +STATUS_PANEL_VERSION ?= "1.0.9" DASHBOARD_DIR := "../dashboards" DASHBOARD_PROVISIONING := "ceph-dashboard.yml" IMAGE := "docker.io/centos:8" -VERSION := "${IMAGE: -1}" PKGMGR := "dnf" GF_CONFIG := "/etc/grafana/grafana.ini" -ceph_version := "master" +# clip off "- from the end of GRAFANA_VERSION +CONTAINER_VERSION := $(shell /bin/echo $(GRAFANA_VERSION) | /bin/sed 's/-.*//') ARCH ?= x86_64 ifeq "$(ARCH)" "arm64" override ARCH := aarch64 endif +LOCALTAG=ceph-grafana:$(CONTAINER_VERSION)-$(ARCH) +TAG=ceph/ceph-grafana:$(CONTAINER_VERSION)-$(ARCH) + # Build a grafana instance - preconfigured for use within Ceph's dashboard UI build : @@ -66,20 +69,19 @@ providers: \\n\ sudo buildah config --label maintainer="Paul Cuzner " $(CONTAINER) sudo buildah config --label description="Ceph Grafana Container" $(CONTAINER) sudo buildah config --label summary="Grafana Container configured for Ceph mgr/dashboard integration" $(CONTAINER) - sudo buildah commit --format docker --squash $(CONTAINER) ceph-grafana:${ceph_version} - sudo buildah tag ceph-grafana:${ceph_version} ceph/ceph-grafana:${ceph_version} - -clean : + sudo buildah commit --format docker --squash $(CONTAINER) $(LOCALTAG) + +push: + sudo podman tag ${LOCALTAG} docker.io/${TAG} + sudo podman tag ${LOCALTAG} quay.io/${TAG} + sudo podman login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_PASSWORD} docker.io + sudo podman login -u $(CONTAINER_REPO_USERNAME) -p $(CONTAINER_REPO_PASSWORD) quay.io + sudo podman push --format v2s2 docker.io/${TAG} + sudo podman push --format v2s2 quay.io/${TAG} + +clean: + sudo podman rmi ${LOCALTAG} || true + sudo podman rmi docker.io/${TAG} || true + sudo podman rmi quay.io/${TAG} || true rm -f grafana-*.rpm* rm -f ${DASHBOARD_PROVISIONING} - - -nautilus : - $(MAKE) ceph_version="nautilus" build -octopus : - $(MAKE) ceph_version="octopus" build -master : - $(MAKE) ceph_version="master" build - -all : nautilus octopus master -.PHONY : all