Skip to content

Commit 4685f4d

Browse files
Merge branch 'master' into slacknotify
2 parents 631b663 + 050a938 commit 4685f4d

22 files changed

+503
-146
lines changed

Jenkinsfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pipeline {
224224
//sh("npm set @zowe:registry https://api.bintray.com/npm/ca/brightside/")
225225
sh("npm set @zowe:registry https://registry.npmjs.org")
226226

227-
sh("npm install -g @zowe/cli@latest")
227+
sh("npm install -g @zowe/cli@daily")
228228
sh("zowe --version")
229229
}
230230
}
@@ -542,6 +542,9 @@ pipeline {
542542
expression {
543543
return BRANCH_NAME == MASTER_BRANCH
544544
}
545+
expression {
546+
return GIT_COMMIT =! GIT_PREVIOUS_SUCCESSFUL_COMMIT
547+
}
545548
}
546549
}
547550
steps {
@@ -593,6 +596,9 @@ pipeline {
593596
expression {
594597
return BRANCH_NAME == MASTER_BRANCH
595598
}
599+
expression {
600+
return GIT_COMMIT =! GIT_PREVIOUS_SUCCESSFUL_COMMIT
601+
}
596602
}
597603
}
598604
steps {

__tests__/__src__/environment/TestEnvironment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class TestEnvironment {
147147
private static async installPlugin(testEnvironment: ITestEnvironment) {
148148
let installScript: string = TemporaryScripts.SHEBANG;
149149
installScript += TemporaryScripts.ZOWE_BIN + " plugins install ../../../../\n"; // install plugin from root of project
150-
installScript += TemporaryScripts.ZOWE_BIN + " plugins validate @brightside/zowe-cli-cics-deploy-plugin\n";
150+
installScript += TemporaryScripts.ZOWE_BIN + " plugins validate zowe-cli-cics-deploy-plugin\n";
151151
installScript += TemporaryScripts.ZOWE_BIN + " cdep --help\n"; // check that the plugin help is available
152152
const scriptPath = testEnvironment.workingDir + "/install_plugin.sh";
153153
IO.writeFile(scriptPath, Buffer.from(installScript));
@@ -156,7 +156,7 @@ export class TestEnvironment {
156156

157157
if (output.status !== 0) {
158158
throw new ImperativeError({
159-
msg: "Install of '@brightside/zowe-cli-cics-deploy-plugin' plugin failed! You should delete the script: \n'" + scriptPath + "' " +
159+
msg: "Install of 'zowe-cli-cics-deploy-plugin' plugin failed! You should delete the script: \n'" + scriptPath + "' " +
160160
"after reviewing it to check for possible errors.\n Output of the plugin install command:\n" + output.stderr.toString() +
161161
output.stdout.toString()
162162
});

__tests__/api/BundlePush/BundlePusher.test.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ const DEFAULT_PARAMTERS: IHandlerParameters = {
2424
},
2525
profiles: {
2626
get: (type: string) => {
27+
if (type === "zosmf") {
28+
return zosmfProfile;
29+
}
30+
if (type === "ssh") {
31+
return sshProfile;
32+
}
2733
return {};
2834
}
2935
} as any,
@@ -60,6 +66,8 @@ const IS_NOT_DIRECTORY: any = {
6066
isDirectory: jest.fn((directory) => (false))
6167
};
6268
let consoleText = "";
69+
let zosmfProfile = {};
70+
let sshProfile = {};
6371

6472
// Initialise xml2json before mocking anything
6573
const parser = require("xml2json");
@@ -99,6 +107,8 @@ describe("BundlePusher01", () => {
99107
readdirSpy = jest.spyOn(fs, "readdirSync").mockImplementation(() => ([]));
100108
lstatSpy = jest.spyOn(fs, "lstatSync").mockImplementation(() => ( IS_NOT_DIRECTORY ));
101109
consoleText = "";
110+
zosmfProfile = {};
111+
sshProfile = {};
102112
});
103113
afterEach(() => {
104114
jest.restoreAllMocks();
@@ -191,6 +201,38 @@ describe("BundlePusher01", () => {
191201
expect(zosMFSpy).toHaveBeenCalledTimes(1);
192202
expect(sshSpy).toHaveBeenCalledTimes(1);
193203
});
204+
it("should complain with mismatching zOSMF and SSH profile host names", async () => {
205+
zosmfProfile = { host: "wibble" };
206+
sshProfile = { host: "wobble" };
207+
208+
await runPushTest("__tests__/__resources__/ExampleBundle01", true,
209+
"PUSH operation completed.");
210+
expect(consoleText).toContain("WARNING: ssh profile --host value 'wobble' does not match zosmf value 'wibble'.");
211+
});
212+
it("should not complain with matching zOSMF and SSH profile host names", async () => {
213+
zosmfProfile = { host: "wibble" };
214+
sshProfile = { host: "wibble" };
215+
216+
await runPushTest("__tests__/__resources__/ExampleBundle01", true,
217+
"PUSH operation completed.");
218+
expect(consoleText).not.toContain("WARNING: ssh profile");
219+
});
220+
it("should complain with mismatching zOSMF and SSH profile user names", async () => {
221+
zosmfProfile = { host: "wibble", user: "fred" };
222+
sshProfile = { host: "wibble", user: "joe" };
223+
224+
await runPushTest("__tests__/__resources__/ExampleBundle01", true,
225+
"PUSH operation completed.");
226+
expect(consoleText).toContain("WARNING: ssh profile --user value 'joe' does not match zosmf value 'fred'.");
227+
});
228+
it("should not complain with matching zOSMF and SSH profile user names", async () => {
229+
zosmfProfile = { host: "wibble", user: "fred" };
230+
sshProfile = { host: "wibble", user: "fred" };
231+
232+
await runPushTest("__tests__/__resources__/ExampleBundle01", true,
233+
"PUSH operation completed.");
234+
expect(consoleText).not.toContain("WARNING: ssh profile");
235+
});
194236
it("should complain if remote bundle dir mkdir fails", async () => {
195237
createSpy.mockImplementationOnce(() => { throw new Error( "Injected Create error" ); });
196238
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", false,

docs/404.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "Page Not Found"
33
search: exclude
4+
sidebar: cdp_sidebar
45
---
56

67
Sorry, but the page you were trying to view does not exist. Try searching for it or looking at the URL to see if it looks correct.

docs/_data/sidebars/cdp_sidebar.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ entries:
2424
- title: Tutorials
2525
output: web
2626
folderitems:
27-
- title: Deploying your first app
28-
url: /cdp-Deploying-your-first-app.html
27+
- title: Deploying your first Node.js app
28+
url: /cdp-Deploying-your-first-nodejs-app.html
2929
output: web
3030
- title: Deploying using individual actions
3131
url: /cdp-Deploying-using-individual-actions.html
3232
output: web
33+
- title: Provision a CICS region with z/OS PT
34+
url: /cdp-Provision-a-CICS-region-using-zospt.html
35+
output: web
3336

3437
- title: Concepts
3538
output: web
@@ -40,7 +43,7 @@ entries:
4043
- title: Zowe CLI profiles
4144
url: /cdp-zowe-profiles.html
4245
output: web
43-
- title: CICS Bundles
46+
- title: CICS bundles
4447
url: /cdp-cics-bundles.html
4548
output: web
4649

@@ -50,6 +53,12 @@ entries:
5053
- title: Log and trace files
5154
url: /cdp-Troubleshooting-General.html
5255
output: web
56+
- title: Precautionary checks
57+
url: /cdp-Precautionary-Checks.html
58+
output: web
59+
- title: Potential problems
60+
url: /cdp-Troubleshooting-Symptoms.html
61+
output: web
5362

5463
- title: Commands - zowe profiles
5564
output: web
@@ -70,7 +79,7 @@ entries:
7079
url: cdp-CLIReadMe#set-default--set
7180
output: web
7281

73-
- title: Commands - CICS deploy
82+
- title: Commands - zowe cics-deploy
7483
output: web
7584
folderitems:
7685
- title: generate bundle

docs/_data/tags.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ allowed-tags:
55
- getting_started
66
- concepts
77
- troubleshooting
8+
- tutorial

docs/js/customscripts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $(document).ready(function () {
2626
* Modified to use a fontawesome icon.
2727
*/
2828
// get all <pre> elements
29-
var allCodeBlocksElements = $("pre");
29+
var allCodeBlocksElements = $("pre:not(.messageText)");
3030

3131
allCodeBlocksElements.each(function (i) {
3232
// add different id for each code block

docs/pages/cdp/CLIReadme.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ the target group of CICS regions\.
9090
* `--timeout` | `--to` *(number)*
9191

9292
* An optional numerical value that specifies the maximum amount of time in seconds
93-
(1 \- 1800 inclusive) for the DFHDPLOY command to complete\.
93+
(1 \- 1800 inclusive) for the DFHDPLOY command to complete\. If not specified
94+
DFHDPLOY will use its default of 300 seconds\.
9495

9596
* `--target-state` | `--ts` | `--targetstate` *(string)*
9697

@@ -287,7 +288,8 @@ Push a CICS bundle from the working directory to a target CICSplex\.
287288
* `--timeout` | `--to` *(number)*
288289

289290
* An optional numerical value that specifies the maximum amount of time in seconds
290-
(1 \- 1800 inclusive) for the DFHDPLOY command to complete\.
291+
(1 \- 1800 inclusive) for the DFHDPLOY command to complete\. If not specified
292+
DFHDPLOY will use its default of 300 seconds\.
291293

292294
* `--target-state` | `--ts` | `--targetstate` *(string)*
293295

@@ -408,7 +410,8 @@ target group of CICS regions\.
408410
* `--timeout` | `--to` *(number)*
409411

410412
* An optional numerical value that specifies the maximum amount of time in seconds
411-
(1 \- 1800 inclusive) for the DFHDPLOY command to complete\.
413+
(1 \- 1800 inclusive) for the DFHDPLOY command to complete\. If not specified
414+
DFHDPLOY will use its default of 300 seconds\.
412415

413416
* `--target-state` | `--ts` | `--targetstate` *(string)*
414417

docs/pages/cdp/cdp-Create-Zowe-CLI-profiles.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ This profile identifies the CICS environment for deployment. You need to know th
8787
For example to create a cics-deploy profile:
8888

8989
```console
90-
zowe profiles create cics-deploy-profile example --cicsplex PLEX1 --cics-hlq CICSTS55.CICS720 --cpsm-hlq CICSTS55.CPSM550 --scope TESTGRP1 --csd-group BUNDGRP1 --target-directory /var/cicsts/bundles --overwrite
90+
zowe profiles create cics-deploy-profile cics --cicsplex PLEX1 --cics-hlq CICSTS55.CICS720 --cpsm-hlq CICSTS55.CPSM550 --scope TESTGRP1 --csd-group BUNDGRP1 --target-directory /var/cicsts/bundles --overwrite
9191
```
9292

9393
For help on using the options:
@@ -96,4 +96,4 @@ For help on using the options:
9696
zowe profiles create cics-deploy-profile --help
9797
```
9898

99-
To test the cics-deploy profile, follow the steps in [Deploying your first app](cdp-Deploying-your-first-app).
99+
To test the cics-deploy profile, follow the steps in [Deploying your first Node.js app](cdp-Deploying-your-first-nodejs-app).

docs/pages/cdp/cdp-Deploying-using-individual-actions.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
---
22
title: Deploying using individual actions
3-
tags: [getting_started]
3+
tags: [tutorial]
44
keywords:
55
summary: "The following steps take you through the individual actions to deploy a Node.js application in CICS."
66
sidebar: cdp_sidebar
77
permalink: cdp-Deploying-using-individual-actions.html
88
folder: cdp
9-
toc: false
9+
toc: true
1010
---
1111

12-
The `zowe cics-deploy push bundle` command performs a set of actions to deploy applications to CICS, as can be seen in [Deploying your first app](cdp-cdp-Deploying-your-first-app). The main actions include:
12+
The `zowe cics-deploy push bundle` command performs a set of actions to deploy applications to CICS, as can be seen in [Deploying your first Node.js app](cdp-Deploying-your-first-nodejs-app). The main actions include:
1313

1414
* undeploy the old version of the CICS bundle in CICS
1515
* upload the new version of the CICS bundle to z/OS
16-
* run `npm install` on z/OS to resolve Node.js application dependencies
17-
* deploy the CICS bundle in CICS.
16+
* resolve Node.js application dependencies on z/OS
17+
* deploy the CICS bundle in CICS
1818

1919
However, there may be situations where you need more control of these actions or perform alternate actions. The following sections describe how each of these actions can be performed independently, enabling you to form a sequence of commands to achieve your needs.
2020

2121
### Undeploy a CICS bundle
2222

23-
Undeploying a CICS bundle disables the CICS bundle resource (BUNDLE) in CICS. Disabling the CICS bundle causes the resources defined in it to also be disabled. For Node.js applications, CICS sends a SIGTERM signal that can be handled in the application to stop in a controlled manner, such as stopping new requests and completing existing requests. Once the CICS bundle has been disabled it is then discarded in CICS.
23+
Undeploying a CICS bundle disables the CICS bundle resource (BUNDLE) in CICS. Disabling the BUNDLE causes the resources defined in it to also be disabled. For Node.js applications, CICS sends a SIGTERM signal that can be handled in the application to stop in a controlled manner, such as stopping new requests and completing existing requests. Once the CICS bundle has been disabled it is then discarded in CICS.
2424

2525
```console
2626
zowe cics-deploy undeploy bundle --name Express
@@ -38,17 +38,17 @@ zowe cics-deploy undeploy bundle --name Express --target-state disabled
3838

3939
Before uploading the CICS bundle to z/OS, you need to ensure the target directory is empty in order to prevent merging with a previously deployed version of the CICS bundle.
4040

41-
There are several ways to run shell commands and scripts on z/OS, such as SSH, batch jobs, and Zowe. When using Zowe, an SSH connection is established using information in the Zowe ssh profile, and then the shell .profile for the user will be run to setup the environment. The command is then run in the directory specified by the `--cwd` option. The return code from the Zowe CLI will be the same as that returned by the command run on z/OS, enabling you to take action in your script in error scenarios.
41+
There are several ways to run shell commands and scripts on z/OS, such as SSH, batch jobs, and Zowe. When using Zowe, an SSH connection is established using information in the Zowe ssh profile, and the shell .profile for the user is run to setup the environment. The command is then run in z/OS in the directory specified by the `--cwd` option. The return code from the command is used to set the Zowe CLI return code, enabling you to take action in your script in error scenarios.
4242

4343
For example, to remove the target directory:
4444

4545
```console
46-
zowe zos-uss issue ssh "rm -Rv *" --cwd "/var/cicsts/bundles/myexpressapp_1.0.0" && echo RC=$?
46+
zowe zos-uss issue ssh "rm -Rv *" --cwd "/var/cicsts/bundles/myexpressapp_1.0.0" || echo "RC=$?"
4747
```
4848

4949
{% include tip.html content="You can run several commands in one request using the syntax described in [sh — Invoke a shell](https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.bpxa500/sh.htm)." %}
5050

51-
Typically you will need to upload some files as binary, some as text, and exclude others that are not required to run the application. In addition, it is best practice to tag files on z/OS as binary or with their text codepage to allow for correct codepage translation by editors and environments such as Node.js. You can specify these requirements in a `.zosattributes` file and use the Zowe CLI to upload and tag files in a single command.
51+
When uploading the CICS bundle to z/OS, you may need to upload some files as binary, some as text, and exclude others that are not required to run the application. In addition, it is best practice to tag files on z/OS as binary or with their text codepage to allow for correct codepage translation by editors and environments such as Node.js and Java. You can specify these requirements in a `.zosattributes` file and use the Zowe CLI to upload and tag files in a single command.
5252

5353
For example, create file **~/myExpressApp/.zosattributes** in the CICS bundle:
5454

@@ -76,10 +76,10 @@ node_modules -
7676
Then upload the CICS bundle to z/OS:
7777

7878
```console
79-
zowe zos-files upload dir-to-uss ~/myExpressApp/ /var/cicsts/bundles/myexpressapp_1.0.0 --recursive --attributes ~/myExpressApp/.zosattributes
79+
zowe zos-files upload dir-to-uss ~/myExpressApp/ "/var/cicsts/bundles/myexpressapp_1.0.0" --recursive --attributes ~/myExpressApp/.zosattributes
8080
```
8181

82-
### Run npm on z/OS
82+
### Resolve Node.js application dependencies on z/OS
8383

8484
A Node.js application typically depends on packages that are described in `package.json`. The dependencies can be installed by running `npm install` in the z/OS directory containing `package.json`, for example:
8585

@@ -92,11 +92,11 @@ zowe zos-uss issue ssh "npm install" --cwd "/var/cicsts/bundles/myexpressapp_1.0
9292
Deploying a CICS bundle defines a CICS bundle resource (BUNDLE), then installs it, and finally enables it. When the CICS bundle is enabled, the Node.js application is started. For example:
9393

9494
```console
95-
zowe cics-deploy deploy bundle --name Express --bundle-directory /var/cicsts/bundles/myexpressapp_1.0.0
95+
zowe cics-deploy deploy bundle --name Express --bundle-directory "/var/cicsts/bundles/myexpressapp_1.0.0"
9696
```
9797

9898
Alternatively, to define and install the BUNDLE but not enable it:
9999

100100
```console
101-
zowe cics-deploy deploy bundle --name Express --bundle-directory /var/cicsts/bundles/myexpressapp_1.0.0 --target-state disabled
101+
zowe cics-deploy deploy bundle --name Express --bundle-directory "/var/cicsts/bundles/myexpressapp_1.0.0" --target-state disabled
102102
```

0 commit comments

Comments
 (0)