Skip to content

Commit 3f45182

Browse files
committed
initial push code
1 parent f986937 commit 3f45182

File tree

16 files changed

+322
-65
lines changed

16 files changed

+322
-65
lines changed

Jenkinsfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def PRODUCT_NAME = "zowe-cli-cics-deploy-plugin"
7878
/**
7979
* This is where the Zowe project needs to be installed
8080
*/
81-
def ZOWE_CLI_INSTALL_DIR = "/.npm-global/lib/node_modules/@brightside/core"
81+
def ZOWE_CLI_INSTALL_DIR = "/.npm-global/lib/node_modules/@zowee/cli"
8282

8383
def ARTIFACTORY_CREDENTIALS_ID = "c8e3aa62-5eef-4e6b-8a3f-aa1006a7ef01"
8484

@@ -201,7 +201,8 @@ pipeline {
201201
echo "Install Zowe CLI globaly"
202202
sh("npm set registry https://registry.npmjs.org")
203203
sh("npm set @brightside:registry https://api.bintray.com/npm/ca/brightside/")
204-
sh("npm install -g @brightside/core@next")
204+
sh("npm set @zowe:registry https://api.bintray.com/npm/ca/brightside/")
205+
sh("npm install -g @zowe/cli@latest")
205206
sh("zowe --version")
206207
}
207208
}

__tests__/__system__/cli/generate/__snapshots__/cli.generate.bundle.system.test.ts.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,17 @@ exports[`cics-deploy generate bundle paramters should customise port in generate
124124
# Including files in the profile
125125
# ------------------------------
126126
#
127-
# INCLUDE specifies a file to be included in this profile. The file can
127+
# %INCLUDE specifies a file to be included in this profile. The file can
128128
# contain common system-wide configuration that can then be maintained
129129
# separate to the application configuration. Symbols can be used when
130130
# specifying the file to be included.
131131
#
132132
# Examples:
133-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
134-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
135-
# INCLUDE=&CONFIGROOT;/debug.profile
133+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
134+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
135+
# %INCLUDE=&CONFIGROOT;/debug.profile
136136
#
137-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
137+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
138138
#
139139
#**********************************************************************
140140
#
@@ -304,17 +304,17 @@ exports[`cics-deploy generate bundle should generate a bundle using defaults fro
304304
# Including files in the profile
305305
# ------------------------------
306306
#
307-
# INCLUDE specifies a file to be included in this profile. The file can
307+
# %INCLUDE specifies a file to be included in this profile. The file can
308308
# contain common system-wide configuration that can then be maintained
309309
# separate to the application configuration. Symbols can be used when
310310
# specifying the file to be included.
311311
#
312312
# Examples:
313-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
314-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
315-
# INCLUDE=&CONFIGROOT;/debug.profile
313+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
314+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
315+
# %INCLUDE=&CONFIGROOT;/debug.profile
316316
#
317-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
317+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
318318
#
319319
#**********************************************************************
320320
#

__tests__/api/BundleContent/__snapshots__/Nodejsapp.test.ts.snap

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ exports[`NodejsappBundlePart01 Create a NodejsappBundlePart 3`] = `
7171
# Including files in the profile
7272
# ------------------------------
7373
#
74-
# INCLUDE specifies a file to be included in this profile. The file can
74+
# %INCLUDE specifies a file to be included in this profile. The file can
7575
# contain common system-wide configuration that can then be maintained
7676
# separate to the application configuration. Symbols can be used when
7777
# specifying the file to be included.
7878
#
7979
# Examples:
80-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
81-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
82-
# INCLUDE=&CONFIGROOT;/debug.profile
80+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
81+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
82+
# %INCLUDE=&CONFIGROOT;/debug.profile
8383
#
84-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
84+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
8585
#
8686
#**********************************************************************
8787
#
@@ -201,17 +201,17 @@ exports[`NodejsappBundlePart01 Create a NodejsappBundlePart 4`] = `
201201
# Including files in the profile
202202
# ------------------------------
203203
#
204-
# INCLUDE specifies a file to be included in this profile. The file can
204+
# %INCLUDE specifies a file to be included in this profile. The file can
205205
# contain common system-wide configuration that can then be maintained
206206
# separate to the application configuration. Symbols can be used when
207207
# specifying the file to be included.
208208
#
209209
# Examples:
210-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
211-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
212-
# INCLUDE=&CONFIGROOT;/debug.profile
210+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
211+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
212+
# %INCLUDE=&CONFIGROOT;/debug.profile
213213
#
214-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
214+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
215215
#
216216
#**********************************************************************
217217
#
@@ -338,17 +338,17 @@ exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with bad chars 3`] =
338338
# Including files in the profile
339339
# ------------------------------
340340
#
341-
# INCLUDE specifies a file to be included in this profile. The file can
341+
# %INCLUDE specifies a file to be included in this profile. The file can
342342
# contain common system-wide configuration that can then be maintained
343343
# separate to the application configuration. Symbols can be used when
344344
# specifying the file to be included.
345345
#
346346
# Examples:
347-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
348-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
349-
# INCLUDE=&CONFIGROOT;/debug.profile
347+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
348+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
349+
# %INCLUDE=&CONFIGROOT;/debug.profile
350350
#
351-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
351+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
352352
#
353353
#**********************************************************************
354354
#
@@ -468,17 +468,17 @@ exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with bad chars 4`] =
468468
# Including files in the profile
469469
# ------------------------------
470470
#
471-
# INCLUDE specifies a file to be included in this profile. The file can
471+
# %INCLUDE specifies a file to be included in this profile. The file can
472472
# contain common system-wide configuration that can then be maintained
473473
# separate to the application configuration. Symbols can be used when
474474
# specifying the file to be included.
475475
#
476476
# Examples:
477-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
478-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
479-
# INCLUDE=&CONFIGROOT;/debug.profile
477+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
478+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
479+
# %INCLUDE=&CONFIGROOT;/debug.profile
480480
#
481-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
481+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
482482
#
483483
#**********************************************************************
484484
#
@@ -605,17 +605,17 @@ exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with long name 3`] =
605605
# Including files in the profile
606606
# ------------------------------
607607
#
608-
# INCLUDE specifies a file to be included in this profile. The file can
608+
# %INCLUDE specifies a file to be included in this profile. The file can
609609
# contain common system-wide configuration that can then be maintained
610610
# separate to the application configuration. Symbols can be used when
611611
# specifying the file to be included.
612612
#
613613
# Examples:
614-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
615-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
616-
# INCLUDE=&CONFIGROOT;/debug.profile
614+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
615+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
616+
# %INCLUDE=&CONFIGROOT;/debug.profile
617617
#
618-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
618+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
619619
#
620620
#**********************************************************************
621621
#
@@ -735,17 +735,17 @@ exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with long name 4`] =
735735
# Including files in the profile
736736
# ------------------------------
737737
#
738-
# INCLUDE specifies a file to be included in this profile. The file can
738+
# %INCLUDE specifies a file to be included in this profile. The file can
739739
# contain common system-wide configuration that can then be maintained
740740
# separate to the application configuration. Symbols can be used when
741741
# specifying the file to be included.
742742
#
743743
# Examples:
744-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
745-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
746-
# INCLUDE=&CONFIGROOT;/debug.profile
744+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
745+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
746+
# %INCLUDE=&CONFIGROOT;/debug.profile
747747
#
748-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
748+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
749749
#
750750
#**********************************************************************
751751
#
@@ -872,17 +872,17 @@ exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with missing port nu
872872
# Including files in the profile
873873
# ------------------------------
874874
#
875-
# INCLUDE specifies a file to be included in this profile. The file can
875+
# %INCLUDE specifies a file to be included in this profile. The file can
876876
# contain common system-wide configuration that can then be maintained
877877
# separate to the application configuration. Symbols can be used when
878878
# specifying the file to be included.
879879
#
880880
# Examples:
881-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
882-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
883-
# INCLUDE=&CONFIGROOT;/debug.profile
881+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
882+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
883+
# %INCLUDE=&CONFIGROOT;/debug.profile
884884
#
885-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
885+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
886886
#
887887
#**********************************************************************
888888
#
@@ -1001,17 +1001,17 @@ exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with missing port nu
10011001
# Including files in the profile
10021002
# ------------------------------
10031003
#
1004-
# INCLUDE specifies a file to be included in this profile. The file can
1004+
# %INCLUDE specifies a file to be included in this profile. The file can
10051005
# contain common system-wide configuration that can then be maintained
10061006
# separate to the application configuration. Symbols can be used when
10071007
# specifying the file to be included.
10081008
#
10091009
# Examples:
1010-
# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
1011-
# INCLUDE=&USSCONFIG;/nodejs/sdk.profile
1012-
# INCLUDE=&CONFIGROOT;/debug.profile
1010+
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
1011+
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
1012+
# %INCLUDE=&CONFIGROOT;/debug.profile
10131013
#
1014-
INCLUDE=&USSCONFIG;/nodejsapps/general.profile
1014+
%INCLUDE=&USSCONFIG;/nodejsapps/general.profile
10151015
#
10161016
#**********************************************************************
10171017
#

docs/tutorials/cics-deploy/CICSDeployPlugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Before you begin, [set up](../Setup.md) your environment to install a plug-in.
55
## Overview
66
This tutorial covers installing and running this bundled Zowe CLI cics-deploy plugin as-is (without modification).
77

8-
The plug-in adds a command to the CLI that supports generation and deployment of CICS bundle resources from the current directory of your PC.
8+
The plug-in adds a command to the CLI that supports generation and deployment of CICS bundle resources from the current directory of your workstation.
99

1010
## Installing the cics-deploy plug-in to Zowe CLI
1111

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
"configurationModule": "lib/imperative.js"
3131
},
3232
"dependencies": {
33-
"@zowe/cli": "^3.2.0",
3433
"@zowe/imperative": "^3.0.0",
3534
"@brightside/core": "^2.0.0",
3635
"xml2json": "^0.11.2"
3736
},
3837
"devDependencies": {
38+
"@zowe/cli": "^3.2.0",
3939
"@types/fs-extra": "^5.0.5",
4040
"@types/jest": "^20.0.5",
4141
"@types/node": "^8.0.0",

src/api/BundleContent/Manifest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class Manifest {
7575
this.metainfDir = this.bundleDirectory + "/META-INF";
7676
this.manifestFile = this.metainfDir + "/cics.xml";
7777

78-
// If 'merge' is set the attempt to read any existing manifest that may
78+
// If 'merge' is set then attempt to read any existing manifest that may
7979
// already exist. Subsequent changes will be merged with the existing
8080
// content.
8181
if (this.merge === true) {

src/api/BundleContent/TemplateNodejsappProfile.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ export class TemplateNodejsappProfile {
7676
"# Including files in the profile\n" +
7777
"# ------------------------------\n" +
7878
"#\n" +
79-
"# INCLUDE specifies a file to be included in this profile. The file can\n" +
79+
"# %INCLUDE specifies a file to be included in this profile. The file can\n" +
8080
"# contain common system-wide configuration that can then be maintained\n" +
8181
"# separate to the application configuration. Symbols can be used when\n" +
8282
"# specifying the file to be included.\n" +
8383
"#\n" +
8484
"# Examples:\n" +
85-
"# INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile\n" +
86-
"# INCLUDE=&USSCONFIG;/nodejs/sdk.profile\n" +
87-
"# INCLUDE=&CONFIGROOT;/debug.profile\n" +
85+
"# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile\n" +
86+
"# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile\n" +
87+
"# %INCLUDE=&CONFIGROOT;/debug.profile\n" +
8888
"#\n" +
89-
"INCLUDE=&USSCONFIG;/nodejsapps/general.profile\n" +
89+
"%INCLUDE=&USSCONFIG;/nodejsapps/general.profile\n" +
9090
"#\n" +
9191
"#**********************************************************************\n" +
9292
"#\n" +

src/api/BundleDeploy/BundleDeployer.ts

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export class BundleDeployer {
2727
private params: IHandlerParameters;
2828
private PROGRESS_BAR_INTERVAL = 1500; // milliseconds
2929
private PROGRESS_BAR_MAX = 67;
30+
private parmsValidated: boolean = false;
31+
private hlqsValidated: boolean = false;
3032

3133
/**
3234
* Constructor for a BundleDeployer.
@@ -47,7 +49,7 @@ export class BundleDeployer {
4749
public async deployBundle(): Promise<string> {
4850

4951
// Validate that the parms are valid for Deploy
50-
ParmValidator.validateDeploy(this.params);
52+
this.validateDeployParms();
5153

5254
// Create a zosMF session
5355
const session = await this.createZosMFSession();
@@ -70,8 +72,8 @@ export class BundleDeployer {
7072
*/
7173
public async undeployBundle(): Promise<string> {
7274

73-
// Validate that the parms are valid for Deploy
74-
ParmValidator.validateUndeploy(this.params);
75+
// Validate that the parms are valid for Undeploy
76+
this.validateUndeployParms();
7577

7678
// Create a zosMF session
7779
const session = await this.createZosMFSession();
@@ -86,6 +88,32 @@ export class BundleDeployer {
8688
return this.submitJCL(jcl, session);
8789
}
8890

91+
/**
92+
* Validate the input parameters are suitable for the DEPLOY action
93+
* @returns {Promise<string>}
94+
* @throws ImperativeError
95+
* @memberof BundleDeployer
96+
*/
97+
public validateDeployParms() {
98+
if (this.parmsValidated === false) {
99+
ParmValidator.validateDeploy(this.params);
100+
this.parmsValidated = true;
101+
}
102+
}
103+
104+
/**
105+
* Validate the input parameters are suitable for the UNDEPLOY action
106+
* @returns {Promise<string>}
107+
* @throws ImperativeError
108+
* @memberof BundleDeployer
109+
*/
110+
public validateUndeployParms() {
111+
if (this.parmsValidated === false) {
112+
ParmValidator.validateUndeploy(this.params);
113+
this.parmsValidated = true;
114+
}
115+
}
116+
89117
private wrapLongLineForJCL(lineOfText: string): string {
90118
const MAX_LINE_LEN = 71;
91119

@@ -174,6 +202,12 @@ export class BundleDeployer {
174202
}
175203

176204
private async checkHLQDatasets(session: any) {
205+
206+
// No need to revalidate multiple times during a push command
207+
if (this.hlqsValidated === true) {
208+
return;
209+
}
210+
177211
// Check that the CICS dataset value looks valid and can be viewed
178212
// Access errors will trigger an Exception
179213
const cicspds = this.params.arguments.cicshlq + ".SDFHLOAD";
@@ -200,6 +234,8 @@ export class BundleDeployer {
200234
if (JSON.stringify(listResp).indexOf("EYU9ABSI") === -1) {
201235
throw new Error("EYU9ABSI not found in SEYUAUTH within the --cpsmhlq dataset: " + cpsmpds);
202236
}
237+
238+
this.hlqsValidated = true;
203239
}
204240

205241
private updateProgressBar(status: ITaskWithStatus) {

0 commit comments

Comments
 (0)