microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/extension/appcenter/codepush/release-strategy/appcenterCodePushRelease.ts
26lines · 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 | |
| 4 | import { AppCenterClient, models } from "../../api/index"; |
| 5 | import { ICodePushReleaseParams } from "../../command/commandParams"; |
| 6 | import { getQPromisifiedClientResult } from "../../api/createClient"; |
| 7 | import * as fs from "fs"; |
| 8 | |
| 9 | export function appcenterCodePushRelease(client: AppCenterClient, params: ICodePushReleaseParams): Q.Promise<models.CodePushRelease> { |
| 10 | const app = params.app; |
| 11 | return getQPromisifiedClientResult(client.codepush.codePushDeploymentReleases.create( |
| 12 | app.appName, |
| 13 | params.deploymentName, |
| 14 | app.ownerName, |
| 15 | <string>params.appVersion, |
| 16 | { |
| 17 | packageProperty: fs.createReadStream(params.updatedContentZipPath), |
| 18 | deploymentName: params.deploymentName, |
| 19 | description: params.description, |
| 20 | disabled: params.isDisabled, |
| 21 | mandatory: params.isMandatory, |
| 22 | noDuplicateReleaseError: false, // TODO: remove it, not needed to send to server |
| 23 | rollout: params.rollout, |
| 24 | }) |
| 25 | ); |
| 26 | } |