From 9ff85788c4e3166d621d5b13fb9fdc08e17868c6 Mon Sep 17 00:00:00 2001 From: Ross Murray Date: Thu, 4 Feb 2021 11:27:32 +1100 Subject: [PATCH 1/3] feat: incl diagrams plugin by default The Hamlet Diagrams plugin is being incorporated into the CLI in hamlet-io/executor-python#75 This adds the diagrams plugin repository into the list of cloned- repositories that are injected into the docker container on build, ensuring that it will be available for the CLI to use. --- config.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.json b/config.json index 1919fe1..4946f57 100644 --- a/config.json +++ b/config.json @@ -27,6 +27,10 @@ { "Repository" : "https://github.com/hamlet-io/engine-plugin-aws.git", "Directory" : "/opt/hamlet/engine/plugins/aws" + }, + { + "Repository" : "https://github.com/hamlet-io/engine-plugin-diagrams.git", + "Directory" : "/opt/hamlet/engine/plugins/diagrams" } ] } From 0683ea334537d30c8b08ed3c560461f87f0cfb37 Mon Sep 17 00:00:00 2001 From: Ross Murray Date: Thu, 4 Feb 2021 11:38:09 +1100 Subject: [PATCH 2/3] refactor: incl container env path to diagrams plugin --- images/stretch/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/stretch/Dockerfile b/images/stretch/Dockerfile index e49ec4e..2b2d724 100644 --- a/images/stretch/Dockerfile +++ b/images/stretch/Dockerfile @@ -18,7 +18,7 @@ ENV AUTOMATION_BASE_DIR=/opt/hamlet/executor/automation \ GENERATION_BASE_DIR=/opt/hamlet/executor \ GENERATION_DIR=/opt/hamlet/executor/cli \ GENERATION_ENGINE_DIR=/opt/hamlet/engine/core \ - GENERATION_PLUGIN_DIRS=/opt/hamlet/engine/plugins/aws;/opt/hamlet/engine/plugins/azure \ + GENERATION_PLUGIN_DIRS=/opt/hamlet/engine/plugins/aws;/opt/hamlet/engine/plugins/azure;/opt/hamlet/engine/plugins/diagrams \ GENERATION_STARTUP_DIR=/opt/hamlet/startup \ GENERATION_PATTERNS_DIR=/opt/hamlet/patterns From 5dab430b426df8d85ec1ef7dec53b402b050fa56 Mon Sep 17 00:00:00 2001 From: Ross Murray Date: Thu, 4 Feb 2021 12:53:54 +1100 Subject: [PATCH 3/3] refactor: allow for default repo branch as master or main --- scripts/base/build_hamlet.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 scripts/base/build_hamlet.sh diff --git a/scripts/base/build_hamlet.sh b/scripts/base/build_hamlet.sh old mode 100644 new mode 100755 index a039f00..25b4356 --- a/scripts/base/build_hamlet.sh +++ b/scripts/base/build_hamlet.sh @@ -7,7 +7,11 @@ if [[ "${HAMLET_VERSION}" == "latest" ]]; then fi # Create the Git clone commands to get the Repositories -jq -r '.Repositories[] | "git clone --depth 1 --branch \(env.HAMLET_VERSION) \(.Repository) \(.Directory)" ' /build/scripts/clone.sh +# note: original hamlet-io repositories use "master" as default branch +# whilst the modern approach is to use "main" as default. +# This checks for the existence of the HAMLET_VERSION branch and +# if it does not exist, it attempts "main" instead. +jq -r '.Repositories[] | "git ls-remote --heads \(.Repository) \(env.HAMLET_VERSION) && git clone --depth 1 --branch \(env.HAMLET_VERSION) \(.Repository) \(.Directory) || git ls-remote --heads \(.Repository) main && git clone --depth 1 --branch main \(.Repository) \(.Directory)" ' /build/scripts/clone.sh chmod u+rwx /build/scripts/clone.sh # Create the Version file from the config