From 3c6101b452fdb6b6ef762becc6d8101b5d582d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20J=C3=A4ger?= Date: Tue, 21 Feb 2023 16:50:07 +0100 Subject: [PATCH] Feature: allow custom services With this PR you can add services to your environemt, by adding them to the services section in deploy.yml. Necessary templates have to be added at project level in directory config/custom-services-templates. --- bin/command/install/bootstrap.sh | 2 ++ generator/index.php | 1 + 2 files changed, 3 insertions(+) diff --git a/bin/command/install/bootstrap.sh b/bin/command/install/bootstrap.sh index 090d841d0..dc5f1635e 100644 --- a/bin/command/install/bootstrap.sh +++ b/bin/command/install/bootstrap.sh @@ -46,6 +46,7 @@ function Command::bootstrap() { local defaultProjectYaml=$([ -f "./deploy.local.yml" ] && echo -n "./deploy.local.yml" || echo -n "./deploy.yml") local projectYaml=${1:-${defaultProjectYaml}} local projectDeployTemplatesDirectory="./config/deploy-templates/" + local customServicesTemplatesDirectory="./config/custom-services-templates/" if [ -n "${SKIP_BOOTSTRAP_IF_DONE}" ] && [ -f "${DESTINATION_DIR}/project.yml" ]; then if cmp -s "${DESTINATION_DIR}/project.yml" "${projectYaml}"; then @@ -67,6 +68,7 @@ function Command::bootstrap() { rm -rf "${tmpDeploymentDir}" fi mkdir "${tmpDeploymentDir}" + mkdir "${tmpDeploymentDir}/project-deploy-templates" tmpDeploymentDir="$(cd "${tmpDeploymentDir}" >/dev/null 2>&1 && pwd)" diff --git a/generator/index.php b/generator/index.php index caaebf7dd..f7fa00c94 100644 --- a/generator/index.php +++ b/generator/index.php @@ -26,6 +26,7 @@ $loaders = new ChainLoader([ new FilesystemLoader(APPLICATION_SOURCE_DIR . DS . 'templates'), new FilesystemLoader($deploymentDir), + new FilesystemLoader($deploymentDir . DS . 'project-deploy-templates'), ]); $twig = new Environment($loaders); $nginxVarEncoder = new class() {