|
| 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. The actions include undeploying the old version of the CICS bundle, uploading the new version of the CICS bundle to z/OS, running `npm install` on z/OS to resolve dependencies, and finally deploying the new version of the CICS bundle. |
| 13 | + |
| 14 | +However, there may be situations where you need more control or perform alternate actions. The following sections describe how each of these actions could be performed independently, enabling you to form a sequence of commands to achieve your needs. |
| 15 | + |
| 16 | +### Undeploy a CICS bundle |
| 17 | + |
| 18 | +Undeploying a CICS bundle will first disable the BUNDLE resource in CICS. This will result in all CICS resources defined in the BUNDLE being disabled. To disable Node.js applications, CICS will send a SIGTERM signal to the application. The CICS bundle will then be discarded from CICS. This command will not remove the CICS bundle from the z/OS directory. |
| 19 | + |
| 20 | +```console |
| 21 | +zowe cics-deploy undeploy bundle --name Express |
| 22 | +``` |
| 23 | + |
| 24 | +Alternatively, if you want to disable the CICS bundle, but to not discard it: |
| 25 | + |
| 26 | +```console |
| 27 | +zowe cics-deploy undeploy bundle --name Express --target-state disabled |
| 28 | +``` |
| 29 | + |
| 30 | +### Upload to z/OS |
| 31 | + |
| 32 | +There are several ways to upload a CICS bundle to z/OS, such as FTP, Git, and Zowe. Typically you will need to upload some files as binary, some as text, and exclude others that are not required to run the application. 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. |
| 33 | + |
| 34 | +For example, create file **~/myExpressApp/.zosattributes** in the CICS bundle: |
| 35 | + |
| 36 | +``` |
| 37 | +# Don't upload node_modules |
| 38 | +node_modules - |
| 39 | +
|
| 40 | +# Don't upload things that start with dots |
| 41 | +.* - |
| 42 | +
|
| 43 | +# Upload the following file types in binary |
| 44 | +*.jpg binary binary |
| 45 | +*.png binary binary |
| 46 | +*.gif binary binary |
| 47 | +*.zip binary binary |
| 48 | +*.eot binary binary |
| 49 | +*.svg binary binary |
| 50 | +*.ttf binary binary |
| 51 | +*.woff binary binary |
| 52 | +
|
| 53 | +# Convert CICS Node.js profiles to EBCDIC |
| 54 | +*.profile ISO8859-1 IBM-1047 |
| 55 | +``` |
| 56 | + |
| 57 | +Then upload the CICS bundle to z/OS: |
| 58 | + |
| 59 | +```console |
| 60 | +zowe zos-files upload dir-to-uss ~/myExpressApp/ /var/cicsts/bundles --recursive --attributes my_global_attributes |
| 61 | +``` |
| 62 | + |
| 63 | +### Run npm install on z/OS |
| 64 | + |
| 65 | +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, the user will be logged in, the shell .profile will be run to setup the environment. Zowe will then run the specified command in the directory specified by the `--cdw` option. |
| 66 | + |
| 67 | +```console |
| 68 | +zowe zos-uss issue ssh "npm install" --cdw "/var/cicsts/bundles" |
| 69 | +``` |
| 70 | + |
| 71 | +### Deploy a CICS bundle |
| 72 | + |
| 73 | +Deploying a CICS bundle will define the BUNDLE resource in CICS, then install, then enable the BUNDLE. |
| 74 | + |
| 75 | +```console |
| 76 | +zowe cics-deploy deploy bundle --name EXAMPLE --bundledir /var/cicsts/bundles/myExpressApp_1.0.0 |
| 77 | +``` |
| 78 | + |
| 79 | +Alternatively, if you want to define and install the CICS bundle, but to not enable it: |
| 80 | + |
| 81 | +```console |
| 82 | +zowe cics-deploy deploy bundle --name Express --target-state disabled |
| 83 | +``` |
0 commit comments