]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
monitoring/grafana/build/Makefile: cleanup, ready for jenkins
authorDan Mick <dmick@redhat.com>
Wed, 26 May 2021 02:44:02 +0000 (02:44 +0000)
committerDan Mick <dmick@redhat.com>
Wed, 26 May 2021 20:37:25 +0000 (13:37 -0700)
- 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 <dmick@redhat.com>
monitoring/grafana/build/Makefile

index 748db6be724634151c660503542e9bd70e5503ca..46b1f25c39a819274f0348a64cc766d03f634355 100755 (executable)
@@ -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 "-<whatever> 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 <pcuzner@redhat.com>" $(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