CHARM_SRC_DIR := $(CHARM_DIR)/layers
CHARM_DOCKER_TAG := charm-tools
CHARM_BUILD_DIR := $(CHARM_DIR)/builds
-DOCKER_BUILD ?= $(shell which docker)
+DOCKER_BUILD ?=
Q=@
CHARM_SRC_DIRS := $(addprefix $(CHARM_SRC_DIR)/, $(CHARMS))
CHARM_BUILD_DIRS := $(addprefix $(CHARM_BUILD_DIR)/, $(CHARMS))
CHARM_DOCKER_TAG := charm-tools
+DOCKER_BUILD ?=
all: $(CHARM_BUILD_DIRS)
clean:
-@ $(RM) -rf $(CHARM_BUILD_DIR)
+
+ifdef DOCKER_BUILD
$(CHARM_BUILD_DIR)/%: $(CHARM_SRC_DIR)/%
docker build -t $(CHARM_DOCKER_TAG) .
docker run -u $$(id -u):$$(id -g) -v$$(pwd):$$(pwd) -w$$(pwd) $(CHARM_DOCKER_TAG) charm-build -o $(BUILD_DIR) $<
+else
+$(CHARM_BUILD_DIR)/%: $(CHARM_SRC_DIR)/%
+ charm-build -o $(BUILD_DIR) $<
+endif
$(DESCRIPTOR_DIR)/vnfd/pong_vnf/build/%.tar.gz:
$(MAKE) -C $(DESCRIPTOR_DIR)/vnfd/pong_vnf
-$(DESCRIPTOR_DIR)/vnfd/ping_pong_ns/build/%.tar.gz:
+$(DESCRIPTOR_DIR)/nsd/ping_pong_ns/build/%.tar.gz:
$(MAKE) -C $(DESCRIPTOR_DIR)/nsd/ping_pong_ns
-ping_pong: check_OSM_HOSTNAME check_openstack_env
+ping_pong: check_OSM_HOSTNAME check_openstack_env \
+ $(DESCRIPTOR_DIR)/vnfd/ping_vnf/build/ping_vnf.tar.gz \
+ $(DESCRIPTOR_DIR)/vnfd/pong_vnf/build/pong_vnf.tar.gz \
+ $(DESCRIPTOR_DIR)/nsd/ping_pong_ns/build/ping_pong_ns.tar.gz
$(Q)$(MAKE) \
- TEST_VNFD_DESCRIPTORS="$(DESCRIPTOR_DIR)/vnfd/ping_vnf/build/ping_vnf.tar.gz $(DESCRIPTOR_DIR)/vnfd/pong_vnf/build/pong_vnf.tar.gz" \
+ TEST_VNFD_DESCRIPTORS="$(DESCRIPTOR_DIR)/vnfd/ping_vnf/build/ping_vnf.tar.gz,$(DESCRIPTOR_DIR)/vnfd/pong_vnf/build/pong_vnf.tar.gz" \
TEST_NSD_DESCRIPTORS=$(DESCRIPTOR_DIR)/nsd/ping_pong_ns/build/ping_pong_ns.tar.gz \
JUNITXML=pytest-$@.xml \
PYTEST_OPTIONS="$(PYTEST_OPTIONS) -m vnf" _run_test