Allow docker image build without submodules access.
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 20 Oct 2020 20:07:00 +0000 (22:07 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 20 Oct 2020 20:07:00 +0000 (22:07 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
docker/Makefile

index d3eefbc01330c2219f9bb6267d57619186f307cc..c82d604a1f9813507c3226d93ac5164647ce578f 100644 (file)
@@ -1,5 +1,6 @@
 PROJECT_NAME?=evse
 NAME:=simulator
+SUBMODULES_INIT?=true
 DOCKER_ECR_ACCOUNT_ID?=166296450311
 DOCKER_ECR_REGION?=eu-west-3
 DOCKER_ECR_REGISTRY_NAME?=ev_simulator
@@ -12,10 +13,15 @@ default: all
 submodule-update:
        git submodule update --init --recursive
 
-$(NAME): submodule-update
+submodules-init=
+ifeq '$(SUBMODULES_INIT)' 'true'
+       submodules-init += submodule-update
+endif
+
+$(NAME): $(submodules-init)
        docker-compose -p $(PROJECT_NAME) up -d
 
-$(NAME)-force: submodule-update
+$(NAME)-force: $(submodules-init)
        docker-compose -p $(PROJECT_NAME) up -d --build --force-recreate
 
 all: $(NAME)