@sap-ux/deploy-tooling 0.10.2 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/archive.d.ts +12 -0
- package/dist/base/archive.js +30 -0
- package/dist/base/config.d.ts +14 -0
- package/dist/base/config.js +13 -7
- package/dist/base/deploy.js +89 -48
- package/dist/base/validate.d.ts +3 -2
- package/dist/base/validate.js +11 -2
- package/dist/cli/config.js +1 -0
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +6 -3
- package/dist/types/index.d.ts +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* Check whether a given zip files contains an adaptation project and if yes returns the contained manisfest.appdesc_variant.
|
|
4
|
+
*
|
|
5
|
+
* @param archive buffer representing a zip file
|
|
6
|
+
* @returns the descriptor as object if the archive contains an adaptation project otherwise undefined
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAppDescriptorVariant(archive: Buffer): {
|
|
9
|
+
namespace: string;
|
|
10
|
+
layer: 'CUSTOMER_BASE' | 'VENDOR';
|
|
11
|
+
} | undefined;
|
|
12
|
+
//# sourceMappingURL=archive.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getAppDescriptorVariant = void 0;
|
|
7
|
+
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
8
|
+
/**
|
|
9
|
+
* Check whether a given zip files contains an adaptation project and if yes returns the contained manisfest.appdesc_variant.
|
|
10
|
+
*
|
|
11
|
+
* @param archive buffer representing a zip file
|
|
12
|
+
* @returns the descriptor as object if the archive contains an adaptation project otherwise undefined
|
|
13
|
+
*/
|
|
14
|
+
function getAppDescriptorVariant(archive) {
|
|
15
|
+
try {
|
|
16
|
+
const zip = new adm_zip_1.default(archive);
|
|
17
|
+
const file = zip.getEntry('manifest.appdescr_variant');
|
|
18
|
+
if (file) {
|
|
19
|
+
return JSON.parse(file.getData().toString());
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.getAppDescriptorVariant = getAppDescriptorVariant;
|
|
30
|
+
//# sourceMappingURL=archive.js.map
|
package/dist/base/config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AbapDeployConfig } from '../types';
|
|
2
|
+
import type { BspConfig } from '@sap-ux/axios-extension';
|
|
2
3
|
/**
|
|
3
4
|
* Clones the given config and removes secrets so that it can be printed to a log file.
|
|
4
5
|
*
|
|
@@ -14,6 +15,19 @@ export declare function getConfigForLogging(config: AbapDeployConfig): AbapDeplo
|
|
|
14
15
|
* @param obj - any object structure
|
|
15
16
|
*/
|
|
16
17
|
export declare function replaceEnvVariables(obj: object): void;
|
|
18
|
+
/**
|
|
19
|
+
* Helper function for throwing a missing property error.
|
|
20
|
+
*
|
|
21
|
+
* @param property Invalid missing property
|
|
22
|
+
*/
|
|
23
|
+
export declare function throwConfigMissingError(property: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Type checking the config object.
|
|
26
|
+
*
|
|
27
|
+
* @param config - config to be checked
|
|
28
|
+
* @returns true if it is of type BSP config
|
|
29
|
+
*/
|
|
30
|
+
export declare function isBspConfig(config: Partial<BspConfig>): config is BspConfig;
|
|
17
31
|
/**
|
|
18
32
|
* Validate the given config. If anything mandatory is missing throw an error.
|
|
19
33
|
*
|
package/dist/base/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateConfig = exports.replaceEnvVariables = exports.getConfigForLogging = void 0;
|
|
3
|
+
exports.validateConfig = exports.isBspConfig = exports.throwConfigMissingError = exports.replaceEnvVariables = exports.getConfigForLogging = void 0;
|
|
4
4
|
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
5
5
|
const system_access_1 = require("@sap-ux/system-access");
|
|
6
6
|
/**
|
|
@@ -45,6 +45,7 @@ exports.replaceEnvVariables = replaceEnvVariables;
|
|
|
45
45
|
function throwConfigMissingError(property) {
|
|
46
46
|
throw new Error(`Invalid deployment configuration. Property ${property} is missing.`);
|
|
47
47
|
}
|
|
48
|
+
exports.throwConfigMissingError = throwConfigMissingError;
|
|
48
49
|
/**
|
|
49
50
|
* Validate the given target config. If anything mandatory is missing throw an error.
|
|
50
51
|
*
|
|
@@ -62,6 +63,16 @@ function validateTarget(target) {
|
|
|
62
63
|
}
|
|
63
64
|
return target;
|
|
64
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Type checking the config object.
|
|
68
|
+
*
|
|
69
|
+
* @param config - config to be checked
|
|
70
|
+
* @returns true if it is of type BSP config
|
|
71
|
+
*/
|
|
72
|
+
function isBspConfig(config) {
|
|
73
|
+
return config.name !== undefined;
|
|
74
|
+
}
|
|
75
|
+
exports.isBspConfig = isBspConfig;
|
|
65
76
|
/**
|
|
66
77
|
* Validate the given config. If anything mandatory is missing throw an error.
|
|
67
78
|
*
|
|
@@ -78,12 +89,7 @@ function validateConfig(config) {
|
|
|
78
89
|
else {
|
|
79
90
|
throwConfigMissingError('target');
|
|
80
91
|
}
|
|
81
|
-
if (config.app) {
|
|
82
|
-
if (!config.app.name) {
|
|
83
|
-
throwConfigMissingError('app-name');
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
92
|
+
if (!config.app) {
|
|
87
93
|
throwConfigMissingError('app');
|
|
88
94
|
}
|
|
89
95
|
return config;
|
package/dist/base/deploy.js
CHANGED
|
@@ -15,8 +15,8 @@ const fs_1 = require("fs");
|
|
|
15
15
|
const config_1 = require("./config");
|
|
16
16
|
const prompt_1 = require("./prompt");
|
|
17
17
|
const system_access_1 = require("@sap-ux/system-access");
|
|
18
|
+
const archive_1 = require("./archive");
|
|
18
19
|
const validate_1 = require("./validate");
|
|
19
|
-
const deploymentCommands = { tryUndeploy, tryDeploy };
|
|
20
20
|
/**
|
|
21
21
|
* Handle exceptions thrown, in some cases we to retry them.
|
|
22
22
|
*
|
|
@@ -36,7 +36,7 @@ function handleError(command, error, provider, config, logger, archive) {
|
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
logger.error(`${command ===
|
|
39
|
+
logger.error(`${command === tryDeploy ? 'Deployment' : 'Undeployment'} has failed.`);
|
|
40
40
|
logger.debug((0, config_1.getConfigForLogging)(config));
|
|
41
41
|
if (!config.verbose) {
|
|
42
42
|
logger.error('Change logging level to debug your issue\n\t(see examples https://github.com/SAP/open-ux-tools/tree/main/packages/deploy-tooling#configuration-with-logging-enabled)');
|
|
@@ -58,7 +58,7 @@ function handle412Error(command, provider, config, logger, archive) {
|
|
|
58
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
59
|
logger.warn('An app in the same repository with different sap app id found.');
|
|
60
60
|
if (config.yes || (yield (0, prompt_1.promptConfirmation)('Do you want to overwrite (Y/n)?'))) {
|
|
61
|
-
yield
|
|
61
|
+
yield command(provider, Object.assign(Object.assign({}, config), { safe: false, retry: false }), logger, archive);
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
64
64
|
else {
|
|
@@ -77,13 +77,12 @@ function handle412Error(command, provider, config, logger, archive) {
|
|
|
77
77
|
* @returns true if the error was handled otherwise false is returned
|
|
78
78
|
*/
|
|
79
79
|
function handle401Error(command, provider, config, logger, archive) {
|
|
80
|
-
var _a;
|
|
80
|
+
var _a, _b;
|
|
81
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
logger.warn(`${command ===
|
|
82
|
+
logger.warn(`${command === tryDeploy ? 'Deployment' : 'Undeployment'} failed with authentication error.`);
|
|
83
83
|
logger.info('Please maintain correct credentials to avoid seeing this error\n\t(see help: https://www.npmjs.com/package/@sap/ux-ui5-tooling#setting-environment-variables-in-a-env-file)');
|
|
84
84
|
logger.info('Please enter your credentials.');
|
|
85
|
-
const
|
|
86
|
-
const credentials = yield (0, system_access_1.getCredentialsWithPrompts)((_a = service.defaults.auth) === null || _a === void 0 ? void 0 : _a.username);
|
|
85
|
+
const credentials = yield (0, system_access_1.getCredentialsWithPrompts)((_b = (_a = provider.defaults) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.username);
|
|
87
86
|
if (Object.keys(credentials).length) {
|
|
88
87
|
if (config.target.serviceKey) {
|
|
89
88
|
config.target.serviceKey.uaa.username = credentials.username;
|
|
@@ -92,7 +91,9 @@ function handle401Error(command, provider, config, logger, archive) {
|
|
|
92
91
|
else {
|
|
93
92
|
config.credentials = credentials;
|
|
94
93
|
}
|
|
95
|
-
|
|
94
|
+
// Need to re-init the provider with the updated credentials
|
|
95
|
+
provider = yield createProvider(config, logger);
|
|
96
|
+
yield command(provider, config, logger, archive);
|
|
96
97
|
return true;
|
|
97
98
|
}
|
|
98
99
|
else {
|
|
@@ -124,16 +125,16 @@ function axiosErrorRetryHandler(command, response, provider, config, logger, arc
|
|
|
124
125
|
});
|
|
125
126
|
}
|
|
126
127
|
/**
|
|
127
|
-
* Generate a
|
|
128
|
+
* Generate a service instance for deployment from the supplied deployment config.
|
|
128
129
|
*
|
|
129
|
-
* @param
|
|
130
|
+
* @param factoryFn - function to create a service
|
|
130
131
|
* @param config - deployment configuration
|
|
131
132
|
* @param logger - reference to the logger instance
|
|
132
133
|
* @returns service returns the UI5 ABAP Repository service
|
|
133
134
|
*/
|
|
134
|
-
function
|
|
135
|
+
function getDeployService(factoryFn, config, logger) {
|
|
135
136
|
var _a;
|
|
136
|
-
const service =
|
|
137
|
+
const service = factoryFn((_a = config.target) === null || _a === void 0 ? void 0 : _a.service);
|
|
137
138
|
service.log = logger;
|
|
138
139
|
if (!config.strictSsl) {
|
|
139
140
|
logger.warn('You chose not to validate SSL certificate. Please verify the server certificate is trustful before proceeding. See documentation for recommended configuration (https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/4b318bede7eb4021a8be385c46c74045.html).');
|
|
@@ -153,41 +154,68 @@ function createTransportRequest(config, logger, provider) {
|
|
|
153
154
|
var _a;
|
|
154
155
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
156
|
if (!provider) {
|
|
156
|
-
provider = yield (
|
|
157
|
-
auth: config.credentials,
|
|
158
|
-
ignoreCertErrors: !config.strictSsl
|
|
159
|
-
}, !!config.target.scp, logger);
|
|
157
|
+
provider = yield createProvider(config, logger);
|
|
160
158
|
}
|
|
161
159
|
const adtService = yield provider.getAdtService(axios_extension_1.TransportRequestService);
|
|
160
|
+
const ui5AppName = (0, config_1.isBspConfig)(config.app) ? config.app.name : '';
|
|
162
161
|
const transportRequest = yield (adtService === null || adtService === void 0 ? void 0 : adtService.createTransportRequest({
|
|
163
162
|
packageName: (_a = config.app.package) !== null && _a !== void 0 ? _a : '',
|
|
164
|
-
ui5AppName
|
|
163
|
+
ui5AppName,
|
|
165
164
|
description: 'Created by @sap-ux/deploy-tooling'
|
|
166
165
|
}));
|
|
167
166
|
if (transportRequest) {
|
|
168
|
-
logger.info(`Transport request ${transportRequest} created for application ${
|
|
167
|
+
logger.info(`Transport request ${transportRequest} created for application ${ui5AppName}.`);
|
|
169
168
|
return transportRequest;
|
|
170
169
|
}
|
|
171
|
-
throw new Error(`Transport request could not be created for application ${
|
|
170
|
+
throw new Error(`Transport request could not be created for application ${ui5AppName}.`);
|
|
172
171
|
});
|
|
173
172
|
}
|
|
174
173
|
exports.createTransportRequest = createTransportRequest;
|
|
175
174
|
/**
|
|
176
|
-
*
|
|
175
|
+
* Create a service provider based on the given config.
|
|
177
176
|
*
|
|
178
|
-
* @param command - the request type deploy | undeploy to be executed
|
|
179
177
|
* @param config - deployment configuration
|
|
180
178
|
* @param logger - reference to the logger instance
|
|
181
|
-
* @
|
|
179
|
+
* @returns an instance of an ABAP service provider
|
|
182
180
|
*/
|
|
183
|
-
function
|
|
181
|
+
function createProvider(config, logger) {
|
|
184
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
-
|
|
183
|
+
return yield (0, system_access_1.createAbapServiceProvider)(config.target, {
|
|
186
184
|
auth: config.credentials,
|
|
187
185
|
ignoreCertErrors: !config.strictSsl
|
|
188
186
|
}, !!config.target.scp, logger);
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Check if the archive is an adapation project and if yes, try to deploy it to the layered repository.
|
|
191
|
+
*
|
|
192
|
+
* @param provider - instance of the axios-extension abap service provider
|
|
193
|
+
* @param config - deployment configuration
|
|
194
|
+
* @param logger - reference to the logger instance
|
|
195
|
+
* @param archive - archive file that is to be deployed
|
|
196
|
+
*/
|
|
197
|
+
function tryDeployToLrep(provider, config, logger, archive) {
|
|
198
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
+
logger.debug('No BSP name provided, checking if it is an adaptation project');
|
|
200
|
+
const descriptor = (0, archive_1.getAppDescriptorVariant)(archive);
|
|
201
|
+
if (descriptor) {
|
|
202
|
+
if (config.test) {
|
|
203
|
+
throw new Error('Deployment in test mode not supported for deployments to the layered repository.');
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
logger.debug('Deploying an adaptation project to LREP');
|
|
207
|
+
const service = getDeployService(provider.getLayeredRepository.bind(provider), config, logger);
|
|
208
|
+
yield service.deploy(archive, {
|
|
209
|
+
namespace: descriptor.namespace,
|
|
210
|
+
layer: descriptor.layer,
|
|
211
|
+
package: config.app.package,
|
|
212
|
+
transport: config.app.transport
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
(0, config_1.throwConfigMissingError)('app-name');
|
|
218
|
+
}
|
|
191
219
|
});
|
|
192
220
|
}
|
|
193
221
|
/**
|
|
@@ -199,30 +227,27 @@ function runCommand(command, config, logger, archive = Buffer.from('')) {
|
|
|
199
227
|
* @param archive - archive file that is to be deployed
|
|
200
228
|
*/
|
|
201
229
|
function tryDeploy(provider, config, logger, archive) {
|
|
202
|
-
var _a, _b, _c, _d, _e;
|
|
203
230
|
return __awaiter(this, void 0, void 0, function* () {
|
|
204
231
|
try {
|
|
205
232
|
if (config.createTransport) {
|
|
206
233
|
config.app.transport = yield createTransportRequest(config, logger, provider);
|
|
207
|
-
// Reset as we
|
|
234
|
+
// Reset as we don't want other flows kicking it off again!
|
|
208
235
|
config.createTransport = false;
|
|
209
236
|
}
|
|
210
|
-
|
|
211
|
-
if (config.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
client: (_d = config.target.client) !== null && _d !== void 0 ? _d : '',
|
|
218
|
-
url: (_e = config.target.url) !== null && _e !== void 0 ? _e : ''
|
|
219
|
-
}, provider, logger);
|
|
220
|
-
if (!validateOutput.result) {
|
|
221
|
-
logger.info(`Results of validating the deployment configuration settings:${(0, validate_1.formatSummary)(validateOutput.summary)}`);
|
|
237
|
+
// check if deployment of BSP is requested
|
|
238
|
+
if ((0, config_1.isBspConfig)(config.app)) {
|
|
239
|
+
if (config.test === true) {
|
|
240
|
+
const validateOutput = yield (0, validate_1.validateBeforeDeploy)(config, provider, logger);
|
|
241
|
+
if (!validateOutput.result) {
|
|
242
|
+
logger.info(`Results of validating the deployment configuration settings:${(0, validate_1.formatSummary)(validateOutput.summary)}`);
|
|
243
|
+
}
|
|
222
244
|
}
|
|
245
|
+
const service = getDeployService(provider.getUi5AbapRepository.bind(provider), config, logger);
|
|
246
|
+
yield service.deploy({ archive, bsp: config.app, testMode: config.test, safeMode: config.safe });
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
yield tryDeployToLrep(provider, config, logger, archive);
|
|
223
250
|
}
|
|
224
|
-
const service = getUi5AbapRepositoryService(provider, config, logger);
|
|
225
|
-
yield service.deploy({ archive, bsp: config.app, testMode: config.test, safeMode: config.safe });
|
|
226
251
|
if (config.test === true) {
|
|
227
252
|
logger.info('Deployment in TestMode completed. A successful TestMode execution does not necessarily mean that your upload will be successful.');
|
|
228
253
|
}
|
|
@@ -231,7 +256,7 @@ function tryDeploy(provider, config, logger, archive) {
|
|
|
231
256
|
}
|
|
232
257
|
}
|
|
233
258
|
catch (error) {
|
|
234
|
-
yield handleError(
|
|
259
|
+
yield handleError(tryDeploy, error, provider, config, logger, archive);
|
|
235
260
|
}
|
|
236
261
|
});
|
|
237
262
|
}
|
|
@@ -247,7 +272,9 @@ function deploy(archive, config, logger) {
|
|
|
247
272
|
if (config.keep) {
|
|
248
273
|
(0, fs_1.writeFileSync)(`archive.zip`, archive);
|
|
249
274
|
}
|
|
250
|
-
|
|
275
|
+
const provider = yield createProvider(config, logger);
|
|
276
|
+
logger.info(`Starting to deploy${config.test === true ? ' in test mode' : ''}.`);
|
|
277
|
+
yield tryDeploy(provider, config, logger, archive);
|
|
251
278
|
});
|
|
252
279
|
}
|
|
253
280
|
exports.deploy = deploy;
|
|
@@ -265,8 +292,20 @@ function tryUndeploy(provider, config, logger) {
|
|
|
265
292
|
config.app.transport = yield createTransportRequest(config, logger, provider);
|
|
266
293
|
config.createTransport = false;
|
|
267
294
|
}
|
|
268
|
-
|
|
269
|
-
|
|
295
|
+
if (config.lrep) {
|
|
296
|
+
const service = getDeployService(provider.getLayeredRepository.bind(provider), config, logger);
|
|
297
|
+
yield service.undeploy({
|
|
298
|
+
namespace: config.lrep,
|
|
299
|
+
transport: config.app.transport
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
else if ((0, config_1.isBspConfig)(config.app)) {
|
|
303
|
+
const service = getDeployService(provider.getUi5AbapRepository.bind(provider), config, logger);
|
|
304
|
+
yield service.undeploy({ bsp: config.app, testMode: config.test });
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
(0, config_1.throwConfigMissingError)('app-name');
|
|
308
|
+
}
|
|
270
309
|
if (config.test === true) {
|
|
271
310
|
logger.info('Undeployment in TestMode completed. A successful TestMode execution does not necessarily mean that your undeploy will be successful.');
|
|
272
311
|
}
|
|
@@ -275,7 +314,7 @@ function tryUndeploy(provider, config, logger) {
|
|
|
275
314
|
}
|
|
276
315
|
}
|
|
277
316
|
catch (error) {
|
|
278
|
-
yield handleError(
|
|
317
|
+
yield handleError(tryUndeploy, error, provider, config, logger, Buffer.from(''));
|
|
279
318
|
}
|
|
280
319
|
});
|
|
281
320
|
}
|
|
@@ -287,7 +326,9 @@ function tryUndeploy(provider, config, logger) {
|
|
|
287
326
|
*/
|
|
288
327
|
function undeploy(config, logger) {
|
|
289
328
|
return __awaiter(this, void 0, void 0, function* () {
|
|
290
|
-
|
|
329
|
+
const provider = yield createProvider(config, logger);
|
|
330
|
+
logger.info(`Starting to undeploy ${config.test === true ? ' in test mode' : ''}.`);
|
|
331
|
+
yield tryUndeploy(provider, config, logger);
|
|
291
332
|
});
|
|
292
333
|
}
|
|
293
334
|
exports.undeploy = undeploy;
|
package/dist/base/validate.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AbapServiceProvider } from '@sap-ux/axios-extension';
|
|
2
2
|
import type { Logger } from '@sap-ux/logger';
|
|
3
|
+
import type { AbapDeployConfig } from '../types';
|
|
3
4
|
export type ValidationInputs = {
|
|
4
5
|
appName: string;
|
|
5
6
|
description: string;
|
|
@@ -36,12 +37,12 @@ export declare const summaryMessage: {
|
|
|
36
37
|
/**
|
|
37
38
|
* Validation of deploy configuration before running deploy-test.
|
|
38
39
|
*
|
|
39
|
-
* @param
|
|
40
|
+
* @param config Deploy configuration that needs to be validated
|
|
40
41
|
* @param provider AbapServiceProvider
|
|
41
42
|
* @param logger Logger used by deploy tooling
|
|
42
43
|
* @returns Validation result and a summary report of identified issues.
|
|
43
44
|
*/
|
|
44
|
-
export declare function validateBeforeDeploy(
|
|
45
|
+
export declare function validateBeforeDeploy(config: AbapDeployConfig, provider: AbapServiceProvider, logger: Logger): Promise<ValidationOutput>;
|
|
45
46
|
/**
|
|
46
47
|
* Format a list of summary records that is ready to be printed on the console.
|
|
47
48
|
*
|
package/dist/base/validate.js
CHANGED
|
@@ -35,17 +35,26 @@ exports.summaryMessage = {
|
|
|
35
35
|
/**
|
|
36
36
|
* Validation of deploy configuration before running deploy-test.
|
|
37
37
|
*
|
|
38
|
-
* @param
|
|
38
|
+
* @param config Deploy configuration that needs to be validated
|
|
39
39
|
* @param provider AbapServiceProvider
|
|
40
40
|
* @param logger Logger used by deploy tooling
|
|
41
41
|
* @returns Validation result and a summary report of identified issues.
|
|
42
42
|
*/
|
|
43
|
-
function validateBeforeDeploy(
|
|
43
|
+
function validateBeforeDeploy(config, provider, logger) {
|
|
44
|
+
var _a, _b, _c, _d, _e, _f;
|
|
44
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
46
|
const output = {
|
|
46
47
|
summary: [],
|
|
47
48
|
result: true
|
|
48
49
|
};
|
|
50
|
+
const input = {
|
|
51
|
+
appName: (_a = config.app.name) !== null && _a !== void 0 ? _a : '',
|
|
52
|
+
description: (_b = config.app.description) !== null && _b !== void 0 ? _b : '',
|
|
53
|
+
package: (_c = config.app.package) !== null && _c !== void 0 ? _c : '',
|
|
54
|
+
transport: (_d = config.app.transport) !== null && _d !== void 0 ? _d : '',
|
|
55
|
+
client: (_e = config.target.client) !== null && _e !== void 0 ? _e : '',
|
|
56
|
+
url: (_f = config.target.url) !== null && _f !== void 0 ? _f : ''
|
|
57
|
+
};
|
|
49
58
|
// output is passed by reference and status updated during the internal pipeline below.
|
|
50
59
|
yield validateInputTextFormat(input, output, provider, logger);
|
|
51
60
|
yield validatePackageWithAdt(input, output, provider, logger);
|
package/dist/cli/config.js
CHANGED
|
@@ -185,6 +185,7 @@ function mergeConfig(taskConfig, options) {
|
|
|
185
185
|
config.yes = mergeFlag(options.yes, taskConfig.yes);
|
|
186
186
|
config.createTransport = mergeFlag(options.createTransport, taskConfig.createTransport);
|
|
187
187
|
config.retry = process.env.NO_RETRY ? !process.env.NO_RETRY : mergeFlag(options.retry, taskConfig.retry);
|
|
188
|
+
config.lrep = options.lrep;
|
|
188
189
|
if (!options.archiveUrl && !options.archivePath && !options.archiveFolder) {
|
|
189
190
|
options.archiveFolder = 'dist';
|
|
190
191
|
}
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -7,11 +7,11 @@ import { Command } from 'commander';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function createCommand(name: 'deploy' | 'undeploy'): Command;
|
|
9
9
|
/**
|
|
10
|
-
* Function that is to be
|
|
10
|
+
* Function that is to be executed when the exposed deploy command is executed.
|
|
11
11
|
*/
|
|
12
12
|
export declare function runDeploy(): Promise<void>;
|
|
13
13
|
/**
|
|
14
|
-
* Function that is to be
|
|
14
|
+
* Function that is to be executed when the exposed undeploy command is executed.
|
|
15
15
|
*/
|
|
16
16
|
export declare function runUndeploy(): Promise<void>;
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cli/index.js
CHANGED
|
@@ -35,7 +35,7 @@ function createCommand(name) {
|
|
|
35
35
|
.addOption(new commander_1.Option('--url <target-url>', 'URL of target ABAP system').conflicts('destination'))
|
|
36
36
|
.addOption(new commander_1.Option('--client <sap-client>', 'Client number of target ABAP system').conflicts('destination'))
|
|
37
37
|
.addOption(new commander_1.Option('--cloud', 'Target is an ABAP Cloud system').conflicts('destination'))
|
|
38
|
-
.addOption(new commander_1.Option('--service <service-path>', 'Target
|
|
38
|
+
.addOption(new commander_1.Option('--service <service-path>', 'Target alias for deployment service'))
|
|
39
39
|
.addOption(new commander_1.Option('--cloud-service-key <file-location>', 'JSON file location with the ABAP cloud service key.').conflicts('destination'))
|
|
40
40
|
.addOption(new commander_1.Option('--cloud-service-env', 'Read ABAP cloud service properties from environment variables or .env file').conflicts(['cloudServiceKey', 'destination']))
|
|
41
41
|
.option('--package <abap-package>', 'Package name for deploy target ABAP system')
|
|
@@ -72,6 +72,9 @@ function createCommand(name) {
|
|
|
72
72
|
'archivePath'
|
|
73
73
|
]));
|
|
74
74
|
}
|
|
75
|
+
else if (name === 'undeploy') {
|
|
76
|
+
command.addOption(new commander_1.Option('--lrep <namespace>', 'Undeploy the given namespace from the layered repository (for adaptation projects)').conflicts(['test', 'name']));
|
|
77
|
+
}
|
|
75
78
|
return command.version((0, config_1.getVersion)(), '-v, --version', 'version of the deploy tooling');
|
|
76
79
|
}
|
|
77
80
|
exports.createCommand = createCommand;
|
|
@@ -106,7 +109,7 @@ function prepareRun(cmd) {
|
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
111
|
/**
|
|
109
|
-
* Function that is to be
|
|
112
|
+
* Function that is to be executed when the exposed deploy command is executed.
|
|
110
113
|
*/
|
|
111
114
|
function runDeploy() {
|
|
112
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -123,7 +126,7 @@ function runDeploy() {
|
|
|
123
126
|
}
|
|
124
127
|
exports.runDeploy = runDeploy;
|
|
125
128
|
/**
|
|
126
|
-
* Function that is to be
|
|
129
|
+
* Function that is to be executed when the exposed undeploy command is executed.
|
|
127
130
|
*/
|
|
128
131
|
function runUndeploy() {
|
|
129
132
|
return __awaiter(this, void 0, void 0, function* () {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -43,6 +43,10 @@ export interface CommonOptions {
|
|
|
43
43
|
* If set to true, a transport request will be created during deployment
|
|
44
44
|
*/
|
|
45
45
|
createTransport?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Optional layered repository namespace.
|
|
48
|
+
*/
|
|
49
|
+
lrep?: string;
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
48
52
|
* Enhancing the target with an optional service property allowing to use an alias for the deployment service.
|
|
@@ -52,7 +56,7 @@ export type AbapTarget = BaseAbapTarget & {
|
|
|
52
56
|
};
|
|
53
57
|
export interface AbapDeployConfig extends CommonOptions {
|
|
54
58
|
target: AbapTarget;
|
|
55
|
-
app: BspConfig
|
|
59
|
+
app: Partial<BspConfig>;
|
|
56
60
|
credentials?: AxiosRequestConfig['auth'];
|
|
57
61
|
exclude?: string[];
|
|
58
62
|
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Adeploy-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.11.1",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|