@axway/axway-central-cli 4.12.0 → 4.13.0-rc.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.
- package/dist/commands/install/agents.js +5 -5
- package/dist/commands/install/awsAgents.js +10 -60
- package/dist/commands/install/edgeAgents.js +13 -41
- package/dist/commands/install/helpers/getters.js +9 -38
- package/dist/common/ApiServerClient.js +16 -0
- package/dist/common/types.js +9 -4
- package/package.json +1 -1
|
@@ -203,8 +203,8 @@ const agents = exports.agents = {
|
|
|
203
203
|
installConfig.switches.isDockerInstall = installConfig.deploymentType === _types.AgentConfigTypes.DOCKERIZED;
|
|
204
204
|
installConfig.switches.isBinaryInstall = installConfig.deploymentType === _types.AgentConfigTypes.BINARIES;
|
|
205
205
|
|
|
206
|
-
// Get the version of the agents from
|
|
207
|
-
await getAgentVersions(agentInstallFlow, installConfig);
|
|
206
|
+
// Get the version of the agents from Engage, not needed in hosted install
|
|
207
|
+
await getAgentVersions(agentInstallFlow, installConfig, apiServerClient);
|
|
208
208
|
|
|
209
209
|
// if EDGE_GATEWAY or EDGE_GATEWAY_ONLY and isDaEnabled, ask if the organization structure should replicate
|
|
210
210
|
if ((gatewayType === _types.GatewayTypes.EDGE_GATEWAY || gatewayType === _types.GatewayTypes.EDGE_GATEWAY_ONLY) && installConfig.switches.isDaEnabled) {
|
|
@@ -251,12 +251,12 @@ const agents = exports.agents = {
|
|
|
251
251
|
..._types.commonCmdArgsDescription
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
|
-
async function getAgentVersions(agentInstallFlow, installConfig) {
|
|
254
|
+
async function getAgentVersions(agentInstallFlow, installConfig, apiServerClient) {
|
|
255
255
|
if (agentInstallFlow.AgentNameMap && !installConfig.switches.isHostedInstall && installConfig.switches.isDaEnabled) {
|
|
256
|
-
installConfig.daVersion = await helpers.getLatestAgentVersion(agentInstallFlow.AgentNameMap[_types.AgentTypes.da]);
|
|
256
|
+
installConfig.daVersion = await helpers.getLatestAgentVersion(apiServerClient, agentInstallFlow.AgentNameMap[_types.AgentTypes.da]);
|
|
257
257
|
}
|
|
258
258
|
if (agentInstallFlow.AgentNameMap && !installConfig.switches.isHostedInstall && installConfig.switches.isTaEnabled) {
|
|
259
|
-
installConfig.taVersion = await helpers.getLatestAgentVersion(agentInstallFlow.AgentNameMap[_types.AgentTypes.ta]);
|
|
259
|
+
installConfig.taVersion = await helpers.getLatestAgentVersion(apiServerClient, agentInstallFlow.AgentNameMap[_types.AgentTypes.ta]);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
async function finishInstall(agentInstallFlow, installConfig, apiServerClient, platformClient, defsManager) {
|
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.testables = exports.
|
|
6
|
+
exports.testables = exports.gatewayConnectivity = exports.completeInstall = exports.askConfigType = exports.askBundleType = exports.DeploymentTypes = exports.ConfigFiles = exports.AWSPrompts = exports.AWSInstallMethods = void 0;
|
|
7
7
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
-
var _fs = _interopRequireDefault(require("fs"));
|
|
9
8
|
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
10
9
|
var _basicPrompts = require("../../common/basicPrompts");
|
|
11
|
-
var _dataService = require("../../common/dataService");
|
|
12
10
|
var _types = require("../../common/types");
|
|
13
11
|
var _utils = require("../../common/utils");
|
|
14
12
|
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
@@ -340,8 +338,6 @@ const generateOutput = async installConfig => {
|
|
|
340
338
|
additionalSteps = ` - Create the SSM parameter:
|
|
341
339
|
${_chalk.default.cyan(` aws ssm put-parameter --type SecureString --name ${awsAgentValues.cloudFormationConfig.SSMPrivateKeyParameter} --value "file:\/\/private_key.pem"`)}
|
|
342
340
|
${_chalk.default.cyan(` aws ssm put-parameter --type SecureString --name ${awsAgentValues.cloudFormationConfig.SSMPublicKeyParameter} --value "file:\/\/public_key.pem"`)}`;
|
|
343
|
-
// Cleanup EC2 file
|
|
344
|
-
_fs.default.unlinkSync(ConfigFiles.EC2DeployYAML);
|
|
345
341
|
break;
|
|
346
342
|
}
|
|
347
343
|
case DeploymentTypes.OTHER:
|
|
@@ -350,11 +346,6 @@ ${_chalk.default.cyan(` aws ssm put-parameter --type SecureString --name ${aw
|
|
|
350
346
|
// These files need to be put in a resources dir on S3
|
|
351
347
|
let s3ResourcesIncludes = '';
|
|
352
348
|
[ConfigFiles.DAEnvVars, ConfigFiles.TAEnvVars].forEach(value => s3ResourcesIncludes += `--include "${value}" `);
|
|
353
|
-
|
|
354
|
-
// Cleanup EC2 file
|
|
355
|
-
_fs.default.unlinkSync(ConfigFiles.EC2DeployYAML);
|
|
356
|
-
// Cleanup ECS Fargate file
|
|
357
|
-
_fs.default.unlinkSync(ConfigFiles.FargateDeployYAML);
|
|
358
349
|
const info = `To utilize the agents, pull the latest Docker images and run them using the appropriate supplied environment files, (${helpers.configFiles.DA_ENV_VARS} & ${helpers.configFiles.TA_ENV_VARS}):`;
|
|
359
350
|
dockerEnvConfig = `Wait for the CloudFormation Stack to complete.
|
|
360
351
|
- Create AWS Access and Secret Keys and copy resulting ${_chalk.default.yellow(`"AccessKeyId"`)} & ${_chalk.default.yellow(`"SecretAccessKey"`)}:
|
|
@@ -399,8 +390,6 @@ ${_chalk.default.cyan(` aws ec2 create-key-pair --key-name ${awsAgentValues.c
|
|
|
399
390
|
- Create the SSM parameter:
|
|
400
391
|
${_chalk.default.cyan(` aws ssm put-parameter --type SecureString --name ${awsAgentValues.cloudFormationConfig.SSMPrivateKeyParameter} --value "file:\/\/private_key.pem"`)}
|
|
401
392
|
${_chalk.default.cyan(` aws ssm put-parameter --type SecureString --name ${awsAgentValues.cloudFormationConfig.SSMPublicKeyParameter} --value "file:\/\/public_key.pem"`)}`;
|
|
402
|
-
// Cleanup Fargate file
|
|
403
|
-
_fs.default.unlinkSync(ConfigFiles.FargateDeployYAML);
|
|
404
393
|
break;
|
|
405
394
|
}
|
|
406
395
|
}
|
|
@@ -409,7 +398,13 @@ ${_chalk.default.cyan(` aws ssm put-parameter --type SecureString --name ${aw
|
|
|
409
398
|
// if region is AWS default, 'us-east-1', region unnecessary in cloudformation template url
|
|
410
399
|
const s3Region = awsAgentValues.region === _types.AWSRegions.US_EAST_1 ? `s3` : `s3.${awsAgentValues.region}`;
|
|
411
400
|
return `
|
|
412
|
-
To complete the install,
|
|
401
|
+
To complete the install, first download and extract the CloudFormation templates:
|
|
402
|
+
- Download the CloudFormation package:
|
|
403
|
+
${_chalk.default.cyan(` curl -O https://repository.axway.com/artifactory/ampc-public-generic-release/aws-agents/aws_apigw_agent_config/latest/${ConfigFiles.AgentConfigZip}`)}
|
|
404
|
+
- Extract the package:
|
|
405
|
+
${_chalk.default.cyan(` unzip ${ConfigFiles.AgentConfigZip}`)}
|
|
406
|
+
|
|
407
|
+
Then run the following AWS CLI commands:
|
|
413
408
|
- Create, if necessary, and upload all files to your S3 bucket
|
|
414
409
|
${_chalk.default.cyan(` aws s3api create-bucket --bucket ${awsAgentValues.cloudFormationConfig.AgentResourcesBucket} --create-bucket-configuration LocationConstraint=${awsAgentValues.region}`)}
|
|
415
410
|
${_chalk.default.cyan(` aws s3 sync --exclude "*" ${s3BaseIncludes} ./ s3://${awsAgentValues.cloudFormationConfig.AgentResourcesBucket}`)}
|
|
@@ -428,47 +423,6 @@ ${runCommands}
|
|
|
428
423
|
${_chalk.default.gray(`Additional information about agent features can be found here:\n${helpers.agentsDocsUrl.AWS}`)}\n
|
|
429
424
|
`;
|
|
430
425
|
};
|
|
431
|
-
|
|
432
|
-
// Download latest aws apigw config zip
|
|
433
|
-
const downloadAPIGWAgentConfigZip = async () => {
|
|
434
|
-
const url = `/aws_apigw_agent_config/latest/${ConfigFiles.AgentConfigZip}`;
|
|
435
|
-
const service = await (0, _dataService.dataService)({
|
|
436
|
-
baseUrl: _types.PublicRepoUrl,
|
|
437
|
-
basePath: _types.BasePaths.AWSAgents
|
|
438
|
-
});
|
|
439
|
-
try {
|
|
440
|
-
const {
|
|
441
|
-
stream
|
|
442
|
-
} = await service.download(url);
|
|
443
|
-
await helpers.streamPipeline(stream, _fs.default.createWriteStream(ConfigFiles.AgentConfigZip));
|
|
444
|
-
return ConfigFiles.AgentConfigZip;
|
|
445
|
-
} catch (err) {
|
|
446
|
-
throw new Error(`Failed to download the agent: ${err.message}`);
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
// Unzip latest aws apigw config zip
|
|
451
|
-
const unzipAPIGWAgentConfigZip = async zipFile => {
|
|
452
|
-
await helpers.unzip(zipFile);
|
|
453
|
-
_fs.default.unlinkSync(zipFile);
|
|
454
|
-
const isCloudFormation = _fs.default.existsSync(ConfigFiles.DeployAllYAML);
|
|
455
|
-
if (!isCloudFormation) {
|
|
456
|
-
console.log(`${ConfigFiles.DeployAllYAML} was not extracted from ${ConfigFiles.AgentConfigZip}`);
|
|
457
|
-
return false;
|
|
458
|
-
}
|
|
459
|
-
return true;
|
|
460
|
-
};
|
|
461
|
-
const installPreprocess = async installConfig => {
|
|
462
|
-
// attempt to download the cloud formation files
|
|
463
|
-
console.log(_chalk.default.gray(`Downloading the latest Cloud formation template...`));
|
|
464
|
-
let apigwAgentConfigZipFile = await downloadAPIGWAgentConfigZip();
|
|
465
|
-
if (apigwAgentConfigZipFile !== '') {
|
|
466
|
-
console.log(_chalk.default.gray(`\nSuccess`));
|
|
467
|
-
}
|
|
468
|
-
installConfig.gatewayConfig.apigwAgentConfigZipFile = apigwAgentConfigZipFile;
|
|
469
|
-
return installConfig;
|
|
470
|
-
};
|
|
471
|
-
exports.installPreprocess = installPreprocess;
|
|
472
426
|
const completeInstall = async installConfig => {
|
|
473
427
|
/**
|
|
474
428
|
* Create agent resources
|
|
@@ -478,10 +432,7 @@ const completeInstall = async installConfig => {
|
|
|
478
432
|
// Add final settings to awsAgentsValues
|
|
479
433
|
awsAgentValues.centralConfig = installConfig.centralConfig;
|
|
480
434
|
awsAgentValues.traceabilityConfig = installConfig.traceabilityConfig;
|
|
481
|
-
|
|
482
|
-
if (unpackZip) {
|
|
483
|
-
console.log('\nCreating the agent environment files for AWS...');
|
|
484
|
-
}
|
|
435
|
+
console.log('\nCreating the agent environment files for AWS...');
|
|
485
436
|
console.log('Generating the configuration file(s)...');
|
|
486
437
|
console.log('Generating the cloud formation parameters file...');
|
|
487
438
|
let paramStrings = [];
|
|
@@ -506,9 +457,8 @@ const AWSInstallMethods = exports.AWSInstallMethods = {
|
|
|
506
457
|
GetBundleType: askBundleType,
|
|
507
458
|
GetDeploymentType: askConfigType,
|
|
508
459
|
AskGatewayQuestions: gatewayConnectivity,
|
|
509
|
-
InstallPreprocess: installPreprocess,
|
|
510
460
|
FinalizeGatewayInstall: completeInstall,
|
|
511
|
-
ConfigFiles:
|
|
461
|
+
ConfigFiles: [ConfigFiles.DAEnvVars, ConfigFiles.TAEnvVars, ConfigFiles.CFProperties],
|
|
512
462
|
AgentNameMap: {
|
|
513
463
|
[_types.AgentTypes.da]: _types.AgentNames.AWS_DA,
|
|
514
464
|
[_types.AgentTypes.ta]: _types.AgentNames.AWS_TA
|
|
@@ -5,10 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.testables = exports.prompts = exports.installPreprocess = exports.gatewayConnectivity = exports.dockerPublicKey = exports.dockerPrivateKey = exports.completeInstall = exports.askOrganizationReplication = exports.askIsGatewayOnlyMode = exports.askConfigType = exports.askBundleTypeGWOnly = exports.askBundleType = exports.EdgeInstallMethods = exports.EdgeGWOnlyInstallMethods = exports.ConfigFiles = void 0;
|
|
7
7
|
var _cliKit = require("cli-kit");
|
|
8
|
-
var _fs = _interopRequireDefault(require("fs"));
|
|
9
8
|
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
10
9
|
var _basicPrompts = require("../../common/basicPrompts");
|
|
11
|
-
var _dataService = require("../../common/dataService");
|
|
12
10
|
var _Kubectl = require("../../common/Kubectl");
|
|
13
11
|
var _types = require("../../common/types");
|
|
14
12
|
var _utils = require("../../common/utils");
|
|
@@ -54,38 +52,6 @@ const prompts = exports.prompts = {
|
|
|
54
52
|
enterGatewayManagerMode: 'Do you want to use API Manager with the API Gateway',
|
|
55
53
|
askIfOrgReplication: 'Do you want to replicate your original organization structure for your newly discovered APIs? If yes, make sure the organization names match the team names that are created in Amplify platform'
|
|
56
54
|
};
|
|
57
|
-
const downloadV7AgentBundle = async (type, version) => {
|
|
58
|
-
const fileName = type === _types.BundleType.DISCOVERY ? `discovery_agent-${version}.zip` : `traceability_agent-${version}.zip`;
|
|
59
|
-
const url = type === _types.BundleType.DISCOVERY ? `/v7_discovery_agent/${version}/discovery_agent-${version}.zip` : `/v7_traceability_agent/${version}/traceability_agent-${version}.zip`;
|
|
60
|
-
const service = await (0, _dataService.dataService)({
|
|
61
|
-
baseUrl: _types.PublicRepoUrl,
|
|
62
|
-
basePath: _types.BasePaths.V7Agents
|
|
63
|
-
});
|
|
64
|
-
try {
|
|
65
|
-
const {
|
|
66
|
-
stream
|
|
67
|
-
} = await service.download(url);
|
|
68
|
-
await helpers.streamPipeline(stream, _fs.default.createWriteStream(fileName));
|
|
69
|
-
return fileName;
|
|
70
|
-
} catch (err) {
|
|
71
|
-
throw new Error(`Failed to download the agent: ${err.message}`);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
const downloadBinary = async (bundleType, version) => {
|
|
75
|
-
const fileName = await downloadV7AgentBundle(bundleType, version);
|
|
76
|
-
await helpers.unzip(fileName);
|
|
77
|
-
_fs.default.unlinkSync(fileName);
|
|
78
|
-
};
|
|
79
|
-
const downloadBinaries = async installConfig => {
|
|
80
|
-
console.log('Downloading and unpacking binary files...');
|
|
81
|
-
if (installConfig.switches.isDaEnabled) {
|
|
82
|
-
await downloadBinary(_types.BundleType.DISCOVERY, installConfig.daVersion);
|
|
83
|
-
}
|
|
84
|
-
if (installConfig.switches.isTaEnabled) {
|
|
85
|
-
await downloadBinary(_types.BundleType.TRACEABILITY, installConfig.taVersion);
|
|
86
|
-
}
|
|
87
|
-
console.log('Downloading and unpacking is complete.');
|
|
88
|
-
};
|
|
89
55
|
const askIsGatewayOnlyMode = async () => {
|
|
90
56
|
const mode = await (0, _basicPrompts.askList)({
|
|
91
57
|
msg: prompts.enterGatewayManagerMode,
|
|
@@ -225,7 +191,7 @@ const generateSuccessHelpMsg = installConfig => {
|
|
|
225
191
|
console.log(_cliKit.chalk.yellow(_agents.svcAccMsg));
|
|
226
192
|
}
|
|
227
193
|
if (configType === _types.AgentConfigTypes.BINARIES) {
|
|
228
|
-
binarySuccessMsg(installConfig.centralConfig.ampcDosaInfo.isNew, installConfig.switches.isDaEnabled, installConfig.switches.isTaEnabled);
|
|
194
|
+
binarySuccessMsg(installConfig.centralConfig.ampcDosaInfo.isNew, installConfig.switches.isDaEnabled, installConfig.switches.isTaEnabled, installConfig.daVersion, installConfig.taVersion);
|
|
229
195
|
} else if (configType === _types.AgentConfigTypes.DOCKERIZED) {
|
|
230
196
|
dockerSuccessMsg(installConfig, verifiedEventsPath);
|
|
231
197
|
} else if (installConfig.switches.isHelmInstall) {
|
|
@@ -238,11 +204,6 @@ const installPreprocess = async installConfig => {
|
|
|
238
204
|
if (installConfig.deploymentType === _types.AgentConfigTypes.HELM && !installConfig.centralConfig.ampcDosaInfo.isNew) {
|
|
239
205
|
[installConfig.centralConfig.dosaAccount.publicKey, installConfig.centralConfig.dosaAccount.privateKey] = await helpers.askPublicAndPrivateKeysPath();
|
|
240
206
|
}
|
|
241
|
-
|
|
242
|
-
// attempt to download the binaries prior to creating resources
|
|
243
|
-
if (installConfig.switches.isBinaryInstall) {
|
|
244
|
-
await downloadBinaries(installConfig);
|
|
245
|
-
}
|
|
246
207
|
return installConfig;
|
|
247
208
|
};
|
|
248
209
|
exports.installPreprocess = installPreprocess;
|
|
@@ -327,7 +288,18 @@ const dockerSuccessMsg = (installConfig, eventLogPath) => {
|
|
|
327
288
|
console.log('\t', _cliKit.chalk.cyan(`-v ${eventLogPath} -v /data ${taImageVersion}`));
|
|
328
289
|
}
|
|
329
290
|
};
|
|
330
|
-
const binarySuccessMsg = (isNewDosa, isDaEnabled, isTaEnabled) => {
|
|
291
|
+
const binarySuccessMsg = (isNewDosa, isDaEnabled, isTaEnabled, daVersion, taVersion) => {
|
|
292
|
+
const baseUrl = 'https://repository.axway.com/artifactory/ampc-public-generic-release/v7-agents';
|
|
293
|
+
if (isDaEnabled) {
|
|
294
|
+
log(_cliKit.chalk.whiteBright('\nDownload the Discovery Agent binary:'));
|
|
295
|
+
log(_cliKit.chalk.cyan(`curl -O ${baseUrl}/v7_discovery_agent/${daVersion}/discovery_agent-${daVersion}.zip`));
|
|
296
|
+
log(_cliKit.chalk.cyan(`unzip discovery_agent-${daVersion}.zip`));
|
|
297
|
+
}
|
|
298
|
+
if (isTaEnabled) {
|
|
299
|
+
log(_cliKit.chalk.whiteBright('\nDownload the Traceability Agent binary:'));
|
|
300
|
+
log(_cliKit.chalk.cyan(`curl -O ${baseUrl}/v7_traceability_agent/${taVersion}/traceability_agent-${taVersion}.zip`));
|
|
301
|
+
log(_cliKit.chalk.cyan(`unzip traceability_agent-${taVersion}.zip`));
|
|
302
|
+
}
|
|
331
303
|
const daFiles = [ConfigFiles.DAEnvVars, ConfigFiles.EdgeDABinaryFile, ConfigFiles.EdgeDAYaml];
|
|
332
304
|
const taFiles = [ConfigFiles.TAEnvVars, ConfigFiles.EdgeTABinaryFile, ConfigFiles.EdgeTAYaml];
|
|
333
305
|
const keys = ['private_key.pem', 'public_key.pem'];
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getListByResource = exports.getLatestAgentVersion = exports.getEnvironmentId = exports.getCurrentUserOrgId = void 0;
|
|
7
7
|
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
8
8
|
var _CoreConfigController = require("../../../common/CoreConfigController");
|
|
9
|
-
var _dataService = require("../../../common/dataService");
|
|
10
|
-
var _types = require("../../../common/types");
|
|
11
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
10
|
const {
|
|
13
11
|
log
|
|
@@ -49,45 +47,18 @@ const getEnvironmentId = async (client, defsManager, environmentName, scopeName)
|
|
|
49
47
|
return (_resource$data = resource.data) !== null && _resource$data !== void 0 && _resource$data.metadata ? resource.data.metadata.id || '' : '';
|
|
50
48
|
};
|
|
51
49
|
exports.getEnvironmentId = getEnvironmentId;
|
|
52
|
-
const getLatestAgentVersion = async
|
|
50
|
+
const getLatestAgentVersion = async (client, agentName) => {
|
|
53
51
|
try {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Authorization: `Basic ${Buffer.from('anonymous:').toString('base64')}`
|
|
61
|
-
}, true);
|
|
62
|
-
if (response.tags.length === 0) {
|
|
63
|
-
return 'latest';
|
|
52
|
+
var _componentDef$spec, _componentDef$spec$la;
|
|
53
|
+
const componentDef = await client.getComponentDefinitionsByName(agentName);
|
|
54
|
+
const version = (_componentDef$spec = componentDef.spec) === null || _componentDef$spec === void 0 ? void 0 : (_componentDef$spec$la = _componentDef$spec.latest) === null || _componentDef$spec$la === void 0 ? void 0 : _componentDef$spec$la.version;
|
|
55
|
+
if (version) {
|
|
56
|
+
log(`Latest Version (${agentName}): ${version}`);
|
|
57
|
+
return version;
|
|
64
58
|
}
|
|
65
|
-
|
|
66
|
-
// skip any tags that are latest
|
|
67
|
-
if (prev === 'latest') {
|
|
68
|
-
return current;
|
|
69
|
-
} else if (current === 'latest') {
|
|
70
|
-
return prev;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// find the largest tag
|
|
74
|
-
const [pMajor, pMinor, pPatch] = prev.split('.').map(Number);
|
|
75
|
-
const [cMajor, cMinor, cPatch] = current.split('.').map(Number);
|
|
76
|
-
if (cMajor > pMajor) {
|
|
77
|
-
return current;
|
|
78
|
-
}
|
|
79
|
-
if (cMajor == pMajor && cMinor > pMinor) {
|
|
80
|
-
return current;
|
|
81
|
-
}
|
|
82
|
-
if (cMajor == pMajor && cMinor == pMinor && cPatch > pPatch) {
|
|
83
|
-
return current;
|
|
84
|
-
}
|
|
85
|
-
return prev;
|
|
86
|
-
});
|
|
87
|
-
log(`Latest Version (${agent}): ${latestVersion}`);
|
|
88
|
-
return latestVersion;
|
|
59
|
+
return 'latest';
|
|
89
60
|
} catch (e) {
|
|
90
|
-
log('Error
|
|
61
|
+
log('Error retrieving latest version, setting tag to latest');
|
|
91
62
|
log(e);
|
|
92
63
|
return 'latest';
|
|
93
64
|
}
|
|
@@ -777,6 +777,22 @@ class ApiServerClient {
|
|
|
777
777
|
throw e;
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
|
+
async getComponentDefinitionsByName(componentName, version = ApiServerVersions.v1alpha1) {
|
|
781
|
+
log('ApiServerClient.getComponentDefinitionsByName');
|
|
782
|
+
log('get component definitions');
|
|
783
|
+
try {
|
|
784
|
+
const service = await (0, _dataService.dataService)({
|
|
785
|
+
baseUrl: this.baseUrl,
|
|
786
|
+
region: this.region,
|
|
787
|
+
account: this.account
|
|
788
|
+
});
|
|
789
|
+
const component = await service.get(`/definitions/${version}/components/${componentName}`);
|
|
790
|
+
return component;
|
|
791
|
+
} catch (e) {
|
|
792
|
+
log('get component definitions, error: ', e);
|
|
793
|
+
throw e;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
780
796
|
|
|
781
797
|
/**
|
|
782
798
|
* BULK CALLS
|
package/dist/common/types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.docsUrl = exports.commonCmdArgsDescription = exports.cliVersionHeader = exports.YesNoChoices = exports.YesNo = exports.WAIT_TIMEOUT = exports.TrueFalseChoices = exports.TrueFalse = exports.TraceableRegionType = exports.TraceabilityConfig = exports.SaaSGatewayTypes = exports.Regions = exports.
|
|
6
|
+
exports.docsUrl = exports.commonCmdArgsDescription = exports.cliVersionHeader = exports.YesNoChoices = exports.YesNo = exports.WAIT_TIMEOUT = exports.TrueFalseChoices = exports.TrueFalse = exports.TraceableRegionType = exports.TraceabilityConfig = exports.SaaSGatewayTypes = exports.Regions = exports.PublicDockerRepoBaseUrl = exports.Protocol = exports.ProdBaseUrls = exports.PreprodRegions = exports.PreprodBaseUrls = exports.Platforms = exports.OutputTypes = exports.MAX_TABLE_STRING_LENGTH = exports.MAX_FILE_SIZE = exports.MAX_CACHE_FILE_SIZE = exports.LoggingSource = exports.LanguageTypes = exports.KindTypes = exports.Kind = exports.IstioProfileChoices = exports.IstioInstallValues = exports.IstioAgentValues = exports.IDPType = exports.IDPConfiguration = exports.IDPClientSecretAuthMethod = exports.IDPAuthType = exports.IDPAuthConfiguration = exports.IDPAuthClientSecret = exports.IDPAuthAccessToken = exports.GatewayTypes = exports.GatewayTypeToDataPlane = exports.GatewayMode = exports.EnvironmentConfigInfo = exports.DosaAccount = exports.DataPlaneNames = exports.DOSAConfigInfo = exports.ConfigTypes = exports.ComponentType = exports.CloudFormationConfig = exports.Certificate = exports.CentralAgentConfig = exports.CACHE_FILE_TTL_MILLISECONDS = exports.BundleType = exports.BasePaths = exports.AzureDataplaneMode = exports.AuthUrls = exports.ApigeeMetricsFilterConfig = exports.AgentTypes = exports.AgentResourceKind = exports.AgentNames = exports.AgentInstallSwitches = exports.AgentInstallConfig = exports.AgentConfigTypes = exports.AWSRegions = exports.APIGEEXDISCOVERYMODES = exports.APIGEEXAuthType = exports.APICDeployments = exports.ABORT_TIMEOUT = void 0;
|
|
7
7
|
var _utils = require("./utils");
|
|
8
8
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -38,8 +38,7 @@ let Kind = exports.Kind = /*#__PURE__*/function (Kind) {
|
|
|
38
38
|
* NOTE: order of this array is used to orchestrate bulk api calls (see utils/compareDocsByKind)
|
|
39
39
|
*/
|
|
40
40
|
const KindTypes = exports.KindTypes = [Kind.Environment, Kind.APIService, Kind.APIServiceRevision, Kind.APIServiceInstance, Kind.Secret, Kind.Webhook, Kind.ConsumerSubscriptionDefinition, Kind.ConsumerInstance];
|
|
41
|
-
const
|
|
42
|
-
const PublicDockerRepoBaseUrl = exports.PublicDockerRepoBaseUrl = 'axway.jfrog.io/ampc-public-docker-release';
|
|
41
|
+
const PublicDockerRepoBaseUrl = exports.PublicDockerRepoBaseUrl = 'repository.axway.com/ampc-public-docker-release';
|
|
43
42
|
let BasePaths = exports.BasePaths = /*#__PURE__*/function (BasePaths) {
|
|
44
43
|
BasePaths["ApiServer"] = "/apis";
|
|
45
44
|
BasePaths["ApiCentral"] = "/api/v1";
|
|
@@ -47,7 +46,6 @@ let BasePaths = exports.BasePaths = /*#__PURE__*/function (BasePaths) {
|
|
|
47
46
|
BasePaths["V7Agents"] = "/artifactory/ampc-public-generic-release/v7-agents";
|
|
48
47
|
BasePaths["AWSAgents"] = "/artifactory/ampc-public-generic-release/aws-agents";
|
|
49
48
|
BasePaths["DockerAgentPublicRepo"] = "/agent";
|
|
50
|
-
BasePaths["DockerAgentAPIRepoPath"] = "/artifactory/api/docker/ampc-public-docker-release/v2/agent";
|
|
51
49
|
return BasePaths;
|
|
52
50
|
}({});
|
|
53
51
|
let ConfigTypes = exports.ConfigTypes = /*#__PURE__*/function (ConfigTypes) {
|
|
@@ -175,6 +173,13 @@ const IstioProfileChoices = exports.IstioProfileChoices = [{
|
|
|
175
173
|
name: 'preview',
|
|
176
174
|
value: 'preview'
|
|
177
175
|
}];
|
|
176
|
+
let ComponentType = exports.ComponentType = /*#__PURE__*/function (ComponentType) {
|
|
177
|
+
ComponentType["Agent"] = "agent";
|
|
178
|
+
ComponentType["DA"] = "DiscoveryAgent";
|
|
179
|
+
ComponentType["TA"] = "TraceabilityAgent";
|
|
180
|
+
ComponentType["CA"] = "ComplianceAgent";
|
|
181
|
+
return ComponentType;
|
|
182
|
+
}({});
|
|
178
183
|
// exporting for tests
|
|
179
184
|
let AgentConfigTypes = exports.AgentConfigTypes = /*#__PURE__*/function (AgentConfigTypes) {
|
|
180
185
|
AgentConfigTypes["HOSTED"] = "Hosted";
|