Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 7b27e94

Browse files
gravgravsg
authored andcommitted
Add deployment: allow specifying deployment key
1 parent 4cee15f commit 7b27e94

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

cli/script/command-executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function deleteFolder(folderPath: string): Promise<void> {
290290
}
291291

292292
function deploymentAdd(command: cli.IDeploymentAddCommand): Promise<void> {
293-
return sdk.addDeployment(command.appName, command.deploymentName).then((deployment: Deployment): void => {
293+
return sdk.addDeployment(command.appName, command.deploymentName, command.key).then((deployment: Deployment): void => {
294294
log(
295295
'Successfully added the "' +
296296
command.deploymentName +

cli/script/command-parser.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,10 @@ export function createCommand(): cli.ICommand {
10451045

10461046
deploymentAddCommand.appName = arg2;
10471047
deploymentAddCommand.deploymentName = arg3;
1048+
if(argv["key"]){
1049+
deploymentAddCommand.key = argv["key"] as any;
1050+
}
1051+
10481052
}
10491053
break;
10501054

cli/script/management-sdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ class AccountManager {
253253
}
254254

255255
// Deployments
256-
public addDeployment(appName: string, deploymentName: string): Promise<Deployment> {
257-
const deployment = <Deployment>{ name: deploymentName };
256+
public addDeployment(appName: string, deploymentName: string, deploymentKey?: string): Promise<Deployment> {
257+
const deployment = <Deployment>{ name: deploymentName, key: deploymentKey };
258258
return this.post(urlEncode([`/apps/${appName}/deployments/`]), JSON.stringify(deployment), /*expectResponseBody=*/ true).then(
259259
(res: JsonResponse) => res.body.deployment
260260
);

cli/script/types/cli.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export interface IDebugCommand extends ICommand {
107107
export interface IDeploymentAddCommand extends ICommand {
108108
appName: string;
109109
deploymentName: string;
110+
key?: string;
110111
default: boolean;
111112
}
112113

0 commit comments

Comments
 (0)