Skip to content

Commit

Permalink
Merge pull request #262 from zowe/v3-vsam-skip
Browse files Browse the repository at this point in the history
Skip VSAM Init
  • Loading branch information
1000TurquoisePogs authored Oct 15, 2024
2 parents 9b7761d + fa92f5e commit 1c2008f
Show file tree
Hide file tree
Showing 10 changed files with 203 additions and 81 deletions.
39 changes: 31 additions & 8 deletions src/actions/InstallationHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,23 @@ class Installation {
try{
ProgressStore.set('downloadUnpax.getSchemas', false);
ProgressStore.set('downloadUnpax.getExampleYaml', false);

const currentConfig: any = ConfigurationStore.getConfig();
let yamlObj
const zoweRuntimePath = installationArgs.installationDir;
let readPaxYamlAndSchema = await this.readExampleYamlAndSchema(connectionArgs, zoweRuntimePath);
let parsedSchema = false, parsedYaml = false;

const manifestFileFromPax = readPaxYamlAndSchema?.details?.schemas?.manifestFile;
let manifestFile;

if(manifestFileFromPax) {
try {
manifestFile = JSON.parse(manifestFileFromPax);
} catch (error) {
console.error('Error parsing manifest file:', error);
}
}
if(readPaxYamlAndSchema.details.yaml){
const yamlFromPax = readPaxYamlAndSchema.details.yaml;
if(yamlFromPax){
Expand Down Expand Up @@ -164,7 +176,7 @@ class Installation {
ConfigurationStore.setSchema(FALLBACK_SCHEMA);
return {status: false, details: {message: 'no schemas found from pax'}}
}
return {status: parsedSchema && parsedYaml, details: {message: "Successfully retrieved example-zowe.yaml and schemas", mergedYaml: yamlObj}}
return {status: parsedSchema && parsedYaml, details: {message: "Successfully retrieved example-zowe.yaml and schemas", mergedYaml: yamlObj, manifestFile}}
}
} catch (e) {
ConfigurationStore.setSchema(FALLBACK_SCHEMA);
Expand Down Expand Up @@ -245,15 +257,24 @@ class Installation {
return {status: false, details: `Error unpaxing Zowe archive: ${unpax.details}`};
}
}

let yamlObj = {};
let manifestFile = {};

await this.getExampleYamlAndSchemas(connectionArgs, installationArgs).then((res: IResponse) => {
if(res.status){
if(res.details.mergedYaml != undefined){
yamlObj = res.details.mergedYaml;
}

if(!res?.status) {
return { status: false, details: { message: 'Failed to get YAML and schemas.' } };
}

manifestFile = res.details?.manifestFile;

if(res.details?.mergedYaml != undefined){
yamlObj = res.details.mergedYaml;
}

})
return {status: download.status && uploadYaml.status && upload.status && unpax.status, details: {message: 'Zowe unpax successful.', mergedYaml: yamlObj}};
return {status: download.status && uploadYaml.status && upload.status && unpax.status, details: {message: 'Zowe unpax successful.', mergedYaml: yamlObj, manifestFile}};
} catch (error) {
return {status: false, details: error.message};
}
Expand Down Expand Up @@ -612,10 +633,12 @@ export class FTPInstallation extends Installation {
const yamlSchema = await new FileTransfer().download(connectionArgs, yamlSchemaPath, DataType.ASCII);
const serverCommonPath = `${installDir}/schemas/server-common.json`;
const serverCommon = await new FileTransfer().download(connectionArgs, serverCommonPath, DataType.ASCII);
return {status: true, details: {yaml, schemas: {yamlSchema, serverCommon}}};
const manifestFilePath = `${installDir}/manifest.json`;
const manifestFile = await new FileTransfer().download(connectionArgs, manifestFilePath, DataType.ASCII);
return {status: true, details: {yaml, schemas: {yamlSchema, serverCommon, manifestFile}}};
} catch (e) {
console.log("Error downloading example-zowe.yaml and schemas:", e.message);
return {status: false, details: {yaml: '', schemas: {yamlSchema: '', serverCommon: ''}}};
return {status: false, details: {yaml: '', schemas: {yamlSchema: '', serverCommon: '', manifestFile: ''}}};
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/common/Utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const NETWORKING_STAGE_LABEL = "Networking";
export const APF_AUTH_STAGE_LABEL = "APF Auth";
export const SECURITY_STAGE_LABEL = "Security";
export const CERTIFICATES_STAGE_LABEL = "Certificates";
export const VSAM_STAGE_LABEL = "Vsam";
export const CACHING_SERVICE_LABEL = "Caching Service";
export const STC_STAGE_LABEL = "Stcs";
export const LAUNCH_CONFIG_STAGE_LABEL = "Launch Config";
export const REVIEW_INSTALL_STAGE_LABEL = "Review Installation";
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/components/configuration-wizard/Wizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import { selectLoading } from './wizardSlice';
import { useAppSelector } from '../../hooks';
import InitApfAuth from '../stages/InitApfAuth';
import Networking from '../stages/Networking';
import Vsam from '../stages/Vsam';
import CachingService from '../stages/CachingService';
import LaunchConfig from '../stages/LaunchConfig';
import { getProgress } from '../stages/progress/StageProgressStatus';
import Unpax from '../stages/Unpax';
import { APF_AUTH_STAGE_LABEL, CERTIFICATES_STAGE_LABEL, CONNECTION_STAGE_LABEL, FINISH_INSTALL_STAGE_LABEL, INIT_STAGE_LABEL, INSTALLATION_TYPE_STAGE_LABEL, INSTALL_STAGE_LABEL, LAUNCH_CONFIG_STAGE_LABEL, NETWORKING_STAGE_LABEL, PLANNING_STAGE_LABEL, REVIEW_INSTALL_STAGE_LABEL, SECURITY_STAGE_LABEL, UNPAX_STAGE_LABEL, VSAM_STAGE_LABEL } from '../common/Utils';
import { APF_AUTH_STAGE_LABEL, CERTIFICATES_STAGE_LABEL, CONNECTION_STAGE_LABEL, FINISH_INSTALL_STAGE_LABEL, INIT_STAGE_LABEL, INSTALLATION_TYPE_STAGE_LABEL, INSTALL_STAGE_LABEL, LAUNCH_CONFIG_STAGE_LABEL, NETWORKING_STAGE_LABEL, PLANNING_STAGE_LABEL, REVIEW_INSTALL_STAGE_LABEL, SECURITY_STAGE_LABEL, UNPAX_STAGE_LABEL, CACHING_SERVICE_LABEL } from '../common/Utils';

const mvsDatasetInitProgress = getProgress('datasetInstallationStatus');

Expand All @@ -42,8 +42,8 @@ export const stages = [
{id: 2, label: APF_AUTH_STAGE_LABEL, component: <InitApfAuth/>, hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Security Setup', statusKey: 'apfAuthStatus'},
{id: 3, label: SECURITY_STAGE_LABEL, component: <Security/>, hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to STC Setup', statusKey: 'securityStatus'},
{id: 4, label: 'Stcs', component: <Stcs/>, hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Certificates Setup', statusKey: 'stcsStatus'},
{id: 5, label: CERTIFICATES_STAGE_LABEL, component: <Certificates/>, hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Vsam Setup', statusKey: 'certificateStatus'},
{id: 6, label: VSAM_STAGE_LABEL, component: <Vsam/>, hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Launch Setup', statusKey: 'vsamStatus'},
{id: 5, label: CERTIFICATES_STAGE_LABEL, component: <Certificates/>, hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Caching Service Setup', statusKey: 'certificateStatus'},
{id: 6, label: CACHING_SERVICE_LABEL, component: <CachingService/>, hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Launch Setup', statusKey: 'cachingServiceStatus'},
{id: 7, label: LAUNCH_CONFIG_STAGE_LABEL, component: <LaunchConfig/>, hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Instance Setup', statusKey: 'launchConfigStatus'},
], nextButton: 'Review', statusKey: 'initializationStatus'},
{id: 5, label: REVIEW_INSTALL_STAGE_LABEL, component: <ReviewInstallation/>, hasJCL: false, isSkippable: false, hasOutput: false, steps: 1, nextButton: 'Finish Installation', statusKey: 'reviewStatus'},
Expand Down
Loading

0 comments on commit 1c2008f

Please sign in to comment.