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" } ] } 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 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