From 28517f841a3261987114869e04624cdd686c31a5 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Thu, 20 May 2021 20:35:39 +0100 Subject: [docker][experimental] Allow COLLECTD_TAG to be passed to container build This is an optional build arg that overrides the defaults that are set by COLLECTD_FLAVOR This should let the user pull from an arbitrary collectd branch (e.g. a WIP branch or a PR branch from upstream) Change-Id: I6d0ede2b8b57f28e152e53eddae378ac6c722706 Signed-off-by: Emma Foley --- docker/barometer-collectd-experimental/Dockerfile | 5 ++++- src/collectd/Makefile | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docker/barometer-collectd-experimental/Dockerfile b/docker/barometer-collectd-experimental/Dockerfile index 9565bdb4..8622a63c 100644 --- a/docker/barometer-collectd-experimental/Dockerfile +++ b/docker/barometer-collectd-experimental/Dockerfile @@ -17,8 +17,11 @@ FROM centos:8 ARG COLLECTD_FLAVOR=experimental -ARG COLLECTD_PULL_REQUESTS= +ARG COLLECTD_PULL_REQUESTS +ARG COLLECTD_CONFIG_CMD_ARGS +ARG COLLECTD_TAG ARG WITH_DPDK=n + ENV DOCKER y ENV repos_dir /src diff --git a/src/collectd/Makefile b/src/collectd/Makefile index 7eb312da..ec45f941 100644 --- a/src/collectd/Makefile +++ b/src/collectd/Makefile @@ -25,7 +25,8 @@ include ../mk/master.mk include ../package-list.mk WORK_DIR = collectd -TAG_DONE_FLAG = $(WORK_DIR)/.$(COLLECTD_TAG).done +# $COLLECTD_TAG can contain "/", which is being replaced with "-" here +TAG_DONE_FLAG := $(WORK_DIR)/.$(subst /,-,"$(COLLECTD_TAG)").done BUILD_CMD = ./build.sh CONFIG_CMD = CONFIG_CMD += ./configure @@ -121,7 +122,7 @@ $(WORK_DIR): $(TAG_DONE_FLAG): $(WORK_DIR) @echo "Checking out collectd from tag: $(COLLECTD_TAG)" - $(AT)cd collectd; git checkout $(COLLECTD_TAG) + $(AT)cd collectd; git fetch origin $(COLLECTD_TAG); git checkout FETCH_HEAD ifneq ($(PATCH_FILE),) $(AT)cd $(WORK_DIR); patch -p1 < ../$(PATCH_FILE) endif -- cgit 1.2.3-korg