UNPKG

@adpt/core

Version:
45 lines 1.97 kB
"use strict"; /* * Copyright 2018-2019 Unbounded Systems, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const server_1 = require("../server"); const deployment_1 = require("../server/deployment"); const buildAndDeploy_1 = require("./buildAndDeploy"); const common_1 = require("./common"); const fork_1 = require("./fork"); const defaultOptions = {}; async function updateDeployment(options) { const finalOptions = Object.assign({}, common_1.defaultDeployCommonOptions, defaultOptions, options); const { adaptUrl, client, deployID, logger: _logger, loggerId } = finalOptions, buildOpts = tslib_1.__rest(finalOptions, ["adaptUrl", "client", "deployID", "logger", "loggerId"]); const setup = { name: "updateDeployment", description: "Updating deployment", client, logger: _logger, loggerId, }; return common_1.withOpsSetup(setup, async (info) => { const { taskObserver } = info; const server = await server_1.adaptServer(adaptUrl, {}); const deployment = await deployment_1.loadDeployment(server, deployID); return buildAndDeploy_1.buildAndDeploy(Object.assign({ deployment, taskObserver }, buildOpts)); }); } exports.updateDeployment = updateDeployment; fork_1.forkExports(module, "updateDeployment"); //# sourceMappingURL=updateDeployment.js.map