Small refactoring for generating the Dockerfile for deployments
@@ -64,11 +64,10 @@ function(deploy_docker)
set_target_properties(${DEPLOY_TARGET} PROPERTIES "DEPLOY_DOCKERFILE_WORK_DIR" "${DOCKER_WORK_DIR}") #workdir in docker image, should also contain the config.properties
set_target_properties(${DEPLOY_TARGET} PROPERTIES "DEPLOY_DOCKERFILE_INSTRUCTIONS" "") #list of additional instructions
- set(STAGE1 "${CMAKE_CURRENT_BINARY_DIR}/${DEPLOY_TARGET}-Dockerfile-stage1")
set(DOCKERFILE "$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_LOCATION>/Dockerfile")
file(GENERATE
- OUTPUT "${STAGE1}"
+ OUTPUT "${DOCKERFILE}"
CONTENT "# Dockerfile for inaetics/celix-node-agent-service
FROM $<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_DOCKERFILE_FROM>
@@ -76,18 +75,13 @@ FROM $<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_DOCKERFILE_FROM>
ENV IMAGE_NAME $<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_DOCKERFILE_IMAGE_NAME>
#add bundles, properties and set workdir
-COPY $<JOIN:$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_BUNDLES>, > $<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_DOCKERFILE_BUNDLES_DIR>
+COPY bundles/*.zip $<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_DOCKERFILE_BUNDLES_DIR>
COPY config.properties $<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_DOCKERFILE_WORK_DIR>
WORKDIR $<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_DOCKERFILE_WORK_DIR>
$<JOIN:$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_DOCKERFILE_INSTRUCTIONS>,
>
")
- file(GENERATE
- OUTPUT "${DOCKERFILE}"
- INPUT "${STAGE1}"
- )
-
get_target_property(DEPS dockerfiles "DOCKER_FILES_DEPS")
list(APPEND DEPS "${DOCKERFILE}")
set_target_properties(dockerfiles PROPERTIES "DOCKER_FILES_DEPS" "${DEPS}")
