Skip to content

Commit d6c538b

Browse files
authored
Merge pull request #168 from markcocker/master
Add tutorial Deploying using individual actions
2 parents 516d5cf + 59f25b5 commit d6c538b

File tree

4 files changed

+105
-174
lines changed

4 files changed

+105
-174
lines changed

docs/_data/sidebars/cdp_sidebar.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ entries:
2727
- title: Deploying your first app
2828
url: /cdp-Deploying-your-first-app.html
2929
output: web
30-
- title: Developer pushing Node.js apps
31-
url: /cdp-Developer-pushing-Node.js-apps.html
32-
output: web
33-
- title: Developer deploying Node.js apps
34-
url: /cdp-Developer-deploying-Node.js-apps.html
30+
- title: Deploying using individual actions
31+
url: /cdp-Deploying-using-individual-actions.html
3532
output: web
3633

3734
- title: Concepts
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: Deploying using individual actions
3+
tags: [getting_started]
4+
keywords:
5+
summary: "The following steps take you through the individual actions to deploy a Node.js application in CICS."
6+
sidebar: cdp_sidebar
7+
permalink: cdp-Deploying-using-individual-actions.html
8+
folder: cdp
9+
toc: false
10+
---
11+
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:
13+
14+
* undeploy the old version of the CICS bundle in CICS
15+
* 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.
18+
19+
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.
20+
21+
### Undeploy a CICS bundle
22+
23+
Undeploying a CICS bundle disables the CICS bundle resource (BUNDLE) in CICS. Disabling the CICS bundle causes the resources defined in 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.
24+
25+
```console
26+
zowe cics-deploy undeploy bundle --name Express
27+
```
28+
29+
Alternatively, if you want to disable the CICS bundle, but to not discard it:
30+
31+
```console
32+
zowe cics-deploy undeploy bundle --name Express --target-state disabled
33+
```
34+
35+
{% include note.html content="This command does not remove the CICS bundle from the z/OS directory." %}
36+
37+
### Upload a CICS bundle to z/OS
38+
39+
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.
40+
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 will be established using information in the Zowe ssh profile, and 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.
42+
43+
For example, to remove the target directory:
44+
45+
```console
46+
zowe zos-uss issue ssh "rm -Rv *" --cwd "/var/cicsts/bundles/myexpressapp_1.0.0"
47+
echo $?
48+
```
49+
50+
{% 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)." %}
51+
52+
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 viewing and loading by 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.
53+
54+
For example, create file **~/myExpressApp/.zosattributes** in the CICS bundle:
55+
56+
```properties
57+
# Don't upload node_modules
58+
node_modules -
59+
60+
# Don't upload things that start with dots
61+
.* -
62+
63+
# Upload the following file types in binary
64+
*.jpg binary binary
65+
*.png binary binary
66+
*.gif binary binary
67+
*.zip binary binary
68+
*.eot binary binary
69+
*.svg binary binary
70+
*.ttf binary binary
71+
*.woff binary binary
72+
73+
# Convert CICS Node.js profiles to EBCDIC
74+
*.profile ISO8859-1 IBM-1047
75+
```
76+
77+
Then upload the CICS bundle to z/OS:
78+
79+
```console
80+
zowe zos-files upload dir-to-uss ~/myExpressApp/ /var/cicsts/bundles/myexpressapp_1.0.0 --recursive --attributes ~/myExpressApp/.zosattributes
81+
```
82+
83+
### Run npm on z/OS
84+
85+
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:
86+
87+
```console
88+
zowe zos-uss issue ssh "npm install" --cwd "/var/cicsts/bundles/myexpressapp_1.0.0"
89+
```
90+
91+
### Deploy a CICS bundle
92+
93+
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:
94+
95+
```console
96+
zowe cics-deploy deploy bundle --name Express --bundledir /var/cicsts/bundles/myexpressapp_1.0.0
97+
```
98+
99+
Alternatively, to define and install the BUNDLE but not enable it:
100+
101+
```console
102+
zowe cics-deploy deploy bundle --name Express --bundledir /var/cicsts/bundles/myexpressapp_1.0.0 --target-state disabled
103+
```

docs/pages/cdp/cdp-Developer-deploying-Node.js-apps.md

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

docs/pages/cdp/cdp-Developer-pushing-Node.js-apps.md

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

0 commit comments

Comments
 (0)