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

Added Missing commands in HelmDeployV1 #20815

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -36,6 +36,8 @@
"loc.input.help.chartName": "Chart reference to install, this can be a url or a chart name. For example, if chart name is 'stable/mysql', the task will run 'helm install stable/mysql'.",
"loc.input.label.chartPath": "Chart Path",
"loc.input.help.chartPath": "Path to the chart to install. This can be a path to a packaged chart or a path to an unpacked chart directory. For example, if './redis' is specified the task will run 'helm install ./redis'.",
"loc.input.label.remoteRepo": "Remote Repo",
"loc.input.help.remoteRepo": "The remote repository where the chart will be pushed.",
"loc.input.label.version": "Version",
"loc.input.help.version": "Specify the exact chart version to install. If this is not specified, the latest version is installed. Set the version on the chart to this semver version​",
"loc.input.label.releaseName": "Release Name",
Expand Down
66 changes: 66 additions & 0 deletions Tasks/HelmDeployV1/package-lock.json

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

6 changes: 5 additions & 1 deletion Tasks/HelmDeployV1/src/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ async function runHelm(helmCli: helmcli, command: string, kubectlCli: kubernetes
"package": "./helmcommands/helmpackage",
"push": "./helmcommands/helmpush",
"registry": "./helmcommands/helmregistrylogin",
"upgrade": "./helmcommands/helmupgrade"
"upgrade": "./helmcommands/helmupgrade",
"rollback": "./helmcommands/helmrollback",
"uninstall": "./helmcommands/helmuninstall",
"delete": "./helmcommands/helmuninstall",
"create": "./helmcommands/helmcreate",
}

var commandImplementation = require("./helmcommands/uinotimplementedcommands");
Expand Down
11 changes: 11 additions & 0 deletions Tasks/HelmDeployV1/src/helmcommands/helmcreate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use strict";

import tl = require('azure-pipelines-task-lib/task');
import helmcli from "./../helmcli";

export async function addArguments(helmCli: helmcli) : Promise<void> {

var chartName = tl.getInput("chartName", true);

helmCli.addArgument(chartName);
}
5 changes: 4 additions & 1 deletion Tasks/HelmDeployV1/src/helmcommands/helmpush.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Pushes a helm chart to ACR
*/

export async function addArguments(helmCli: helmcli): Promise<void> {
helmCli.addArgument("push");
helmCli.setCommand("push");

helmCli.addArgument(tl.getVariable("helmChartRef"));
helmCli.addArgument(tl.getInput("chartPath" , true));
helmCli.addArgument(tl.getInput("remoteRepo" , true));

}
16 changes: 16 additions & 0 deletions Tasks/HelmDeployV1/src/helmcommands/helmrollback.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use strict";

import tl = require('azure-pipelines-task-lib/task');
import helmcli from "../helmcli";

export async function addArguments(helmCli: helmcli) : Promise<void> {

var releaseName = tl.getInput("releaseName", true);
var namespace = tl.getInput("namespace", true);

helmCli.addArgument(releaseName);

if (namespace) {
helmCli.addArgument("--namespace ".concat(namespace));
}
}
16 changes: 16 additions & 0 deletions Tasks/HelmDeployV1/src/helmcommands/helmuninstall.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use strict";

import tl = require('azure-pipelines-task-lib/task');
import helmcli from "../helmcli";

export async function addArguments(helmCli: helmcli): Promise<void> {
var releaseName = tl.getInput("releaseName", true);
var namespace = tl.getInput("namespace" , false);

helmCli.addArgument(releaseName);

if (namespace) {
helmCli.addArgument("--namespace ".concat(namespace));
}

}
19 changes: 15 additions & 4 deletions Tasks/HelmDeployV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 1,
"Minor": 252,
"Patch": 1
"Patch": 2
},
"demands": [],
"groups": [
Expand Down Expand Up @@ -180,6 +180,7 @@
"login": "login",
"logout": "logout",
"ls": "ls",
"push": "push",
"package": "package",
"rollback": "rollback",
"upgrade": "upgrade",
Expand Down Expand Up @@ -214,7 +215,7 @@
"type": "string",
"helpMarkDown": "Chart reference to install, this can be a url or a chart name. For example, if chart name is 'stable/mysql', the task will run 'helm install stable/mysql'.",
"defaultValue": "",
"visibleRule": "chartType == Name",
"visibleRule": "chartType == Name || command == create ",
"required": "true",
"groupName": "commands"
},
Expand All @@ -224,7 +225,17 @@
"type": "filePath",
"helpMarkDown": "Path to the chart to install. This can be a path to a packaged chart or a path to an unpacked chart directory. For example, if './redis' is specified the task will run 'helm install ./redis'.",
"defaultValue": "",
"visibleRule": "chartType == FilePath || command == package",
"visibleRule": "chartType == FilePath || command == package || command == push",
"required": "true",
"groupName": "commands"
},
{
"name": "remoteRepo",
"label": "Remote Repo",
"type": "string",
"helpMarkDown": "The remote repository where the chart will be pushed.",
"defaultValue": "",
"visibleRule": "command == push",
"required": "true",
"groupName": "commands"
},
Expand All @@ -246,7 +257,7 @@
"type": "string",
"helpMarkDown": "Release name. If unspecified, it will autogenerate one for you.",
"defaultValue": "",
"visibleRule": "command == install || command == upgrade",
"visibleRule": "command == install || command == upgrade || command == rollback || command == uninstall || command == delete",
"groupName": "commands"
},
{
Expand Down
19 changes: 15 additions & 4 deletions Tasks/HelmDeployV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 1,
"Minor": 252,
"Patch": 1
"Patch": 2
},
"demands": [],
"groups": [
Expand Down Expand Up @@ -180,6 +180,7 @@
"login": "login",
"logout": "logout",
"ls": "ls",
"push": "push",
"package": "package",
"rollback": "rollback",
"upgrade": "upgrade",
Expand Down Expand Up @@ -214,7 +215,7 @@
"type": "string",
"helpMarkDown": "ms-resource:loc.input.help.chartName",
"defaultValue": "",
"visibleRule": "chartType == Name",
"visibleRule": "chartType == Name || command == create ",
"required": "true",
"groupName": "commands"
},
Expand All @@ -224,7 +225,17 @@
"type": "filePath",
"helpMarkDown": "ms-resource:loc.input.help.chartPath",
"defaultValue": "",
"visibleRule": "chartType == FilePath || command == package",
"visibleRule": "chartType == FilePath || command == package || command == push",
"required": "true",
"groupName": "commands"
},
{
"name": "remoteRepo",
"label": "ms-resource:loc.input.label.remoteRepo",
"type": "string",
"helpMarkDown": "ms-resource:loc.input.help.remoteRepo",
"defaultValue": "",
"visibleRule": "command == push",
"required": "true",
"groupName": "commands"
},
Expand All @@ -246,7 +257,7 @@
"type": "string",
"helpMarkDown": "ms-resource:loc.input.help.releaseName",
"defaultValue": "",
"visibleRule": "command == install || command == upgrade",
"visibleRule": "command == install || command == upgrade || command == rollback || command == uninstall || command == delete",
"groupName": "commands"
},
{
Expand Down
2 changes: 2 additions & 0 deletions _generated/HelmDeployV1.versionmap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Default|1.252.2
Node20_229_3|1.252.3
Loading
Loading