Skip to content

Commit 0b5dbb6

Browse files
Zachary_KniebelZachary_Kniebel
authored andcommitted
Merge branch 'version/1.1' into release
2 parents 13f7fa4 + 7119227 commit 0b5dbb6

File tree

8 files changed

+42
-26
lines changed

8 files changed

+42
-26
lines changed

app/plugins/completion_handlers/AWS_S3/s3-deploy-handler.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ const COMPLETIONHANDLER_ID = "AWS_S3";
4545
* Executes the completion handler with the given output directory path
4646
* @param {string} outputDirectoryPath the path to the output directory
4747
* @param {object} configurationLoader the configuration loader module
48+
* @param {object} metaball holds the metadata from the generation
4849
* @param {object} logger the logger
49-
* @param {Array<*>} params array of custom parameters
50+
* @param {Array<*>} params custom parameters object
5051
*/
51-
var _execute = function (outputDirectoryPath, configurationLoader, logger, params) {
52+
var _execute = function (outputDirectoryPath, configurationLoader, metaball, logger, params) {
5253
logger.info(`Executing AWS S3 Deployment Completion Handler on output path "${outputDirectoryPath}"`);
5354

5455
const configuration = configurationLoader.getConfiguration();
@@ -59,16 +60,15 @@ var _execute = function (outputDirectoryPath, configurationLoader, logger, param
5960
async_concurrency = 250;
6061
}
6162

62-
var options = params[0];
63-
if (!options || !(options.AccessKeyId && options.SecretAccessKey && options.S3BucketName && options.S3FolderPath)) {
64-
logger.error("Error while executing the AWS S3 Deployment Completion Handler. A JSON argument must be passed with the AccessKeyId, SecretAccessKey, S3BucketName, and S3FolderPath properties set.");
63+
if (!params || !(params.AccessKeyId && params.SecretAccessKey && params.S3BucketName && params.S3FolderPath)) {
64+
logger.error("Error while executing the AWS S3 Deployment Completion Handler. A \"Params\" object must be passed with the AccessKeyId, SecretAccessKey, S3BucketName, and S3FolderPath properties set.");
6565
return;
6666
}
6767

68-
const accessKeyId = options.AccessKeyId;
69-
const secretAccessKey = options.SecretAccessKey;
70-
const s3BucketName = options.S3BucketName;
71-
const s3FolderPath = options.S3FolderPath;
68+
const accessKeyId = params.AccessKeyId;
69+
const secretAccessKey = params.SecretAccessKey;
70+
const s3BucketName = params.S3BucketName;
71+
const s3FolderPath = params.S3FolderPath;
7272

7373
// initialize S3 client
7474
const s3 = new AWS.S3({

app/plugins/completion_handlers/Azure_ABS/abs-deploy-handler.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ const COMPLETIONHANDLER_ID = "Azure_ABS";
4545
* Executes the completion handler with the given output directory path
4646
* @param {string} outputDirectoryPath the path to the output directory
4747
* @param {object} configurationLoader the configuration loader module
48+
* @param {object} metaball holds the metadata from the generation
4849
* @param {object} logger the logger
49-
* @param {Array<*>} params array of custom parameters
50+
* @param {Array<*>} params custom parameters object
5051
*/
51-
var _execute = function (outputDirectoryPath, configurationLoader, logger, params) {
52+
var _execute = function (outputDirectoryPath, configurationLoader, metaball, logger, params) {
5253
logger.info(`Executing Azure Blob Storage Deployment Completion Handler on output path "${outputDirectoryPath}"`);
5354

5455
const configuration = configurationLoader.getConfiguration();
@@ -59,15 +60,14 @@ var _execute = function (outputDirectoryPath, configurationLoader, logger, param
5960
async_concurrency = 250;
6061
}
6162

62-
var options = params[0];
63-
if (!options || !(options.AzureStorageAccountConnectionString && options.AzureStorageContainer)) {
64-
logger.error("Error while executing the Azure Blob Storage Deployment Completion Handler. A JSON argument must be passed with the AzureStorageAccountConnectionString and AzureStorageContainer properties set.");
63+
if (!params || !(params.AzureStorageAccountConnectionString && params.AzureStorageContainer)) {
64+
logger.error("Error while executing the Azure Blob Storage Deployment Completion Handler. A \"Params\" object must be passed with the AzureStorageAccountConnectionString and AzureStorageContainer properties set.");
6565
return;
6666
}
6767

68-
const azureStorageAccountConnectionString = options.AzureStorageAccountConnectionString;
69-
const azureStorageContainer = options.AzureStorageContainer;
70-
const azureStorageTargetDirectory = options.AzureStorageTargetDirectory || "";
68+
const azureStorageAccountConnectionString = params.AzureStorageAccountConnectionString;
69+
const azureStorageContainer = params.AzureStorageContainer;
70+
const azureStorageTargetDirectory = params.AzureStorageTargetDirectory || "";
7171

7272
// initialize the retry policy
7373
var retryOperations = new azure.LinearRetryPolicyFilter();

app/plugins/completion_handlers/Example/helloWorld.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ const COMPLETIONHANDLER_ID = "helloWorld!";
3535
* Executes the completion handler with the given output directory path
3636
* @param {string} outputDirectoryPath the path to the output directory
3737
* @param {object} configurationLoader the configuration loader module
38+
* @param {object} metaball holds the metadata from the generation
3839
* @param {object} logger the logger
39-
* @param {Array<*>} params array of custom parameters
40+
* @param {Array<*>} params custom parameters object
4041
*/
41-
var _execute = function (outputDirectoryPath, configurationLoader, logger, params) {
42+
var _execute = function (outputDirectoryPath, configurationLoader, metaball, logger, params) {
4243
logger.info(`hello World! Output path is: "${outputDirectoryPath}"`);
4344

4445
// your logic here

app/plugins/completion_handlers/MSTeams_Notifier/msteams-notifier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const COMPLETIONHANDLER_ID = "MSTeams_Notifier";
4040
* @param {object} configurationLoader the configuration loader module
4141
* @param {object} metaball holds the metadata from the generation
4242
* @param {object} logger the logger
43-
* @param {Array<*>} params array of custom parameters
43+
* @param {Array<*>} params custom parameters object
4444
*/
4545
var _execute = function (outputDirectoryPath, configurationLoader, metaball, logger, params) {
4646
if (!params || !params.Url) {

app/plugins/completion_handlers/Slack_Notifier/slack-notifier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const COMPLETIONHANDLER_ID = "Slack_Notifier";
4040
* @param {object} configurationLoader the configuration loader module
4141
* @param {object} metaball holds the metadata from the generation
4242
* @param {object} logger the logger
43-
* @param {Array<*>} params array of custom parameters
43+
* @param {Array<*>} params custom parameters object
4444
*/
4545
var _execute = function (outputDirectoryPath, configurationLoader, metaball, logger, params) {
4646
if (!params || !params.Url) {

middlemen/RabbitMQ/SitecoreDXG__RabbitMQ_Middleman__TeamCity_MetaRunner.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<param name="env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.ConnectionString" value="" spec="text display='normal' description='The RabbitMQ connection string that you wish to use to connect to RabbitMQ (e.g. amqp://localhost)' label='RabbitMQ Connection String' validationMode='not_empty'" />
77
<param name="env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.GenerationQueueName" value="" spec="text display='normal' description='The name of the generation queue that you want to submit the serialized architecture queue; by default, the queue that you choose determines the generation action that should occur; the available default queues are the generation_queue__documentation queue (generate HTML documentation) and the generation_queue__mdj queue (generate MDJ file only).' label='Generation Queue Name' validationMode='not_empty'" />
88
<param name="env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.ArchitectureGetUrl" value="" spec="text display='normal' description='SitecoreUML Service URL for getting the serialized template architecture of the host Sitecore solution (generally http://&lt;sitecore_url&gt;/sitecoreuml/sitecoredxg/GetTemplateArchitecture)' label='Architecture GET URL' validationMode='not_empty'" />
9-
<param name="env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.CompletionHandlerData" value="" spec="text description='(Optional) JSON-formatted string array of the completion handler data objects with the handler ID and parameters; Should have the following syntax: |'|[{\&quot;ID\&quot;:\&quot;MyHandler1\&quot;,\&quot;Params\&quot;:|[1,2,\&quot;foo\&quot;,\&quot;bar\&quot;|]},{\&quot;ID\&quot;:\&quot;MyHandler2\&quot;}|]|'' label='Completion Handler Data' validationMode='any' display='normal'" />
9+
<param name="env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.OptionsData" value="" spec="text description='(Optional) JSON-formatted string array of the optional DocumentationConfiguration and CompletionHandlers data objects; completion handler objects must have the handler ID and parameters; Should have the following syntax: |'{\&quot;DocumentationConfiguration\&quot;:{\&quot;CommitAuthor\&quot;:\&quot;...\&quot;,\&quot;CommitHash\&quot;:\&quot;...\&quot;,\&quot;EnvironmentName\&quot;:\&quot;UAT\&quot;,\&quot;ProjectName\&quot;:\&quot;...\&quot;,\&quot;DeployLink\&quot;:\&quot;http://...\&quot;},\&quot;CompletionHandlers\&quot;:|[{\&quot;ID\&quot;:\&quot;MyHandler1\&quot;,\&quot;Params\&quot;:{\&quot;foo\&quot;:\&quot;bar\&quot;},{\&quot;ID\&quot;:\&quot;MyHandler2\&quot;}|]|'' label='Completion Handler Data' validationMode='any' display='normal'" />
1010
<param name="env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.ScriptPath" value="" spec="text display='normal' description='The path to the middleman script file on the TeamCity server (customizable for extensibility purposes)' label='Middleman Script Path' validationMode='not_empty'" />
1111
</parameters>
1212
<build-runners>
@@ -26,7 +26,7 @@ Write-Output "Dependencies installed"
2626
2727
Write-Output "Calling SitecoreDXG Middleman..."
2828
29-
node %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.ScriptPath% %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.ConnectionString% %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.ArchitectureGetUrl% %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.GenerationQueueName% %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.CompletionHandlerData%
29+
node %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.ScriptPath% %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.ConnectionString% %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.ArchitectureGetUrl% %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.GenerationQueueName% %env.SitecoreDXG.Middlemen.RabbitMQ_AMQP.OptionsData% true
3030
3131
Write-Output "Finished calling SitecoreDXG Middleman..."]]></param>
3232
<param name="jetbrains_powershell_script_mode" value="CODE" />

middlemen/RabbitMQ/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"license": "ISC",
1212
"dependencies": {
1313
"amqplib": "^0.5.2",
14+
"extend": "^3.0.2",
1415
"request": "^2.88.0"
1516
}
1617
}

middlemen/RabbitMQ/rabbitmq-amqp-middleman.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
// third-party
2020
const amqp = require('amqplib/callback_api');
2121
const request = require('request');
22+
const extend = require("extend");
2223

2324
/* EXECUTION */
2425

@@ -64,7 +65,7 @@ amqp.connect(connectionString, function(err, conn) {
6465

6566
request(jsonGetUrl, (err, res, data) => {
6667
if (err) {
67-
return console.error(err);
68+
console.error(err);
6869
_exitProgram(process, 1, conn);
6970
}
7071

@@ -74,8 +75,21 @@ amqp.connect(connectionString, function(err, conn) {
7475
_exitProgram(process, 1, conn);
7576
}
7677
if (args.length > 3) {
77-
var completionHandlers = args[3];
78-
json.Data.CompletionHandlers = JSON.parse(completionHandlers);
78+
var options = args[3];
79+
// replace space codes with spaces (for powershell support)
80+
options = args.length > 4 && args[4] == "true"
81+
? options.replace("&nbsp;", " ")
82+
: options;
83+
84+
var parsedOptions = JSON.parse(options);
85+
if (parsedOptions.CompletionHandlers) {
86+
json.Data.CompletionHandlers = parsedOptions.CompletionHandlers;
87+
}
88+
if (parsedOptions.DocumentationConfiguration) {
89+
json.Data.DocumentationConfiguration =
90+
extend(true, json.Data.DocumentationConfiguration, parsedOptions.DocumentationConfiguration);
91+
}
92+
7993
data = JSON.stringify(json);
8094
}
8195

0 commit comments

Comments
 (0)