Skip to content

Commit 224f3d7

Browse files
authored
Merge pull request #28 from rundeck-plugins/azure-log-store-enterprise-duplicate-container
RUN-1024: Azure Log Storage generates duplicated folder for executions
2 parents cdfaf7a + 052212e commit 224f3d7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/groovy/com/rundeck/plugins/azure/plugin/AzureFileStoragePlugin.groovy

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ class AzureFileStoragePlugin implements ExecutionFileStoragePlugin, ExecutionMul
6767
)
6868
private String path
6969

70+
@PluginProperty(
71+
title = "Container Name",
72+
description = "(Optional) Define the container name where the logs will be saved. If not set, it'll be obtained from `path` property. Eg: If the path=\"project/\${job.project}/\${job.execid}\" then the containerName property will be \"project\""
73+
)
74+
protected String containerName = null
7075

7176
Map<String, ?> context;
7277
CloudBlobClient serviceClient
@@ -120,13 +125,10 @@ class AzureFileStoragePlugin implements ExecutionFileStoragePlugin, ExecutionMul
120125
serviceClient = account.createCloudBlobClient();
121126

122127
// Container name must be lower case.
123-
String containerName = expandedPath.substring(0,expandedPath.indexOf("/")).toLowerCase()
128+
this.containerName = this.containerName ? this.containerName.toLowerCase : expandedPath.substring(0,expandedPath.indexOf("/")).toLowerCase()
129+
124130
container = serviceClient.getContainerReference(containerName)
125131
container.createIfNotExists()
126-
127-
128-
129-
130132
}
131133

132134
@Override

0 commit comments

Comments
 (0)