Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New task] To create a dynamic resource on runtime #11530

Merged
merged 7 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"loc.friendlyName": "Dynamic Resource",
"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 - $(source)",
thesattiraju marked this conversation as resolved.
Show resolved Hide resolved
"loc.releaseNotes": "Use this task under deploy phase provider to create a resource dynamically",
"loc.input.label.baseEnvironmentName": "Environment name",
"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.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();
60 changes: 60 additions & 0 deletions Tasks/ReviewAppV0/task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"id": "DEEAFED4-0B18-4F58-968D-86655B4D2CE9",
"name": "ReviewApp",
thesattiraju marked this conversation as resolved.
Show resolved Hide resolved
"friendlyName": "Dynamic Resource",
"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",
"visibility": [
"Build",
"Release"
],
"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": "baseEnvironmentName",
"type": "string",
"label": "Environment name",
"required": false,
"defaultValue": "",
"helpMarkDown": ""
},
{
thesattiraju marked this conversation as resolved.
Show resolved Hide resolved
"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": "reviewResourceName",
"type": "string",
"label": "Review Resource Name",
"required": false,
"defaultValue": "",
"helpMarkDown": ""
thesattiraju marked this conversation as resolved.
Show resolved Hide resolved
}

],
"instanceNameFormat": "Dynamic Resource - $(source)",
thesattiraju marked this conversation as resolved.
Show resolved Hide resolved
"execution": {
"Node": {
"target": "run.js",
"argumentFormat": ""
}
},
"messages": {
"CreatedDynamicResource": "A dynamic resource is created using %s"
}
}
59 changes: 59 additions & 0 deletions Tasks/ReviewAppV0/task.loc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"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",
"visibility": [
"Build",
"Release"
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 0,
"Patch": 1
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"inputs": [
{
"name": "baseEnvironmentName",
"type": "string",
"label": "ms-resource:loc.input.label.baseEnvironmentName",
"required": false,
"defaultValue": "",
"helpMarkDown": ""
},
{
"name": "resourceName",
"type": "string",
"label": "ms-resource:loc.input.label.resourceName",
"required": true,
"defaultValue": "",
"helpMarkDown": "ms-resource:loc.input.help.resourceName"
},
{
"name": "reviewResourceName",
"type": "string",
"label": "ms-resource:loc.input.label.reviewResourceName",
"required": false,
"defaultValue": "",
"helpMarkDown": ""
}
],
"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