diff options
author | Emma Foley <efoley@redhat.com> | 2021-05-20 20:35:39 +0100 |
---|---|---|
committer | Emma Foley <efoley@redhat.com> | 2021-05-27 18:11:13 +0100 |
commit | 28517f841a3261987114869e04624cdd686c31a5 (patch) | |
tree | 90be762787b86f95bcde1026a8a4cf565dc07ab0 | |
parent | 923175d15112a865f3f51e80dab88922c17340d6 (diff) |
[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 <efoley@redhat.com>
-rw-r--r-- | docker/barometer-collectd-experimental/Dockerfile | 5 | ||||
-rw-r--r-- | 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 |