microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
bb685befdbe7e88c8b5573661cf3dfa5d48a4001

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/extension/appcenter/codepush/releaseReact.ts

34lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import { AppCenterClient, models } from "../api/index";
5import { ILogger, LogLevel } from "../../log/LogHelper";
6import { ICodePushReleaseParams } from "../command/commandParams";
7import { getQPromisifiedClientResult } from "../api/createClient";
8import * as Q from "q";
9import { CommandResult, success, failure, ErrorCodes } from "../command/commandResult";
10
11export default class CodePushReleaseReact {
12 public static exec(client: AppCenterClient, params: ICodePushReleaseParams, logger: ILogger): Q.Promise<CommandResult> {
13 const app = params.app;
14 return getQPromisifiedClientResult(client.codepush.codePushDeploymentReleases.create(
15 app.appName,
16 params.deploymentName,
17 app.ownerName,
18 <string>params.appVersion,
19 {
20 deploymentName: params.deploymentName,
21 description: params.description,
22 disabled: params.isDisabled,
23 mandatory: params.isMandatory,
24 noDuplicateReleaseError: false, // TODO: remove it, not needed to send to server
25 rollout: params.rollout,
26 })
27 ).then((result: models.CodePushRelease) => {
28 return success(result);
29 }).catch((e) => {
30 logger.log("An error occured on doing Code Push release", LogLevel.Error);
31 return failure(ErrorCodes.Exception, "An error occured on doing Code Push release");
32 });
33 }
34}