Skip to content

Commit 546acfa

Browse files
authored
Merge branch 'master' into master
2 parents d4e5199 + 2102ef0 commit 546acfa

File tree

6 files changed

+65
-33
lines changed

6 files changed

+65
-33
lines changed

__tests__/api/BundlePush/BundlePusher.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ describe("BundlePusher01", () => {
380380
shellSpy.mockImplementationOnce(() => { throw new Error( "Injected Shell error" ); });
381381

382382
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", true,
383-
"A problem occurred attempting to run 'rm -r *' in remote directory '/u/ThisDoesNotExist/12345678'. Problem is: Injected Shell error");
383+
"A problem occurred attempting to run 'if [ \"$(ls)\" ]; then rm -r *; fi' in remote directory '/u/ThisDoesNotExist/12345678'. Problem is: Injected Shell error");
384384

385385
expect(zosMFSpy).toHaveBeenCalledTimes(1);
386386
expect(sshSpy).toHaveBeenCalledTimes(1);
@@ -414,7 +414,7 @@ describe("BundlePusher01", () => {
414414
});
415415

416416
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", true,
417-
"A problem occurred attempting to run 'rm -r *' in remote directory '/u/ThisDoesNotExist/12345678'. " +
417+
"A problem occurred attempting to run 'if [ \"$(ls)\" ]; then rm -r *; fi' in remote directory '/u/ThisDoesNotExist/12345678'. " +
418418
"Problem is: The output from the remote command implied that an error occurred.");
419419

420420
expect(consoleText).toContain("Ssh command exit with non zero status");
@@ -433,7 +433,7 @@ describe("BundlePusher01", () => {
433433
});
434434

435435
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", true,
436-
"A problem occurred attempting to run 'rm -r *' in remote directory '/u/ThisDoesNotExist/12345678'. " +
436+
"A problem occurred attempting to run 'if [ \"$(ls)\" ]; then rm -r *; fi' in remote directory '/u/ThisDoesNotExist/12345678'. " +
437437
"Problem is: The output from the remote command implied that an error occurred.");
438438

439439
expect(consoleText).toContain("Injected FSUM9195 error message");
@@ -452,7 +452,7 @@ describe("BundlePusher01", () => {
452452
});
453453

454454
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", true,
455-
"A problem occurred attempting to run 'rm -r *' in remote directory '/u/ThisDoesNotExist/12345678'. " +
455+
"A problem occurred attempting to run 'if [ \"$(ls)\" ]; then rm -r *; fi' in remote directory '/u/ThisDoesNotExist/12345678'. " +
456456
"Problem is: The output from the remote command implied that an error occurred.");
457457

458458
expect(consoleText).toContain("Injected FSUM9195 and FSUM9196 error message");
@@ -892,7 +892,7 @@ describe("BundlePusher01", () => {
892892
expect(consoleText).toContain("Undeploy complete");
893893
expect(consoleText).toContain("Running 'npm uninstall *' in '/u/ThisDoesNotExist/12345678'");
894894
expect(consoleText).toContain("Removing contents of remote bundle directory");
895-
expect(consoleText).toContain("Issuing SSH command 'rm -r *' in remote directory '/u/ThisDoesNotExist/12345678'");
895+
expect(consoleText).toContain("Issuing SSH command 'if [ \"$(ls)\" ]; then rm -r *; fi' in remote directory '/u/ThisDoesNotExist/12345678'");
896896
expect(consoleText).toContain("Uploading bundle contents to remote directory");
897897
expect(consoleText).toContain("WARNING: No .zosAttributes file found in the bundle directory, default values will be applied");
898898
expect(consoleText).toContain("Running 'npm install' in '/u/ThisDoesNotExist/12345678'");

docs/_posts/2016-02-26-sample-post-jekyll.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Sample post"
33
published: true
44
permalink: samplepost.html
55
summary: "This is some summary frontmatter for my sample post."
6-
tags: [news, getting_started]
6+
tags:
77
---
88

99
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries

docs/index.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/pages/cdp/cdp-Home.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: Home
2+
title: Zowe CLI CICS deploy plugin
33
tags: [getting_started]
44
keywords:
55
summary: "The Zowe command line interface (CLI) provides a simple and streamlined way to interact with IBM z/OS. The cics-deploy plugin extends the Zowe CLI to deploy applications developed on a workstation to IBM CICS Transaction Server for z/OS (CICS)."
66
sidebar: cdp_sidebar
7-
permalink: cdp-Home.html
7+
permalink: index.html
88
folder: cdp
99
---
1010

docs/pages/cdp/cdp-zowe-profiles.md

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,63 @@
11
---
22
title: Zowe CLI profiles
3-
tags: [getting_started]
4-
keywords:
5-
summary: "Zowe profiles let you store configuration details so you don't have to repeat them every time you use a Zowe CLI command."
3+
tags: [getting_started, concepts]
4+
keywords: command line, zowe cli
5+
summary: "Zowe CLI profiles let you store configuration details so you don't have to repeat them every time you use a Zowe CLI command."
66
sidebar: cdp_sidebar
77
permalink: cdp-zowe-profiles.html
88
folder: cdp
9+
toc: true
910
---
1011

11-
### TBC by Clive
12+
### Using the command-line
13+
The command-line is a conventional way to run and/or compose programs, especially if you come from a Linux or macOS background. Despite its usefulness, it can become tedious when large numbers of command-line arguments have to be entered and re-entered every time a program is executed. Zowe CLI profiles eliminate a lot of this tedium by collecting sequences of rarely-changing command-line arguments into just one argument - the name of a Zowe CLI profile - which is used as proxy whenever the original longer sequence needs to be subsequently invoked.
14+
15+
{% include note.html content="Be aware that the broader Zowe and z/OS technology stack includes some other entities commonly referred to as <i>profiles</i> that are entirely different to the profiles discussed here, which are, specifically, Zowe CLI profiles. For example, there is a ```.profile``` file in most z/OS Unix System Services (USS) user home directories - the remote z/OS shell profile - that contains session-initializing environmental configuration. A lack of precision, especially in conversation, can be confusing." %}
16+
17+
Instead of having to type, say, six command-line arguments that describe a collection of z/OS connection details, you only need to type one, the name and type of the profile that stores the full set.
18+
19+
### Examples of Zowe CLI profiles in action
20+
As an example, a Zowe CLI z/OSMF profile aggregates the configuration details required to establish CLI z/OSMF sessions with the mainframe - such sessions are necessary to submit the batch jobs that deploy and undeploy [CICS bundles](cdp-cics-bundles.md). You can create a Zowe CLI z/OSMF profile with a command like:
21+
22+
```
23+
zowe profiles create zosmf-profile myprofile --host zos124 --port 1443 --user ibmuser --password myp4ss --reject-unauthorized false
24+
```
25+
This creates a Zowe CLI z/OSMF profile called *myprofile* that connects to port *1443* (or, in your situation, such port as your own z/OSMF server is known to run on) on host *zos124* using the credentials *ibmuser* and *myp4ss* and allowing self-signed certificates. That's six command-line arguments stored as a collection under the single profile called *myprofile*.
26+
27+
Now you can issue further Zowe commands that reference the profile you created earlier. For example, to check the health of your connectivity to z/OSMF you might enter:
28+
29+
```
30+
zowe zosmf check status --zosmf-profile myprofile
31+
```
32+
Zowe CLI profiles really come into their own when you decide to deploy your Node.js application(s) using `push bundle`. Using three profiles, you might issue:
33+
```
34+
zowe push bundle --name EXAMPLE --targetdir /u/example/bundles --zosmf-profile testplex --cics-deploy-profile devcics --ssh-profile ssh
35+
```
36+
This is a much more economical and concise command-line than if were it necessary to enumerate all of the individual arguments from all of the profiles.
37+
38+
As suggested above, to deploy a Node.js application from your workstation to one or more CICS regions, you will need to set up a minimum of three Zowe CLI profiles (optionally more if you wish to, say, deploy to multiple hosts) - you can read how to do it in detail [here](cdp-Create-Zowe-CLI-profiles).
39+
40+
{% include tip.html content="For each profile type, the first profile you create becomes the default for that type. In many cases, you don't even have to type in the name of a specific profile if you know that the default profile will serve your needs." %}
41+
42+
Ultimately, you are not *required* to use Zowe CLI profiles - you can specify all of the required command-line arguments explicitly - but they reduce the burden of typing when you are issuing commands that require many arguments.
43+
44+
### Where are Zowe CLI profiles stored?
45+
When you create a Zowe CLI profile, a representation is written to an operating-system-dependent text file on your local workstation.
46+
<ul id="profileTabs" class="nav nav-tabs">
47+
<li class="active"><a href="#windows" data-toggle="tab">Windows</a></li>
48+
<li><a href="#linux" data-toggle="tab">Linux</a></li>
49+
<li><a href="#macos" data-toggle="tab">macOS</a></li>
50+
</ul>
51+
<div class="tab-content">
52+
<div role="tabpanel" class="tab-pane active" id="windows">
53+
<p>On Windows, Zowe CLI profiles are written by default to <tt>C:\Users\&lt;Your user name&gt;\.zowe\profiles</tt></p>
54+
</div>
55+
56+
<div role="tabpanel" class="tab-pane" id="linux">
57+
<p>On Linux, Zowe CLI profiles are written by default to <tt>~/.zowe/profiles</tt></p></div>
58+
59+
<div role="tabpanel" class="tab-pane" id="macos">
60+
<p>On macOS, Zowe CLI profiles are written by default to <tt>~/.zowe/profiles</tt></p>
61+
</div>
62+
</div>
63+
When you become familiar with their simple syntax, you can hand-edit these files, instead of regenerating the corresponding profiles.

src/api/BundlePush/BundlePusher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export class BundlePusher {
338338

339339
private async deleteBundleDirContents(sshSession: SshSession) {
340340
this.updateStatus("Removing contents of remote bundle directory");
341-
await this.runSshCommandInRemoteDirectory(sshSession, this.params.arguments.bundledir, "rm -r *");
341+
await this.runSshCommandInRemoteDirectory(sshSession, this.params.arguments.bundledir, "if [ \"$(ls)\" ]; then rm -r *; fi");
342342
}
343343

344344
private async runSingleNpmInstall(sshSession: SshSession, remoteDirectory: string) {

0 commit comments

Comments
 (0)