Skip to content

Commit

Permalink
[New task] To create a dynamic resource on runtime (#11530)
Browse files Browse the repository at this point in the history
* [New task] To create a dynamic resource on runtime

* updating package

* Renaming task to ReviewAppV0

* Resolving comments
  • Loading branch information
thesattiraju authored and leantk committed Dec 23, 2019
1 parent 1ae43e3 commit f907e16
Show file tree
Hide file tree
Showing 18 changed files with 3,986 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ Tasks/QueryWorkItemsV0/* @bansalaseem

Tasks/QuickPerfTestV1/* @SadagopanRajaram @ShreyasRmsft

Tasks/ReviewAppV0/* @ds-ms

Tasks/RunDistributedTestsV1/* @SadagopanRajaram @ShreyasRmsft

Tasks/RunJMeterLoadTestV1/* @SadagopanRajaram @ShreyasRmsft
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"loc.friendlyName": "Review App",
"loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613735)",
"loc.description": "Use this task under deploy phase provider to create a resource dynamically",
"loc.instanceNameFormat": "Dynamic Resource created using - $(resourceName)",
"loc.releaseNotes": "Use this task under deploy phase provider to create a resource dynamically",
"loc.input.label.resourceName": "Resource name",
"loc.input.help.resourceName": "Name of an existing resource in the environment which will be used for resource type information",
"loc.input.label.baseEnvironmentName": "Environment name",
"loc.input.label.reviewResourceName": "Review Resource Name",
"loc.messages.CreatedDynamicResource": "A dynamic resource is created using %s"
}
Binary file added Tasks/ReviewAppV0/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Tasks/ReviewAppV0/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Tasks/ReviewAppV0/make.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
73 changes: 73 additions & 0 deletions Tasks/ReviewAppV0/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Tasks/ReviewAppV0/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "dynamic-resource-task",
"version": "1.0.0",
"description": "Azure Pipelines Dynamic Resource Task",
"main": "run.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Microsoft/azure-pipelines-tasks.git"
},
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Microsoft/azure-pipelines-tasks/issues"
},
"homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme",
"dependencies": {
"azure-pipelines-task-lib": "2.9.3"
}
}
15 changes: 15 additions & 0 deletions Tasks/ReviewAppV0/run.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

import * as tl from 'azure-pipelines-task-lib';
import * as path from 'path';

async function run() {
try {
tl.setResourcePath(path.join(__dirname, 'task.json'));
const source = tl.getInput('resourceName', true);
console.log(tl.loc('CreatedDynamicResource', source));
} catch (err) {
tl.setResult(tl.TaskResult.Failed, err.message || 'run() failed', true);
}
}

run();
58 changes: 58 additions & 0 deletions Tasks/ReviewAppV0/task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"id": "DEEAFED4-0B18-4F58-968D-86655B4D2CE9",
"name": "ReviewApp",
"friendlyName": "Review App",
"description": "Use this task under deploy phase provider to create a resource dynamically",
"helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613735)",
"category": "Utility",
"preview": true,
"visibility": [
"Build"
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 0,
"Patch": 1
},
"releaseNotes": "Use this task under deploy phase provider to create a resource dynamically",
"inputs": [
{
"name": "resourceName",
"type": "string",
"label": "Resource name",
"required": true,
"defaultValue": "",
"helpMarkDown": "Name of an existing resource in the environment which will be used for resource type information"
},
{
"name": "baseEnvironmentName",
"type": "string",
"label": "Environment name",
"required": false,
"defaultValue": ""
},
{
"name": "reviewResourceName",
"type": "string",
"label": "Review Resource Name",
"required": false,
"defaultValue": ""
}

],
"instanceNameFormat": "Dynamic Resource created using - $(resourceName)",
"execution": {
"Node": {
"target": "run.js",
"argumentFormat": ""
}
},
"messages": {
"CreatedDynamicResource": "A dynamic resource is created using %s"
}
}
57 changes: 57 additions & 0 deletions Tasks/ReviewAppV0/task.loc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"id": "DEEAFED4-0B18-4F58-968D-86655B4D2CE9",
"name": "ReviewApp",
"friendlyName": "ms-resource:loc.friendlyName",
"description": "ms-resource:loc.description",
"helpMarkDown": "ms-resource:loc.helpMarkDown",
"category": "Utility",
"preview": true,
"visibility": [
"Build"
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 0,
"Patch": 1
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"inputs": [
{
"name": "resourceName",
"type": "string",
"label": "ms-resource:loc.input.label.resourceName",
"required": true,
"defaultValue": "",
"helpMarkDown": "ms-resource:loc.input.help.resourceName"
},
{
"name": "baseEnvironmentName",
"type": "string",
"label": "ms-resource:loc.input.label.baseEnvironmentName",
"required": false,
"defaultValue": ""
},
{
"name": "reviewResourceName",
"type": "string",
"label": "ms-resource:loc.input.label.reviewResourceName",
"required": false,
"defaultValue": ""
}
],
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
"execution": {
"Node": {
"target": "run.js",
"argumentFormat": ""
}
},
"messages": {
"CreatedDynamicResource": "ms-resource:loc.messages.CreatedDynamicResource"
}
}
6 changes: 6 additions & 0 deletions Tasks/ReviewAppV0/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs"
}
}
8 changes: 8 additions & 0 deletions Tasks/ReviewAppV0/typings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "vsts-cmdline-task",
"dependencies": {},
"globalDependencies": {
"node": "registry:dt/node#6.0.0+20160920093002",
"q": "registry:dt/q#0.0.0+20160613154756"
}
}
Loading

0 comments on commit f907e16

Please sign in to comment.