From 5b756337b11fd761c97f5a316b830f7403cab788 Mon Sep 17 00:00:00 2001 From: xxkel-sd <104493712+xxkel-sd@users.noreply.github.com> Date: Wed, 15 Jun 2022 08:14:02 +0200 Subject: [PATCH] Allow multiple configurations for tentacle (OctopusDeploy #377) --- docker/linux/scripts/configure-tentacle.sh | 28 +++++++++++++++------- docker/readme.md | 9 +++++++ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/docker/linux/scripts/configure-tentacle.sh b/docker/linux/scripts/configure-tentacle.sh index f78b5f177..5008c129e 100644 --- a/docker/linux/scripts/configure-tentacle.sh +++ b/docker/linux/scripts/configure-tentacle.sh @@ -212,15 +212,25 @@ function registerTentacle() { tentacle "${ARGS[@]}" } -echo "===============================================" -echo "Configuring Octopus Deploy Tentacle" - -validateVariables - -echo "===============================================" - -configureTentacle -registerTentacle +if [[ -z "${ConfigDir}" ]]; then + echo "===============================================" + echo "Configuring Octopus Deploy Tentacle" + validateVariables + echo "===============================================" + configureTentacle + registerTentacle +else + echo "===============================================" + echo "Configuring Octopus Deploy Tentacle" + echo "===============================================" + configureTentacle + for filename in $(realpath ${CONFIG_DIR}/*.conf); do + echo "processing $filename" + . $filename + validateVariables + registerTentacle + done +fi touch $alreadyConfiguredSemaphore diff --git a/docker/readme.md b/docker/readme.md index 5bc9aaf40..6ad66fd61 100644 --- a/docker/readme.md +++ b/docker/readme.md @@ -59,6 +59,15 @@ docker run --publish 10931:10933 --tty --interactive --env "ListeningPort=10931" - **ListeningPort**: The port that the Octopus Server will connect back to the Tentacle with. Defaults to 10933. Implies a listening Tentacle. - **PublicHostNameConfiguration**: How the url that the Octopus server will use to communicate with the Tentacle is determined. Can be `PublicIp`, `FQDN`, `ComputerName` or `Custom`. Defaults to `PublicIp`. - **CustomPublicHostName**: If `PublicHostNameConfiguration` is set to `Custom`, the host name that the Octopus Server should use to communicate with the Tentacle. +- **ConfigDir**: If specified all files matching *.conf in this directory will be used for configuring the tentacle. Each .conf file allows overriding the environment variables specified for the container. If there's no override the environment variable for the container will be used. This will allow for multiple configurations of the same tentacle and could be used for registering the same tentacle in multiple spaces. + +#### Example on a .conf file: +``` +Space=MySpace +TargetName=Testing +TargetWorkerPool=MyWorkerPool +``` + ### Ports