Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
Merged
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
6 changes: 6 additions & 0 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ If having a staging and production version of your app is enough to meet your ne
code-push-standalone deployment add <appName> <deploymentName>
```

If you want to re-use an existing deployment key, you can do this with:

```
code-push-standalone deployment add <appName> <deploymentName> -k <existing-deployment-key>
```

Just like with apps, you can remove and rename deployments as well, using the following commands respectively:

```
Expand Down
2 changes: 1 addition & 1 deletion cli/script/command-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function deleteFolder(folderPath: string): Promise<void> {
}

function deploymentAdd(command: cli.IDeploymentAddCommand): Promise<void> {
return sdk.addDeployment(command.appName, command.deploymentName).then((deployment: Deployment): void => {
return sdk.addDeployment(command.appName, command.deploymentName, command.key).then((deployment: Deployment): void => {
log(
'Successfully added the "' +
command.deploymentName +
Expand Down
13 changes: 12 additions & 1 deletion cli/script/command-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,14 @@ yargs
yargs
.usage(USAGE_PREFIX + " deployment add <appName> <deploymentName>")
.demand(/*count*/ 2, /*max*/ 2) // Require exactly two non-option arguments
.example("deployment add MyApp MyDeployment", 'Adds deployment "MyDeployment" to app "MyApp"');
.example("deployment add MyApp MyDeployment", 'Adds deployment "MyDeployment" to app "MyApp"')
.example("deployment add MyApp MyDeployment -k abc123", 'Adds deployment key "abc123"')
.option("key", {
alias: "k",
demand: false,
description: "Specify deployment key",
type: "string",
});

addCommonConfiguration(yargs);
})
Expand Down Expand Up @@ -1046,6 +1053,10 @@ export function createCommand(): cli.ICommand {

deploymentAddCommand.appName = arg2;
deploymentAddCommand.deploymentName = arg3;
if(argv["key"]){
deploymentAddCommand.key = argv["key"] as any;
}

}
break;

Expand Down
4 changes: 2 additions & 2 deletions cli/script/management-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ class AccountManager {
}

// Deployments
public addDeployment(appName: string, deploymentName: string): Promise<Deployment> {
const deployment = <Deployment>{ name: deploymentName };
public addDeployment(appName: string, deploymentName: string, deploymentKey?: string): Promise<Deployment> {
const deployment = <Deployment>{ name: deploymentName, key: deploymentKey };
return this.post(urlEncode([`/apps/${appName}/deployments/`]), JSON.stringify(deployment), /*expectResponseBody=*/ true).then(
(res: JsonResponse) => res.body.deployment
);
Expand Down
1 change: 1 addition & 0 deletions cli/script/types/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export interface IDebugCommand extends ICommand {
export interface IDeploymentAddCommand extends ICommand {
appName: string;
deploymentName: string;
key?: string;
default: boolean;
}

Expand Down
Loading