@docupace/pipeline 1.0.54 → 1.0.55

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.
Files changed (44) hide show
  1. package/.prettierrc.cjs +12 -12
  2. package/README.md +135 -135
  3. package/bin/azuread_update_callbacks_for_app.sh +58 -58
  4. package/bin/next-changeset-validate.sh +8 -8
  5. package/eslint.config.js +26 -26
  6. package/next/changeset.sh +75 -75
  7. package/next/copy.sh +34 -34
  8. package/next/deploy.sh +40 -40
  9. package/next/execute.sh +123 -123
  10. package/next/sonar.sh +23 -23
  11. package/package.json +50 -50
  12. package/src/auth0/alias.js +72 -72
  13. package/src/auth0/cli.js +0 -0
  14. package/src/auth0/export.js +43 -43
  15. package/src/auth0/metadata.js +132 -132
  16. package/src/auth0/vault.js +107 -107
  17. package/src/changeset/changeset-config.js +34 -34
  18. package/src/changeset/cli.js +200 -200
  19. package/src/changeset/create.js +205 -205
  20. package/src/changeset/package-util.js +86 -86
  21. package/src/changeset/util.js +43 -43
  22. package/src/changeset/validate.js +84 -84
  23. package/src/changeset/version.js +102 -102
  24. package/src/jenkins/setParams.groovy +58 -58
  25. package/src/next/alias.js +53 -53
  26. package/src/next/apache.js +81 -73
  27. package/src/next/cli.js +228 -228
  28. package/src/next/config.js +137 -136
  29. package/src/next/connect.js +227 -227
  30. package/src/next/copy.js +61 -61
  31. package/src/next/deploy.js +595 -595
  32. package/src/next/haproxy.js +71 -71
  33. package/src/next/jira.js +84 -84
  34. package/src/next/logger.js +17 -17
  35. package/src/next/pipline.js +114 -114
  36. package/src/next/publish.js +71 -71
  37. package/src/next/pull.js +7 -7
  38. package/src/next/sonar.js +23 -23
  39. package/src/next/util.js +93 -93
  40. package/src/next/vault.js +45 -45
  41. package/terraform/apply.sh +37 -37
  42. package/terraform/init.sh +72 -72
  43. package/terraform/plan.sh +76 -76
  44. package/terraform/validate.sh +17 -17
@@ -1,107 +1,107 @@
1
- import axios from 'axios';
2
-
3
- /**
4
- * Fetch secrets from Vault.
5
- * @param {string} vaultPath - The path in Vault to fetch secrets from.
6
- * @returns {Promise<Object>} - The secret data as a JSON object.
7
- */
8
- export async function getVaultSecrets(vaultPath) {
9
- if (!vaultPath) {
10
- console.error('Error: VAULT_PATH is required.');
11
- throw new Error('VAULT_PATH is required.');
12
- }
13
-
14
- const vaultToken = process.env.VAULT_TOKEN;
15
- const vaultAddr = process.env.VAULT_ADDR;
16
-
17
- if (!vaultToken || !vaultAddr) {
18
- console.error('Error: VAULT_TOKEN and VAULT_ADDR must be set.');
19
- throw new Error('VAULT_TOKEN and VAULT_ADDR must be set.');
20
- }
21
-
22
- try {
23
- // Disable SSL verification globally by setting environment variable
24
- if (process.env.VAULT_SKIP_VERIFY === 'true') {
25
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
26
- }
27
-
28
- // Fetch the secret from Vault
29
- const response = await axios.get(`${vaultAddr}/v1/${vaultPath}`, {
30
- headers: {
31
- 'X-Vault-Token': vaultToken,
32
- },
33
- });
34
-
35
- // Validate the response contains JSON data
36
- const data = response.data;
37
- if (data && typeof data === 'object') {
38
- // console.log(`Secrets fetched successfully from Vault at ${JSON.stringify(data.data.data)})`);
39
- return data.data.data;
40
- } else {
41
- console.error('Error: Invalid JSON received from Vault.');
42
- throw new Error('Invalid JSON received from Vault.');
43
- }
44
- } catch (error) {
45
- if (error.response) {
46
- console.error(
47
- `Error: Failed to connect to Vault server at ${vaultAddr}. Response: ${error.response.status} ${error.response.statusText}`,
48
- );
49
- } else {
50
- console.error(`Error: ${error.message}`);
51
- }
52
- // throw error;
53
- }
54
- }
55
-
56
- /**
57
- * Update a secret in Vault.
58
- * @param {string} vaultPath - The path in Vault where the secret should be updated.
59
- * @param {Object} secretData - The secret data to be stored (as a JSON object).
60
- * @returns {Promise<Object>} - The response from Vault as a JSON object.
61
- */
62
- export async function updateVaultSecrets(vaultPath, secretData) {
63
- if (!vaultPath || !secretData) {
64
- console.error('Usage: updateVaultSecret(vaultPath, secretData)');
65
- throw new Error('Both vaultPath and secretData are required.');
66
- }
67
-
68
- const vaultToken = process.env.VAULT_TOKEN;
69
- const vaultAddr = process.env.VAULT_ADDR;
70
-
71
- if (!vaultToken || !vaultAddr) {
72
- console.error('Error: VAULT_TOKEN and VAULT_ADDR must be set.');
73
- throw new Error('VAULT_TOKEN and VAULT_ADDR must be set.');
74
- }
75
-
76
- try {
77
- // Disable SSL verification globally if VAULT_SKIP_VERIFY is set
78
- if (process.env.VAULT_SKIP_VERIFY === 'true') {
79
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
80
- }
81
-
82
- // Make the POST request to update the Vault secret
83
- const response = await axios.post(
84
- `${vaultAddr}/v1/${vaultPath}`,
85
- secretData,
86
- {
87
- headers: {
88
- 'X-Vault-Token': vaultToken,
89
- 'Content-Type': 'application/json',
90
- },
91
- },
92
- );
93
-
94
- // Return the response from Vault
95
- console.log(response.data);
96
- return response.data;
97
- } catch (error) {
98
- if (error.response) {
99
- console.error(
100
- `Error: Failed to update secret at ${vaultPath}. Response: ${error.response.status} ${error.response.statusText}`,
101
- );
102
- } else {
103
- console.error(`Error: ${error.message}`);
104
- }
105
- // throw error;
106
- }
107
- }
1
+ import axios from 'axios';
2
+
3
+ /**
4
+ * Fetch secrets from Vault.
5
+ * @param {string} vaultPath - The path in Vault to fetch secrets from.
6
+ * @returns {Promise<Object>} - The secret data as a JSON object.
7
+ */
8
+ export async function getVaultSecrets(vaultPath) {
9
+ if (!vaultPath) {
10
+ console.error('Error: VAULT_PATH is required.');
11
+ throw new Error('VAULT_PATH is required.');
12
+ }
13
+
14
+ const vaultToken = process.env.VAULT_TOKEN;
15
+ const vaultAddr = process.env.VAULT_ADDR;
16
+
17
+ if (!vaultToken || !vaultAddr) {
18
+ console.error('Error: VAULT_TOKEN and VAULT_ADDR must be set.');
19
+ throw new Error('VAULT_TOKEN and VAULT_ADDR must be set.');
20
+ }
21
+
22
+ try {
23
+ // Disable SSL verification globally by setting environment variable
24
+ if (process.env.VAULT_SKIP_VERIFY === 'true') {
25
+ process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
26
+ }
27
+
28
+ // Fetch the secret from Vault
29
+ const response = await axios.get(`${vaultAddr}/v1/${vaultPath}`, {
30
+ headers: {
31
+ 'X-Vault-Token': vaultToken,
32
+ },
33
+ });
34
+
35
+ // Validate the response contains JSON data
36
+ const data = response.data;
37
+ if (data && typeof data === 'object') {
38
+ // console.log(`Secrets fetched successfully from Vault at ${JSON.stringify(data.data.data)})`);
39
+ return data.data.data;
40
+ } else {
41
+ console.error('Error: Invalid JSON received from Vault.');
42
+ throw new Error('Invalid JSON received from Vault.');
43
+ }
44
+ } catch (error) {
45
+ if (error.response) {
46
+ console.error(
47
+ `Error: Failed to connect to Vault server at ${vaultAddr}. Response: ${error.response.status} ${error.response.statusText}`,
48
+ );
49
+ } else {
50
+ console.error(`Error: ${error.message}`);
51
+ }
52
+ // throw error;
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Update a secret in Vault.
58
+ * @param {string} vaultPath - The path in Vault where the secret should be updated.
59
+ * @param {Object} secretData - The secret data to be stored (as a JSON object).
60
+ * @returns {Promise<Object>} - The response from Vault as a JSON object.
61
+ */
62
+ export async function updateVaultSecrets(vaultPath, secretData) {
63
+ if (!vaultPath || !secretData) {
64
+ console.error('Usage: updateVaultSecret(vaultPath, secretData)');
65
+ throw new Error('Both vaultPath and secretData are required.');
66
+ }
67
+
68
+ const vaultToken = process.env.VAULT_TOKEN;
69
+ const vaultAddr = process.env.VAULT_ADDR;
70
+
71
+ if (!vaultToken || !vaultAddr) {
72
+ console.error('Error: VAULT_TOKEN and VAULT_ADDR must be set.');
73
+ throw new Error('VAULT_TOKEN and VAULT_ADDR must be set.');
74
+ }
75
+
76
+ try {
77
+ // Disable SSL verification globally if VAULT_SKIP_VERIFY is set
78
+ if (process.env.VAULT_SKIP_VERIFY === 'true') {
79
+ process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
80
+ }
81
+
82
+ // Make the POST request to update the Vault secret
83
+ const response = await axios.post(
84
+ `${vaultAddr}/v1/${vaultPath}`,
85
+ secretData,
86
+ {
87
+ headers: {
88
+ 'X-Vault-Token': vaultToken,
89
+ 'Content-Type': 'application/json',
90
+ },
91
+ },
92
+ );
93
+
94
+ // Return the response from Vault
95
+ console.log(response.data);
96
+ return response.data;
97
+ } catch (error) {
98
+ if (error.response) {
99
+ console.error(
100
+ `Error: Failed to update secret at ${vaultPath}. Response: ${error.response.status} ${error.response.statusText}`,
101
+ );
102
+ } else {
103
+ console.error(`Error: ${error.message}`);
104
+ }
105
+ // throw error;
106
+ }
107
+ }
@@ -1,34 +1,34 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
-
4
- // Get absolute path to .changeset/config.json using current working directory
5
- const configPath = path.join(process.cwd(), '.changeset', 'config.json');
6
-
7
- // Function to update baseBranch to BITBUCKET_BRANCH
8
- export function updateBaseBranch() {
9
- const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
10
- if (!process.env.BITBUCKET_BRANCH) {
11
- return null;
12
- }
13
- let originalbaseBranch = config.baseBranch;
14
- config.baseBranch = process.env.BITBUCKET_BRANCH;
15
-
16
- if (!config.baseBranch) {
17
- throw new Error('BITBUCKET_BRANCH environment variable is not set.');
18
- }
19
-
20
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
21
- console.log(`baseBranch updated to ${process.env.BITBUCKET_BRANCH}`);
22
-
23
- return originalbaseBranch;
24
- }
25
-
26
- // Function to revert baseBranch to original value
27
- export function revertBaseBranch(originalBaseBranch) {
28
- if (!originalBaseBranch) return;
29
-
30
- const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
31
- config.baseBranch = originalBaseBranch;
32
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
33
- console.log(`baseBranch reverted to ${originalBaseBranch}`);
34
- }
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
4
+ // Get absolute path to .changeset/config.json using current working directory
5
+ const configPath = path.join(process.cwd(), '.changeset', 'config.json');
6
+
7
+ // Function to update baseBranch to BITBUCKET_BRANCH
8
+ export function updateBaseBranch() {
9
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
10
+ if (!process.env.BITBUCKET_BRANCH) {
11
+ return null;
12
+ }
13
+ let originalbaseBranch = config.baseBranch;
14
+ config.baseBranch = process.env.BITBUCKET_BRANCH;
15
+
16
+ if (!config.baseBranch) {
17
+ throw new Error('BITBUCKET_BRANCH environment variable is not set.');
18
+ }
19
+
20
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
21
+ console.log(`baseBranch updated to ${process.env.BITBUCKET_BRANCH}`);
22
+
23
+ return originalbaseBranch;
24
+ }
25
+
26
+ // Function to revert baseBranch to original value
27
+ export function revertBaseBranch(originalBaseBranch) {
28
+ if (!originalBaseBranch) return;
29
+
30
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
31
+ config.baseBranch = originalBaseBranch;
32
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
33
+ console.log(`baseBranch reverted to ${originalBaseBranch}`);
34
+ }