@sap-ux/deploy-tooling 0.1.0 → 0.2.0

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.
@@ -160,6 +160,9 @@ function tryDeploy(archive, service, config, logger) {
160
160
  }
161
161
  logger.error('Deployment has failed.');
162
162
  logger.debug((0, config_1.getConfigForLogging)(config));
163
+ if (!config.verbose) {
164
+ 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-examples)');
165
+ }
163
166
  throw e;
164
167
  }
165
168
  });
@@ -27,14 +27,14 @@ const https_1 = require("https");
27
27
  * @returns Buffer containing the zip file
28
28
  */
29
29
  function getArchiveFromPath(logger, path) {
30
+ logger.info(`Loading archive from ${path}`);
30
31
  return new Promise((resolve, reject) => {
31
- logger.info(`Loading archive from ${path}`);
32
32
  (0, fs_1.readFile)(path, (err, data) => {
33
33
  if (err) {
34
- reject(`Archive loading has failed. Please ensure ${path} is valid and accessible.`);
34
+ reject(`Loading archive has failed. Please ensure ${path} is valid and accessible.`);
35
35
  }
36
36
  else {
37
- logger.info('Archive loaded.');
37
+ logger.info(`Archive loaded from ${path}`);
38
38
  resolve(data);
39
39
  }
40
40
  });
@@ -43,17 +43,20 @@ function getArchiveFromPath(logger, path) {
43
43
  /**
44
44
  * Fetch/get zip file from the given url.
45
45
  *
46
+ * @param logger - reference to the logger instance
46
47
  * @param url - url to the zip file
47
48
  * @param rejectUnauthorized - strict SSL handling or not
48
49
  * @returns Buffer containing the zip file
49
50
  */
50
- function fetchArchiveFromUrl(url, rejectUnauthorized) {
51
+ function fetchArchiveFromUrl(logger, url, rejectUnauthorized) {
51
52
  return __awaiter(this, void 0, void 0, function* () {
52
53
  try {
54
+ logger.info(`Fetching archive from ${url}.`);
53
55
  const response = yield axios_1.default.get(url, {
54
56
  httpsAgent: new https_1.Agent({ rejectUnauthorized }),
55
57
  responseType: 'arraybuffer'
56
58
  });
59
+ logger.info(`Archive fetched from ${url}.`);
57
60
  return response.data;
58
61
  }
59
62
  catch (error) {
@@ -99,7 +102,7 @@ function getArchive(logger, options) {
99
102
  return getArchiveFromPath(logger, options.archivePath);
100
103
  }
101
104
  else if (options.archiveUrl) {
102
- return fetchArchiveFromUrl(options.archiveUrl, options.strictSsl);
105
+ return fetchArchiveFromUrl(logger, options.archiveUrl, options.strictSsl);
103
106
  }
104
107
  else {
105
108
  return createArchiveFromFolder(logger, (_a = options.archiveFolder) !== null && _a !== void 0 ? _a : process.cwd());
@@ -27,7 +27,7 @@ function createUi5Archive(logger, workspace, projectName) {
27
27
  const resources = yield workspace.byGlob(`${prefix}**/*`);
28
28
  for (const resource of resources) {
29
29
  const path = resource.getPath().replace(prefix, '');
30
- logger.debug(path);
30
+ logger.debug(`Adding ${path}`);
31
31
  const buffer = yield resource.getBuffer();
32
32
  zip.addBuffer(buffer, path);
33
33
  }
package/dist/ui5/index.js CHANGED
@@ -20,7 +20,7 @@ const archive_1 = require("./archive");
20
20
  * @param params.options - project properties and configuration
21
21
  */
22
22
  function task({ workspace, options }) {
23
- var _a, _b, _c, _d;
23
+ var _a, _b, _c, _d, _e;
24
24
  return __awaiter(this, void 0, void 0, function* () {
25
25
  const logLevel = (_b = (_a = options.configuration) === null || _a === void 0 ? void 0 : _a.log) !== null && _b !== void 0 ? _b : logger_1.LogLevel.Info;
26
26
  const logger = new logger_1.ToolsLogger({
@@ -32,7 +32,8 @@ function task({ workspace, options }) {
32
32
  }
33
33
  const config = (0, base_1.validateConfig)(options.configuration);
34
34
  (0, base_1.replaceEnvVariables)(config);
35
- const archive = yield (0, archive_1.createUi5Archive)(logger, workspace, options.projectName);
35
+ // The calling client can use either the projectNamespace or projectName when creating the workspace, needs to match when creating the archive.
36
+ const archive = yield (0, archive_1.createUi5Archive)(logger, workspace, (_e = options.projectNamespace) !== null && _e !== void 0 ? _e : options.projectName);
36
37
  yield (0, base_1.deploy)(archive, config, logger);
37
38
  });
38
39
  }
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.1.0",
12
+ "version": "0.2.0",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -26,11 +26,11 @@
26
26
  "!dist/**/*.map"
27
27
  ],
28
28
  "dependencies": {
29
- "@sap-ux/axios-extension": "1.0.3",
29
+ "@sap-ux/axios-extension": "1.1.0",
30
30
  "@sap-ux/btp-utils": "0.11.5",
31
31
  "@sap-ux/logger": "0.3.5",
32
32
  "@sap-ux/store": "0.3.10",
33
- "@sap-ux/ui5-config": "0.16.4",
33
+ "@sap-ux/ui5-config": "0.16.5",
34
34
  "axios": "0.24.0",
35
35
  "commander": "9.4.0",
36
36
  "dotenv": "16.0.0",