├── .editorconfig
├── .github
└── workflows
│ └── build.yml
├── .gitignore
├── .npmignore
├── .secrets.baseline
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── NOTICES.md
├── README.md
├── __tests__
├── __resources__
│ ├── AlmostEmptyPackageJson
│ │ ├── Artefact1
│ │ ├── META-INF
│ │ │ └── cics.xml
│ │ └── package.json
│ ├── BadManifestBundle01
│ │ └── META-INF
│ │ │ └── cics.xml
│ ├── BadManifestBundle02
│ │ └── META-INF
│ │ │ └── cics.xml
│ ├── BadManifestBundle03
│ │ └── META-INF
│ │ │ └── cics.xml
│ ├── BadPackageJson
│ │ ├── Artefact1
│ │ ├── META-INF
│ │ │ └── cics.xml
│ │ └── package.json
│ ├── EmptyBundle02
│ │ └── script.js
│ ├── EmptyPackageJson
│ │ ├── Artefact1
│ │ ├── META-INF
│ │ │ └── cics.xml
│ │ └── package.json
│ ├── ExampleBundle01
│ │ └── META-INF
│ │ │ └── cics.xml
│ ├── ExampleBundle02
│ │ ├── Artefact1
│ │ ├── Artefact2.txt
│ │ ├── META-INF
│ │ │ └── cics.xml
│ │ └── folder
│ │ │ └── Artefact3.jpg
│ ├── ExampleBundle03
│ │ ├── Artefact1
│ │ └── META-INF
│ │ │ └── cics.xml
│ ├── ExampleBundle04
│ │ ├── Artefact1
│ │ ├── META-INF
│ │ │ └── cics.xml
│ │ └── package.json
│ ├── ExampleBundle05
│ │ ├── .zosattributes
│ │ ├── Artefact1
│ │ ├── META-INF
│ │ │ └── cics.xml
│ │ └── package.json
│ ├── ExampleBundle06
│ │ ├── Artefact1
│ │ └── META-INF
│ │ │ └── cics.xml
│ ├── apps
│ │ ├── bad-package-json
│ │ │ ├── package.json
│ │ │ └── server.js
│ │ ├── empty-package-json
│ │ │ ├── package.json
│ │ │ └── server.js
│ │ ├── long-name
│ │ │ ├── package.json
│ │ │ └── server.js
│ │ ├── minimal-package-json
│ │ │ ├── package.json
│ │ │ └── server.js
│ │ ├── no-package-json
│ │ │ └── server.js
│ │ └── simple-node-app
│ │ │ ├── other.js
│ │ │ ├── package.json
│ │ │ └── server.js
│ └── env
│ │ ├── system.env
│ │ └── unit.env
├── __snapshots__
│ ├── main.failure.test.ts.snap
│ └── main.success.test.ts.snap
├── __src__
│ ├── TestConstants.ts
│ ├── TestUtils.ts
│ └── environment
│ │ ├── TemporaryScripts.ts
│ │ ├── TestEnvironment.ts
│ │ └── doc
│ │ ├── ITestPropertiesSchema.ts
│ │ ├── parms
│ │ └── ISetupEnvironmentParms.ts
│ │ └── response
│ │ └── ITestEnvironment.ts
├── __system__
│ └── cli
│ │ └── generate
│ │ ├── __scripts__
│ │ └── generate_bundle.sh
│ │ ├── __snapshots__
│ │ └── cli.generate.bundle.system.test.ts.snap
│ │ └── cli.generate.bundle.system.test.ts
├── api
│ ├── BundleContent
│ │ ├── AutoBundler.test.ts
│ │ ├── BundleMocked.test.ts
│ │ ├── BundleSimple.test.ts
│ │ ├── Manifest.test.ts
│ │ ├── Nodejsapp.test.ts
│ │ └── __snapshots__
│ │ │ ├── AutoBundler.test.ts.snap
│ │ │ ├── BundleSimple.test.ts.snap
│ │ │ ├── Manifest.test.ts.snap
│ │ │ └── Nodejsapp.test.ts.snap
│ ├── BundleDeploy
│ │ ├── BundleDeployer.test.ts
│ │ └── __snapshots__
│ │ │ └── BundleDeployer.test.ts.snap
│ └── BundlePush
│ │ ├── BundlePusher.test.ts
│ │ └── SubtaskWithStatus.test.ts
├── cli
│ ├── deploy
│ │ ├── Deploy.definition.test.ts
│ │ └── bundle
│ │ │ ├── DeployBundle.definition.test.ts
│ │ │ └── DeployBundle.handler.test.ts
│ ├── generate
│ │ ├── Generate.definition.test.ts
│ │ └── bundle
│ │ │ ├── GenerateBundle.definition.test.ts
│ │ │ └── GenerateBundle.handler.test.ts
│ ├── push
│ │ ├── Push.definition.test.ts
│ │ └── bundle
│ │ │ ├── PushBundle.definition.test.ts
│ │ │ └── PushBundle.handler.test.ts
│ └── undeploy
│ │ ├── Undeploy.definition.test.ts
│ │ └── bundle
│ │ ├── UndeployBundle.definition.test.ts
│ │ └── UndeployBundle.handler.test.ts
├── imperative.test.ts
├── test-tsconfig.json
└── tslint.json
├── docs
├── .gitignore
├── .gitlab-ci.yml
├── 404.md
├── Dockerfile
├── Gemfile
├── _config.yml
├── _data
│ ├── alerts.yml
│ ├── definitions.yml
│ ├── glossary.yml
│ ├── samplelist.yml
│ ├── sidebars
│ │ └── cdp_sidebar.yml
│ ├── strings.yml
│ ├── tags.yml
│ ├── terms.yml
│ └── topnav.yml
├── _includes
│ ├── archive.html
│ ├── callout.html
│ ├── custom
│ │ ├── getting_started_series.html
│ │ ├── getting_started_series_next.html
│ │ ├── series_acme.html
│ │ ├── series_acme_next.html
│ │ ├── usermap.html
│ │ └── usermapcomplex.html
│ ├── disqus.html
│ ├── feedback.html
│ ├── footer.html
│ ├── google_analytics.html
│ ├── head.html
│ ├── head_print.html
│ ├── image.html
│ ├── important.html
│ ├── initialize_shuffle.html
│ ├── inline_image.html
│ ├── links.html
│ ├── note.html
│ ├── sidebar.html
│ ├── taglogic.html
│ ├── tip.html
│ ├── toc.html
│ ├── topnav.html
│ └── warning.html
├── _layouts
│ ├── default.html
│ ├── default_print.html
│ ├── none.html
│ ├── page.html
│ ├── page_print.html
│ └── post.html
├── _tooltips
│ ├── baseball.html
│ ├── basketball.html
│ ├── football.html
│ └── soccer.html
├── createtag
├── css
│ ├── boxshadowproperties.css
│ ├── customstyles.css
│ ├── font-awesome.min.css
│ ├── fonts
│ │ ├── FontAwesome.otf
│ │ ├── fontawesome-webfont.eot
│ │ ├── fontawesome-webfont.svg
│ │ ├── fontawesome-webfont.ttf
│ │ ├── fontawesome-webfont.woff
│ │ └── fontawesome-webfont.woff2
│ ├── modern-business.css
│ ├── printstyles.css
│ ├── syntax.css
│ ├── theme-blue.css
│ └── theme-green.css
├── docker-compose.yml
├── feed.xml
├── fonts
│ ├── FontAwesome.otf
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
├── images
│ ├── CICSbundlecontents.png
│ └── favicon.ico
├── js
│ ├── customscripts.js
│ ├── jekyll-search.js
│ ├── jquery.ba-throttle-debounce.min.js
│ ├── jquery.navgoco.min.js
│ ├── jquery.shuffle.min.js
│ └── toc.js
├── licenses
│ ├── LICENSE
│ └── LICENSE-BSD-NAVGOCO.txt
├── pages
│ ├── cdp
│ │ ├── CLIReadme.md
│ │ ├── cdp-Common-Errors.md
│ │ ├── cdp-Creating-Zowe-CLI-profiles.md
│ │ ├── cdp-Deploying-a-CICS-policy.md
│ │ ├── cdp-Deploying-a-nodejs-application.md
│ │ ├── cdp-Deploying-using-individual-actions.md
│ │ ├── cdp-Installing.md
│ │ ├── cdp-Log-and-trace-files.md
│ │ ├── cdp-Preparing-a-zOS-PT-image.md
│ │ ├── cdp-Provisioning-a-CICS-region.md
│ │ ├── cdp-Requirements-on-zOS.md
│ │ ├── cdp-Tutorials-overview.md
│ │ ├── cdp-Zowe-CLI-CICS-deploy-plug-in.md
│ │ ├── cdp-Zowe-CLI-profiles.md
│ │ ├── cdp-cics-bundles.md
│ │ └── cdp-zowe-and-the-Zowe-CLI.md
│ └── tags
│ │ ├── tag_concepts.md
│ │ ├── tag_getting_started.md
│ │ ├── tag_navigation.md
│ │ └── tag_troubleshooting.md
├── pdf-all.sh
├── pdf-mydoc.sh
├── pdf-product1.sh
├── pdf-product2.sh
├── pdfconfigs
│ ├── config_mydoc_pdf.yml
│ ├── config_product1_pdf.yml
│ ├── config_product2_pdf.yml
│ ├── prince-list.txt
│ ├── titlepage.html
│ └── tocpage.html
├── search.json
├── sitemap.xml
├── tooltips.html
├── tooltips.json
├── update.sh
└── var
│ └── build.sh
├── gulp
├── GenerateDoc.ts
└── GulpHelpers.ts
├── gulpfile.js
├── jenkins
└── npm_login.expect
├── junit.xml
├── package.json
├── scripts
├── .jshintrc
├── ReplaceVars.js
├── askUser.js
└── unlinkImperative.js
├── src
├── api
│ ├── BundleContent
│ │ ├── AutoBundler.ts
│ │ ├── Bundle.ts
│ │ ├── BundlePart.ts
│ │ ├── Manifest.ts
│ │ ├── NodejsappBundlePart.ts
│ │ └── TemplateNodejsappProfile.ts
│ ├── BundleDeploy
│ │ ├── BundleDeployer.ts
│ │ └── ParmValidator.ts
│ └── BundlePush
│ │ ├── BundlePusher.ts
│ │ ├── CmciConfig.ts
│ │ ├── SshConfig.ts
│ │ ├── SubtaskWithStatus.ts
│ │ └── ZosmfConfig.ts
├── cli
│ ├── deploy
│ │ ├── Deploy.definition.ts
│ │ └── bundle
│ │ │ ├── DeployBundle.definition.ts
│ │ │ ├── DeployBundle.handler.ts
│ │ │ └── options
│ │ │ ├── Bundledir.option.ts
│ │ │ ├── Description.option.ts
│ │ │ └── TargetState.option.ts
│ ├── generate
│ │ ├── Generate.definition.ts
│ │ └── bundle
│ │ │ ├── GenerateBundle.definition.ts
│ │ │ ├── GenerateBundle.handler.ts
│ │ │ └── options
│ │ │ ├── Bundleid.option.ts
│ │ │ ├── Bundleversion.option.ts
│ │ │ ├── Merge.option.ts
│ │ │ ├── Nodejsapp.option.ts
│ │ │ ├── Overwrite.option.ts
│ │ │ ├── Port.option.ts
│ │ │ └── Startscript.option.ts
│ ├── push
│ │ ├── Push.definition.ts
│ │ └── bundle
│ │ │ ├── PushBundle.definition.ts
│ │ │ ├── PushBundle.handler.ts
│ │ │ └── options
│ │ │ ├── CmciOptions.ts
│ │ │ ├── Overwrite.option.ts
│ │ │ ├── SshOptions.ts
│ │ │ └── Targetdir.option.ts
│ ├── shared
│ │ ├── BundleParent.handler.ts
│ │ ├── Cicshlq.option.ts
│ │ ├── Cicsplex.option.ts
│ │ ├── Cpsmhlq.option.ts
│ │ ├── Csdgroup.option.ts
│ │ ├── Jobcard.option.ts
│ │ ├── Name.option.ts
│ │ ├── Resgroup.option.ts
│ │ ├── Scope.option.ts
│ │ ├── Timeout.option.ts
│ │ ├── Verbose.option.ts
│ │ └── ZosmfOptions.ts
│ └── undeploy
│ │ ├── Undeploy.definition.ts
│ │ └── bundle
│ │ ├── UndeployBundle.definition.ts
│ │ ├── UndeployBundle.handler.ts
│ │ └── options
│ │ └── TargetState.option.ts
├── healthCheck.handler.ts
├── imperative.ts
├── index.ts
└── main.ts
├── tsconfig.json
└── tslint.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # top-most EditorConfig file
2 | root = true
3 |
4 | [*.{js,ts}]
5 | indent_style = space
6 | indent_size = 4
7 | insert_final_newline = true
8 | trim_trailing_whitespace = true
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Node CI
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build_and_test:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - name: Checkout repository
10 | uses: actions/checkout@v4
11 | - name: npm install, build, and test
12 | run: |
13 | echo "Running npm install"
14 | npm install
15 | echo "Running npm run build"
16 | npm run build
17 | echo "Running npm run test:unit"
18 | npm run test:unit || true
19 | - name: npm pack
20 | run: |
21 | echo "Running npm pack"
22 | npm pack
23 | - name: Archive package
24 | uses: actions/upload-artifact@v4
25 | with:
26 | name: zowe-cli-cics-deploy-plugin
27 | path: zowe-cli-cics-deploy-plugin-*.tgz
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | lib/
3 | .vscode
4 | .idea
5 | results/
6 | __results__/
7 | __tests__/__results__/
8 | /__tests__/__resources__/properties/**
9 | !/__tests__/__resources__/properties/example_properties.yaml
10 | package-lock.json
11 | docs/Gemfile.lock
12 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/.npmignore
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 | All notable changes to this project will be documented in this file.
3 |
4 |
21 |
22 | ## [Release v1.1.0]
23 |
24 | ### Fixed
25 | - Rebased on zowe-cli @zowe-v1-lts version
26 |
27 | ## [Release v1.0.4]
28 |
29 | ### Fixed
30 | - Temporary fix for zosMFSession type mismatching
31 |
32 | ## [Release v1.0.3]
33 |
34 | ### Added
35 | - Include NOTICES.md in npm package
36 |
37 | ## [Release v1.0.2]
38 |
39 | ### Updated
40 |
41 | - Updated NOTICES.md
42 |
43 | ## [Release v1.0.1]
44 |
45 | ### Added
46 |
47 | - Set _BPXK_AUTOCVT=ON when running npm over SSH
48 |
49 | ## [Release v1.0.0]
50 |
51 | ### Added
52 |
53 | - The plugin is now on public npmjs registry (https://www.npmjs.com/package/zowe-cli-cics-deploy-plugin)
54 |
55 | ## [Unreleased]
56 |
57 | ### Added
58 |
59 | - Zowe CLI cics-deploy plugin including the commands:
60 |
61 | - `zowe cics-deploy generate bundle`
62 | - `zowe cics-deploy push bundle`
63 | - `zowe cics-deploy deploy bundle`
64 | - `zowe cics-deploy undeploy bundle`
65 |
66 | - Zowe CLI cics-deploy profile
67 | - Documentation in GitHub pages
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](CODE_OF_CONDUCT)
2 |
3 | # IBM CICS Bundle Deployment Plugin for Zowe CLI
4 |
5 | This plug-in for [Zowe CLI](https://github.com/zowe/zowe-cli) allows deployment of applications developed on a workstation to IBM® CICS® Transaction Server for z/OS® (CICS). It aims to provide an experience similar to deploying to a cloud platform when deploying to CICS. It will also provide low-level commands for performing individual steps of the deployment process that could be used as part of a CI/CD pipeline.
6 |
7 | ## Installing
8 |
9 | Install the plug-in by following the steps in [installing](https://ibm.github.io/zowe-cli-cics-deploy-plugin/cdp-Installing.html).
10 |
11 | ## Documentation
12 |
13 | You can find information and tutorials on using this plug-in in our [documentation](https://ibm.github.io/zowe-cli-cics-deploy-plugin/index.html).
14 |
15 | ## Contributing
16 |
17 | Contributions are welcome - see the [contribution guidelines](CONTRIBUTING.md). If you have a question or encounter a problem, please search the [issues](https://github.com/IBM/zowe-cli-cics-deploy-plugin/issues) before raising a [New issue](https://github.com/IBM/zowe-cli-cics-deploy-plugin/issues/new).
18 |
--------------------------------------------------------------------------------
/__tests__/__resources__/AlmostEmptyPackageJson/Artefact1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/AlmostEmptyPackageJson/Artefact1
--------------------------------------------------------------------------------
/__tests__/__resources__/AlmostEmptyPackageJson/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/__tests__/__resources__/AlmostEmptyPackageJson/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "almostEmpty"
3 | }
4 |
5 |
--------------------------------------------------------------------------------
/__tests__/__resources__/BadManifestBundle01/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/__tests__/__resources__/BadManifestBundle02/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/__tests__/__resources__/BadManifestBundle03/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/__tests__/__resources__/BadPackageJson/package.json:
--------------------------------------------------------------------------------
1 | garbage
2 |
3 |
--------------------------------------------------------------------------------
/__tests__/__resources__/EmptyBundle02/script.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/EmptyBundle02/script.js
--------------------------------------------------------------------------------
/__tests__/__resources__/EmptyPackageJson/Artefact1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/EmptyPackageJson/Artefact1
--------------------------------------------------------------------------------
/__tests__/__resources__/EmptyPackageJson/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/__tests__/__resources__/EmptyPackageJson/package.json:
--------------------------------------------------------------------------------
1 | {}
2 |
3 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle01/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle02/Artefact1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/ExampleBundle02/Artefact1
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle02/Artefact2.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/ExampleBundle02/Artefact2.txt
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle02/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle02/folder/Artefact3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/ExampleBundle02/folder/Artefact3.jpg
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle03/Artefact1:
--------------------------------------------------------------------------------
1 | dummy content
2 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle03/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle04/Artefact1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/ExampleBundle04/Artefact1
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle04/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle04/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "testBundleName",
3 | "version": "1.0.0",
4 | "description": "Just a test",
5 | "scripts": {
6 | "start": "node Artefact1"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle05/.zosattributes:
--------------------------------------------------------------------------------
1 | Dummy Content
2 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle05/Artefact1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/ExampleBundle05/Artefact1
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle05/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle05/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "testBundleName",
3 | "version": "1.0.0",
4 | "description": "Just a test",
5 | "main": "Artefact1"
6 | }
7 |
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle06/Artefact1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/ExampleBundle06/Artefact1
--------------------------------------------------------------------------------
/__tests__/__resources__/ExampleBundle06/META-INF/cics.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/bad-package-json/package.json:
--------------------------------------------------------------------------------
1 |
2 | "name": "cics_nodejs_invoke",
3 | "version": "0.1.0",
4 | "description": "Blah",
5 | "license": "Apache-2.0",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/cicsdev/cics-nodejs-zosconnect.git"
9 | },
10 | "main": "server.js",
11 | "scripts": {
12 | "start": "node server.js"
13 | },
14 | "dependencies": {
15 | "angular": "latest",
16 | "body-parser": "latest",
17 | "bootstrap": "latest",
18 | "dotenv": "latest",
19 | "express": "latest",
20 | "ibm-cics-api": "file:///itbld/cics.ts.dev/Integrat/dist/lib/nodejs/ibm-cics-api",
21 | "jquery": "latest"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/bad-package-json/server.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | // Licensed Materials - Property of IBM
13 | //
14 | // SAMPLE
15 | //
16 | // (c) Copyright IBM Corp. 2017 All Rights Reserved
17 | //
18 | // US Government Users Restricted Rights - Use, duplication or
19 | // disclosure restricted by GSA ADP Schedule Contract with IBM Corp
20 |
21 |
22 | console.log('Hello world!');
23 |
24 |
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/empty-package-json/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/apps/empty-package-json/package.json
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/empty-package-json/server.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | // Licensed Materials - Property of IBM
13 | //
14 | // SAMPLE
15 | //
16 | // (c) Copyright IBM Corp. 2017 All Rights Reserved
17 | //
18 | // US Government Users Restricted Rights - Use, duplication or
19 | // disclosure restricted by GSA ADP Schedule Contract with IBM Corp
20 |
21 |
22 | console.log('Hello world!');
23 |
24 |
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/long-name/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "thisisareallylongnamethatwillneedtobetruncatedinordertofitinabundle",
3 | "version": "0.1.0",
4 | "description": "Blah",
5 | "license": "Apache-2.0",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/cicsdev/cics-nodejs-zosconnect.git"
9 | },
10 | "main": "server.js",
11 | "scripts": {
12 | "start": "node server.js"
13 | },
14 | "dependencies": {
15 | "angular": "latest",
16 | "body-parser": "latest",
17 | "bootstrap": "latest",
18 | "dotenv": "latest",
19 | "express": "latest",
20 | "ibm-cics-api": "file:///itbld/cics.ts.dev/Integrat/dist/lib/nodejs/ibm-cics-api",
21 | "jquery": "latest"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/long-name/server.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | // Licensed Materials - Property of IBM
13 | //
14 | // SAMPLE
15 | //
16 | // (c) Copyright IBM Corp. 2017 All Rights Reserved
17 | //
18 | // US Government Users Restricted Rights - Use, duplication or
19 | // disclosure restricted by GSA ADP Schedule Contract with IBM Corp
20 |
21 |
22 | console.log('Hello world!');
23 |
24 |
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/minimal-package-json/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cics_nodejs_invoke",
3 | "version": "0.1.0",
4 | "description": "Blah"
5 | }
6 |
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/minimal-package-json/server.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | // Licensed Materials - Property of IBM
13 | //
14 | // SAMPLE
15 | //
16 | // (c) Copyright IBM Corp. 2017 All Rights Reserved
17 | //
18 | // US Government Users Restricted Rights - Use, duplication or
19 | // disclosure restricted by GSA ADP Schedule Contract with IBM Corp
20 |
21 |
22 | console.log('Hello world!');
23 |
24 |
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/no-package-json/server.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/apps/no-package-json/server.js
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/simple-node-app/other.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM/zowe-cli-cics-deploy-plugin/f4e274a80e34d5fea85893dcbbf93a39f9920557/__tests__/__resources__/apps/simple-node-app/other.js
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/simple-node-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cics_nodejs_invoke",
3 | "version": "0.1.0",
4 | "description": "Blah",
5 | "license": "Apache-2.0",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/cicsdev/cics-nodejs-zosconnect.git"
9 | },
10 | "main": "server.js",
11 | "scripts": {
12 | "start": "node server.js"
13 | },
14 | "dependencies": {
15 | "angular": "latest",
16 | "body-parser": "latest",
17 | "bootstrap": "latest",
18 | "dotenv": "latest",
19 | "express": "latest",
20 | "ibm-cics-api": "file:///itbld/cics.ts.dev/Integrat/dist/lib/nodejs/ibm-cics-api",
21 | "jquery": "latest"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/__tests__/__resources__/apps/simple-node-app/server.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | // Licensed Materials - Property of IBM
13 | //
14 | // SAMPLE
15 | //
16 | // (c) Copyright IBM Corp. 2017 All Rights Reserved
17 | //
18 | // US Government Users Restricted Rights - Use, duplication or
19 | // disclosure restricted by GSA ADP Schedule Contract with IBM Corp
20 |
21 |
22 | console.log('Hello world!');
23 |
24 |
--------------------------------------------------------------------------------
/__tests__/__resources__/env/system.env:
--------------------------------------------------------------------------------
1 | # environmental variable settings for system and integration tests
2 |
3 | JEST_STARE_RESULT_DIR=__tests__/__results__/system/jest-stare
4 | JEST_HTML_REPORTER_OUTPUT_PATH=__tests__/__results__/system/jest_html_reporter.html
5 | JEST_HTML_REPORTER_PAGE_TITLE="Sample Plugin System and Integration Tests"
6 | JEST_JUNIT_OUTPUT=__tests__/__results__/system/junit.xml
7 | JEST_SUITE_NAME="Sample Plugin System and Integration Tests"
8 | JEST_JUNIT_SUITE_NAME="Sample Plugin System and Integration Tests"
--------------------------------------------------------------------------------
/__tests__/__resources__/env/unit.env:
--------------------------------------------------------------------------------
1 | # environmental variable settings for unit tests
2 |
3 | JEST_STARE_RESULT_DIR=__tests__/__results__/unit/jest-stare
4 | JEST_STARE_COVERAGE_LINK=../../coverage/lcov-report/index.html
5 | JEST_HTML_REPORTER_OUTPUT_PATH=__tests__/__results__/unit/jest_html_reporter.html
6 | JEST_HTML_REPORTER_PAGE_TITLE="cics-deploy Unit Tests"
7 | JEST_JUNIT_OUTPUT=__tests__/__results__/unit/junit.xml
8 | JEST_SUITE_NAME="cics-deploy Unit Tests"
9 | JEST_JUNIT_SUITE_NAME="cics-deploy Unit Tests"
--------------------------------------------------------------------------------
/__tests__/__snapshots__/main.failure.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`main failure should log an imperative init failure 1`] = `
4 | "An error occured during imperative initalization:
5 | Imperative init failed!"
6 | `;
7 |
--------------------------------------------------------------------------------
/__tests__/__snapshots__/main.success.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`main success should log initialization messages 1`] = `" Imperative Initialized the cics-deploy CLI! Parsed the input command!"`;
4 |
--------------------------------------------------------------------------------
/__tests__/__src__/TestConstants.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | import { resolve } from "path";
13 |
14 | // The test results directory name - all tests results - logs, test home dirs,
15 | // coverage reports, etc. are placed in the results directory.
16 | export const TEST_RESULT_DIR = resolve(__dirname + "/../__results__/");
17 |
18 | // The test data directory is where all data that a test (API/CLI) generates
19 | // will be placed. Data such as logs, downloaded files, imperative homes, etc.
20 | export const TEST_RESULT_DATA_DIR = resolve(TEST_RESULT_DIR + "/data/");
21 |
--------------------------------------------------------------------------------
/__tests__/__src__/TestUtils.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | import * as fs from "fs";
13 | import {spawnSync, SpawnSyncReturns} from "child_process";
14 | import {ITestEnvironment} from "./environment/doc/response/ITestEnvironment";
15 |
16 |
17 | /**
18 | * Execute a CLI script
19 | * @export
20 | * @param scriptPath - the path to the script
21 | * @param testEnvironment - the test environment with env
22 | * @param [args=[]] - set of script args (optional)
23 | * @returns node.js details about the results of
24 | * executing the script, including exit code and output
25 | */
26 | export function runCliScript(scriptPath: string, testEnvironment: ITestEnvironment, args: any[] = []): SpawnSyncReturns {
27 | if (fs.existsSync(scriptPath)) {
28 |
29 | // We force the color off to prevent any oddities in the snapshots or expected values
30 | // Color can vary OS/terminal
31 | const childEnv = JSON.parse(JSON.stringify(process.env));
32 | childEnv.FORCE_COLOR = "0";
33 | for (const key of Object.keys(testEnvironment.env)) {
34 | // copy the values from the env
35 | childEnv[key] = testEnvironment.env[key];
36 | }
37 |
38 | fs.chmodSync(scriptPath, "755");
39 | // Execute the command synchronously
40 | return spawnSync(scriptPath, [].concat(args), {cwd: testEnvironment.workingDir, env: childEnv, shell: true, stdio: ["pipe", "pipe", "pipe"], windowsHide: true});
41 | } else {
42 | throw new Error(`The script file ${scriptPath} doesn't exist`);
43 |
44 | }
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/__tests__/__src__/environment/TemporaryScripts.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | export class TemporaryScripts {
13 | /**
14 | * Shebang to generated start script files with
15 | */
16 | public static readonly SHEBANG = "#!/bin/bash\n\n";
17 |
18 | public static readonly ZOWE_BIN = "zowe";
19 | }
20 |
--------------------------------------------------------------------------------
/__tests__/__src__/environment/doc/ITestPropertiesSchema.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | /**
13 | * Interface representing the values in the custom_properties.yaml file
14 | * see example_properties.yaml for descriptions and more details
15 | */
16 | export interface ITestPropertiesSchema {
17 |
18 | /**
19 | * TODO: update to match your example_properties.yaml fields
20 | */
21 | myPropertiesCategory: {
22 | user: string,
23 | password: string,
24 | host: string,
25 | port?: number,
26 | };
27 |
28 | /**
29 | * This can be used to create zosmf profiles if you need them for testing your
30 | * plugin
31 | */
32 | zosmf: {
33 | user: string;
34 | password: string;
35 | host: string;
36 | port: number;
37 | rejectUnauthorized: boolean;
38 | };
39 | }
40 |
--------------------------------------------------------------------------------
/__tests__/__src__/environment/doc/parms/ISetupEnvironmentParms.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | /**
13 | * Parameters used to setup your isolated test directory. Jest allows parallel test execution and many of the
14 | * CLI and API tests need a working directory & test scratch area. The test environment setup creates that
15 | * area and sets the cli home environment variable to the test area.
16 | * @export
17 | * @interface ISetupEnvironmentParms
18 | */
19 | export interface ISetupEnvironmentParms {
20 |
21 | /**
22 | * The name of your test suite. Do not include spaces - used to create the working directory (to allow
23 | * for easier debug reference if a test fails).
24 | */
25 | testName: string;
26 |
27 | /**
28 | * A list of types of profiles to create from your custom.properties file
29 | *
30 | * If this is specified, the tempProfiles field will appear on your
31 | * ITestEnvironment object when setup is complete. tempProfiles
32 | * can be used to delete the profiles later
33 | *
34 | * Example: ["cics"]
35 | */
36 | tempProfileTypes?: string[];
37 |
38 | /**
39 | * Should the CICS plugin be installed to your home directory
40 | * before the tests? The is no need to specify this unless
41 | * you are trying to execute CICS commands installed into
42 | * Zowe CLI.
43 | */
44 | installPlugin?: boolean;
45 | }
46 |
--------------------------------------------------------------------------------
/__tests__/__src__/environment/doc/response/ITestEnvironment.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | import { ITestPropertiesSchema } from "../ITestPropertiesSchema";
13 |
14 | /**
15 | * The test environment for your test.
16 | * @export
17 | * @interface ITestEnvironment
18 | */
19 | export interface ITestEnvironment {
20 | /**
21 | * The working directory for your test environment. It is a unique (uuid) area where your tests can create
22 | * their home folders (for imperative, etc.) and you can use the area as scratch for any files, etc. that
23 | * must be created for your test.
24 | */
25 | workingDir: string;
26 |
27 | /**
28 | * The system test properties configured and loaded as part of the test lifecyle. This field may be null
29 | * in the case that no system test properties were configured or could be loaded.
30 | *
31 | */
32 | systemTestProperties: ITestPropertiesSchema;
33 |
34 | /**
35 | * Set of environmental variables (such as profile/logging home directory)
36 | * that can be used when executing Zowe CLI commands
37 | */
38 | env: { [key: string]: string };
39 |
40 | /**
41 | * a map of profileType to profile names created when you specify
42 | * tempProfileTypes on your ISetupEnvironmentParms object
43 | * empty if you did not specify any profile types
44 | */
45 | tempProfiles?: { [profileType: string]: string[] };
46 |
47 | /**
48 | * Was the plugin installed in the working directory
49 | */
50 | pluginInstalled?: boolean;
51 | }
52 |
--------------------------------------------------------------------------------
/__tests__/__system__/cli/generate/__scripts__/generate_bundle.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e # fail the script if we get a non zero exit code
3 | cd $1
4 | shift
5 | zowe cics-deploy generate bundle $@
6 |
--------------------------------------------------------------------------------
/__tests__/cli/deploy/Deploy.definition.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | * Copyright IBM Corp, 2019
10 | *
11 | */
12 |
13 | import * as fs from "fs";
14 | import { Imperative } from "@zowe/imperative";
15 |
16 | describe("Deploy definition", () => {
17 | it("should match the snapshot", () => {
18 |
19 | // Attempt to read the full file contents. We could require the module here, however there is normally non
20 | // deterministic data (filepaths, etc.) that are resolved when the module is loaded, so it is simpler to
21 | // check the contents for changes (sanity/protection against undesired changes to the definition)
22 | let contents: string;
23 | let error;
24 | try {
25 | contents = fs.readFileSync(__dirname + "/../../../src/cli/deploy/Deploy.definition.ts").toString();
26 | } catch (e) {
27 | error = e;
28 | Imperative.console.error(`Error reading Deploy.definition.ts Did you move the file? Details: ${e.message}`);
29 | }
30 | expect(error).toBeUndefined();
31 | // Removed the snapshot testing - it's not very useful, and it causes snapshots to be generated unexpectedly under Jenkins.
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/__tests__/cli/deploy/bundle/DeployBundle.definition.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | * Copyright IBM Corp, 2019
10 | *
11 | */
12 |
13 | import * as fs from "fs";
14 | import { Imperative } from "@zowe/imperative";
15 |
16 | describe("bundle definition", () => {
17 | it("should match the snapshot", () => {
18 |
19 | // Attempt to read the full file contents. We could require the module here, however there is normally non
20 | // deterministic data (filepaths, etc.) that are resolved when the module is loaded, so it is simpler to
21 | // check the contents for changes (sanity/protection against undesired changes to the definition)
22 | let contents: string;
23 | let error;
24 | try {
25 | contents = fs.readFileSync(__dirname + "/../../../../src/cli/deploy/bundle/DeployBundle.definition.ts").toString();
26 | } catch (e) {
27 | error = e;
28 | Imperative.console.error(`Error reading DeployBundle.definition.ts Did you move the file? Details: ${e.message}`);
29 | }
30 | expect(error).toBeUndefined();
31 | // Removed the snapshot testing - it's not very useful, and it causes snapshots to be generated unexpectedly under Jenkins.
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/__tests__/cli/generate/Generate.definition.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | * Copyright IBM Corp, 2019
10 | *
11 | */
12 |
13 | import * as fs from "fs";
14 | import { Imperative } from "@zowe/imperative";
15 |
16 | describe("Generate definition", () => {
17 | it("should match the snapshot", () => {
18 |
19 | // Attempt to read the full file contents. We could require the module here, however there is normally non
20 | // deterministic data (filepaths, etc.) that are resolved when the module is loaded, so it is simpler to
21 | // check the contents for changes (sanity/protection against undesired changes to the definition)
22 | let contents: string;
23 | let error;
24 | try {
25 | contents = fs.readFileSync(__dirname + "/../../../src/cli/generate/Generate.definition.ts").toString();
26 | } catch (e) {
27 | error = e;
28 | Imperative.console.error(`Error reading Generate.definition.ts Did you move the file? Details: ${e.message}`);
29 | }
30 | expect(error).toBeUndefined();
31 | // Removed the snapshot testing - it's not very useful, and it causes snapshots to be generated unexpectedly under Jenkins.
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/__tests__/cli/generate/bundle/GenerateBundle.definition.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | * Copyright IBM Corp, 2019
10 | *
11 | */
12 |
13 | import * as fs from "fs";
14 | import { Imperative } from "@zowe/imperative";
15 |
16 | describe("bundle definition", () => {
17 | it("should match the snapshot", () => {
18 |
19 | // Attempt to read the full file contents. We could require the module here, however there is normally non
20 | // deterministic data (filepaths, etc.) that are resolved when the module is loaded, so it is simpler to
21 | // check the contents for changes (sanity/protection against undesired changes to the definition)
22 | let contents: string;
23 | let error;
24 | try {
25 | contents = fs.readFileSync(__dirname + "/../../../../src/cli/generate/bundle/GenerateBundle.definition.ts").toString();
26 | } catch (e) {
27 | error = e;
28 | Imperative.console.error(`Error reading GenerateBundle.definition.ts Did you move the file? Details: ${e.message}`);
29 | }
30 | expect(error).toBeUndefined();
31 | // Removed the snapshot testing - it's not very useful, and it causes snapshots to be generated unexpectedly under Jenkins.
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/__tests__/cli/push/Push.definition.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | * Copyright IBM Corp, 2019
10 | *
11 | */
12 |
13 | import * as fs from "fs";
14 | import { Imperative } from "@zowe/imperative";
15 |
16 | describe("Push definition", () => {
17 | it("should match the snapshot", () => {
18 |
19 | // Attempt to read the full file contents. We could require the module here, however there is normally non
20 | // deterministic data (filepaths, etc.) that are resolved when the module is loaded, so it is simpler to
21 | // check the contents for changes (sanity/protection against undesired changes to the definition)
22 | let contents: string;
23 | let error;
24 | try {
25 | contents = fs.readFileSync(__dirname + "/../../../src/cli/push/Push.definition.ts").toString();
26 | } catch (e) {
27 | error = e;
28 | Imperative.console.error(`Error reading Push.definition.ts Did you move the file? Details: ${e.message}`);
29 | }
30 | expect(error).toBeUndefined();
31 | // Removed the snapshot testing - it's not very useful, and it causes snapshots to be generated unexpectedly under Jenkins.
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/__tests__/cli/push/bundle/PushBundle.definition.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | * Copyright IBM Corp, 2019
10 | *
11 | */
12 |
13 | import * as fs from "fs";
14 | import { Imperative } from "@zowe/imperative";
15 |
16 | describe("bundle definition", () => {
17 | it("should match the snapshot", () => {
18 |
19 | // Attempt to read the full file contents. We could require the module here, however there is normally non
20 | // deterministic data (filepaths, etc.) that are resolved when the module is loaded, so it is simpler to
21 | // check the contents for changes (sanity/protection against undesired changes to the definition)
22 | let contents: string;
23 | let error;
24 | try {
25 | contents = fs.readFileSync(__dirname + "/../../../../src/cli/push/bundle/PushBundle.definition.ts").toString();
26 | } catch (e) {
27 | error = e;
28 | Imperative.console.error(`Error reading PushBundle.definition.ts Did you move the file? Details: ${e.message}`);
29 | }
30 | expect(error).toBeUndefined();
31 | // Removed the snapshot testing - it's not very useful, and it causes snapshots to be generated unexpectedly under Jenkins.
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/__tests__/cli/undeploy/Undeploy.definition.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | * Copyright IBM Corp, 2019
10 | *
11 | */
12 |
13 | import * as fs from "fs";
14 | import { Imperative } from "@zowe/imperative";
15 |
16 | describe("Undeploy definition", () => {
17 | it("should match the snapshot", () => {
18 |
19 | // Attempt to read the full file contents. We could require the module here, however there is normally non
20 | // deterministic data (filepaths, etc.) that are resolved when the module is loaded, so it is simpler to
21 | // check the contents for changes (sanity/protection against undesired changes to the definition)
22 | let contents: string;
23 | let error;
24 | try {
25 | contents = fs.readFileSync(__dirname + "/../../../src/cli/undeploy/Undeploy.definition.ts").toString();
26 | } catch (e) {
27 | error = e;
28 | Imperative.console.error(`Error reading Undeploy.definition.ts Did you move the file? Details: ${e.message}`);
29 | }
30 | expect(error).toBeUndefined();
31 | // Removed the snapshot testing - it's not very useful, and it causes snapshots to be generated unexpectedly under Jenkins.
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/__tests__/cli/undeploy/bundle/UndeployBundle.definition.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | * Copyright IBM Corp, 2019
10 | *
11 | */
12 |
13 | import * as fs from "fs";
14 | import { Imperative } from "@zowe/imperative";
15 |
16 | describe("bundle definition", () => {
17 | it("should match the snapshot", () => {
18 |
19 | // Attempt to read the full file contents. We could require the module here, however there is normally non
20 | // deterministic data (filepaths, etc.) that are resolved when the module is loaded, so it is simpler to
21 | // check the contents for changes (sanity/protection against undesired changes to the definition)
22 | let contents: string;
23 | let error;
24 | try {
25 | contents = fs.readFileSync(__dirname + "/../../../../src/cli/undeploy/bundle/UndeployBundle.definition.ts").toString();
26 | } catch (e) {
27 | error = e;
28 | Imperative.console.error(`Error reading UndeployBundle.definition.ts Did you move the file? Details: ${e.message}`);
29 | }
30 | expect(error).toBeUndefined();
31 | // Removed the snapshot testing - it's not very useful, and it causes snapshots to be generated unexpectedly under Jenkins.
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/__tests__/imperative.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | * Copyright IBM Corp, 2019
10 | */
11 |
12 | describe("imperative config", () => {
13 |
14 | // Will fail if imperative config object is changed. This is a sanity/protection check to ensure that any
15 | // changes to the configuration document are intended.
16 | // Removed snapshot due to pluginHealthCheck path varies from machine to machine.
17 | it("config should match expected values", () => {
18 | const config = require("../src/imperative");
19 | expect(config.name).toBe("cics-deploy");
20 | expect(config.pluginHealthCheck).toContain("healthCheck.handler");
21 | expect(config.pluginSummary).toBe("Generate and deploy IBM CICS bundle resources");
22 | expect(config.productDisplayName).toBe("Zowe cics-deploy plug-in");
23 | expect(config.rootCommandDescription).toContain("CICS bundle deployment plugin.");
24 | });
25 |
26 | });
27 |
--------------------------------------------------------------------------------
/__tests__/test-tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "types": [
4 | "node",
5 | "jest"
6 | ],
7 | "target": "es2015",
8 | "module": "commonjs",
9 | "declaration": true,
10 | "moduleResolution": "node",
11 | "noImplicitAny": true,
12 | "outDir": "./lib",
13 | "preserveConstEnums": true,
14 | "removeComments": false,
15 | "pretty": true,
16 | "sourceMap": true,
17 | "newLine": "lf"
18 | },
19 | "include": [
20 | "./**/*.ts"
21 | ],
22 | "exclude": [
23 | "lib",
24 | "__results__/",
25 | "__snapshots__",
26 | "node_modules"
27 | ]
28 | }
--------------------------------------------------------------------------------
/__tests__/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tslint.json",
3 | "rules": {
4 | "max-line-length": false,
5 | "no-magic-numbers": false,
6 | "no-implicit-dependencies": [true,"dev"]
7 | },
8 | "exclude": "__resources__/,__resultts__/",
9 | "type-check": true
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/docs/.gitignore:
--------------------------------------------------------------------------------
1 | _site/
2 | .sass-cache/
3 | .jekyll-metadata
4 | _pdf
5 | .DS_Store
6 | .idea
7 | .vscode
8 |
--------------------------------------------------------------------------------
/docs/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | image: ruby:2.3
2 |
3 | variables:
4 | JEKYLL_ENV: production
5 |
6 | test:
7 | stage: test
8 | script:
9 | - sh ./var/build.sh
10 | - bundle exec jekyll build -d test
11 | artifacts:
12 | paths:
13 | - test
14 | except:
15 | - master
16 |
17 | pages:
18 | stage: deploy
19 | script:
20 | - sh ./var/build.sh
21 | - bundle exec jekyll build -d public
22 | artifacts:
23 | paths:
24 | - public
25 | only:
26 | - master
27 |
--------------------------------------------------------------------------------
/docs/404.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Page Not Found"
3 | search: exclude
4 | sidebar: cdp_sidebar
5 | ---
6 |
7 | 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.
8 |
--------------------------------------------------------------------------------
/docs/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM jekyll/builder
2 |
3 | WORKDIR /tmp
4 | ADD Gemfile /tmp/
5 | ADD Gemfile.lock /tmp/
6 | RUN bundle install
7 |
8 | FROM jekyll/jekyll
9 |
10 | VOLUME /src
11 | EXPOSE 4000
12 |
13 | WORKDIR /src
14 | ENTRYPOINT ["jekyll", "serve", "-H", "0.0.0.0"]
15 |
--------------------------------------------------------------------------------
/docs/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gem 'github-pages', group: :jekyll_plugins
4 |
--------------------------------------------------------------------------------
/docs/_data/alerts.yml:
--------------------------------------------------------------------------------
1 | tip: '
Tip: '
2 | note: '
Note: '
3 | important: '
Important: '
4 | warning: '
Warning: '
5 | end: '
'
6 |
7 | callout_danger: '
'
8 | callout_default: '
'
9 | callout_primary: '
'
10 | callout_success: '
'
11 | callout_info: '
'
12 | callout_warning: '
'
13 |
14 | hr_faded: ''
15 | hr_shaded: ''
--------------------------------------------------------------------------------
/docs/_data/definitions.yml:
--------------------------------------------------------------------------------
1 | elephant: "This is a sample definition."
2 |
3 | baseball: "Baseball is considered America's pasttime sport, though that may be more of a historical term than a current one. There's a lot more excitement about football than baseball. A baseball game is somewhat of a snooze to watch, for the most part."
4 |
5 | basketball: "Basketball is a sport involving two teams of five players each competing to put a ball through a small circular rim 10 feet above the ground. Basketball requires players to be in top physical condition, since they spend most of the game running back and forth along a 94-foot-long floor."
6 |
7 | football: "No doubt the most fun sport to watch, football also manages to accrue the most injuries with the players. From concussions to blown knees, football players have short sport lives."
8 |
9 | soccer: "If there's one sport that dominates the world landscape, it's soccer. However, US soccer fans are few and far between. Apart from the popularity of soccer during the World Cup, most people don't even know the name of the professional soccer organization in their area."
--------------------------------------------------------------------------------
/docs/_data/glossary.yml:
--------------------------------------------------------------------------------
1 | jekyll_platform: "Jekyll is a static site generator that builds sites using most modern web technologies."
2 |
3 | fractious: "Like a little mischevious child, full of annoying and constant trouble."
4 |
5 | gratuitous: "Something that is unwarranted and uncouth, like the social equivalent of a flagrant foul."
6 |
7 | haughty: "Proud and flaunting it. Holding your head high up like a snooty, too-good-for-everything rich person."
8 |
9 | impertinent: "Someone acting rude and insensitive to others."
10 |
11 | intrepid: "Brave and courageous especially in a difficult, dangerous situation."
--------------------------------------------------------------------------------
/docs/_data/samplelist.yml:
--------------------------------------------------------------------------------
1 | entries:
2 | - title: Sidebar
3 | folders:
4 | - title: Food
5 |
6 | folderitems:
7 | - title: Bananas
8 | url: bananas.html
9 |
10 | subfolder:
11 | - title: Apples
12 |
13 | subfolderitems:
14 | - title: Fuji apples
15 | url: fuji_apples.html
16 |
17 |
18 | - title: Gala apples
19 | url: gala_apples.html
20 |
21 | name:
22 | husband: Tom
23 | wife: Shannon
24 |
25 | bikes:
26 | - title: mountain bikes
27 | - title: road bikes
28 | - title: hybrid bikes
29 |
30 |
31 | salesteams:
32 | - title: Regions
33 | subfolderitems:
34 | - location: US
35 | - location: Spain
36 | - location: France
37 |
38 | toc:
39 | - title: Group 1
40 | subfolderitems:
41 | - page: Thing 1
42 | - page: Thing 2
43 | - page: Thing 3
44 | - title: Group 2
45 | subfolderitems:
46 | - page: Piece 1
47 | - page: Piece 2
48 | - page: Piece 3
49 | - title: Group 3
50 | subfolderitems:
51 | - page: Widget 1
52 | - page: Widget 2
53 | - page: Widget 3
54 |
55 | something: &hello Greetings earthling!
56 | myref: *hello
57 |
58 | about:
59 | - zero
60 | - one
61 | - two
62 | - three
63 |
64 | numbercolors:
65 | - zero:
66 | properties: red
67 | - one:
68 | properties: yellow
69 | - two:
70 | properties: green
71 | - three:
72 | properties: blue
73 |
74 | mypages:
75 | - section1: Section 1
76 | audience: developers
77 | product: acme
78 | url: facebook.com
79 | - section2: Section 2
80 | audience: writers
81 | product: acme
82 | url: google.com
83 | - section3: Section 3
84 | audience: developers
85 | product: acme
86 | url: amazon.com
87 | - section4: Section 4
88 | audience: writers
89 | product: gizmo
90 | url: apple.com
91 | - section5: Section 5
92 | audience: writers
93 | product: acme
94 | url: microsoft.com
95 |
96 | feedback: >
97 | This is my feedback to you.
98 | Even if I include linebreaks here,
99 | all of the linebreaks will be removed when the value is inserted.
100 |
101 | block: |
102 | This pipe does something a little different.
103 | It preserves the breaks.
104 | This is really helpful for code samples,
105 | since you can format the code samples with
106 | the appropriate
107 | white spacing.
--------------------------------------------------------------------------------
/docs/_data/strings.yml:
--------------------------------------------------------------------------------
1 |
2 |
3 | # placed here for translation purposes
4 | search_placeholder_text: search...
5 | search_no_results_text: No results found.
6 |
--------------------------------------------------------------------------------
/docs/_data/tags.yml:
--------------------------------------------------------------------------------
1 | # Note:
2 | # If you are using the createtag script, don't leave an blank line at the end of this file.
3 | # In other words, the last line must be the last tag in the allowed-tags list.
4 | allowed-tags:
5 | - getting_started
6 | - concepts
7 | - troubleshooting
8 | - tutorial
9 |
--------------------------------------------------------------------------------
/docs/_data/terms.yml:
--------------------------------------------------------------------------------
1 | apple: "apple - the fruit of a disiduous tree."
--------------------------------------------------------------------------------
/docs/_data/topnav.yml:
--------------------------------------------------------------------------------
1 | ## Topnav single links
2 | ## if you want to list an external url, use external_url instead of url. the theme will apply a different link base.
3 | topnav:
4 | - title: Topnav
5 | items:
6 | - title: GitHub
7 | external_url: https://github.com/IBM/zowe-cli-cics-deploy-plugin
8 | - title: Change log
9 | external_url: https://github.com/IBM/zowe-cli-cics-deploy-plugin/blob/master/CHANGELOG.md
10 |
--------------------------------------------------------------------------------
/docs/_includes/archive.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | type: archive
4 | ---
5 |
6 |
" + header.innerHTML + "";
58 | else if (this_level <= level){ // higher level than before; end parent ol
59 | for(i = this_level; i < level; i++) {
60 | html += "
"+settings.listType+">"
61 | }
62 | html += "
" + header.innerHTML + "";
63 | }
64 | else if (this_level > level) { // lower level than before; expand the previous to contain a ol
65 | for(i = this_level; i > level; i--) {
66 | html += "<"+settings.listType+">
"
67 | }
68 | html += "" + header.innerHTML + "";
69 | }
70 | level = this_level; // update for the next one
71 | });
72 | html += ""+settings.listType+">";
73 | if (!settings.noBackToTopLinks) {
74 | $(document).on('click', '.back-to-top', function() {
75 | $(window).scrollTop(0);
76 | window.location.hash = '';
77 | });
78 | }
79 |
80 | render[settings.showEffect]();
81 | };
82 | })(jQuery);
--------------------------------------------------------------------------------
/docs/licenses/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Tom Johnson
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/docs/licenses/LICENSE-BSD-NAVGOCO.txt:
--------------------------------------------------------------------------------
1 | /* This license pertains to the Navgoco jQuery component used for the sidebar. */
2 |
3 | Copyright (c) 2013, Christodoulos Tsoulloftas, http://www.komposta.net
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without modification,
7 | are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice,
10 | this list of conditions and the following disclaimer.
11 | * Redistributions in binary form must reproduce the above copyright notice,
12 | this list of conditions and the following disclaimer in the documentation
13 | and/or other materials provided with the distribution.
14 | * Neither the name of the nor the names of its
15 | contributors may be used to endorse or promote products derived from this
16 | software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27 | OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/docs/pages/cdp/cdp-Installing.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installing
3 | tags: [getting_started]
4 | keywords:
5 | summary: 'To install the Zowe CLI and cics-deploy plug-in, perform the following steps on your local workstation.'
6 | sidebar: cdp_sidebar
7 | permalink: cdp-Installing.html
8 | folder: cdp
9 | toc: false
10 | ---
11 |
12 | 1. Install Node.js V8.0 or later, and Node Package Manager (npm) V5.0 or later, that are required by Zowe CLI. Installers are available from Node.js [Downloads](https://nodejs.org/en/download/).
13 |
14 | To verify the versions installed:
15 |
16 | ```console
17 | node --version
18 | npm --version
19 | ```
20 |
21 | 2. Install [Zowe CLI](https://docs.zowe.org/stable/user-guide/cli-installcli.html). For example, to install using npm from an online registry:
22 |
23 | ```console
24 | npm install @zowe/cli@zowe-v1-lts -g
25 | zowe plugins install @zowe/secure-credential-store-for-zowe-cli@zowe-v1-lts
26 | ```
27 |
28 | 3. Install the CICS® plug-in:
29 |
30 | ```console
31 | zowe plugins install @zowe/cics-for-zowe-cli@zowe-v1-lts
32 | ```
33 |
34 | 4. Install the cics-deploy plug-in:
35 |
36 | ```console
37 | zowe plugins install zowe-cli-cics-deploy-plugin
38 | ```
39 |
40 | 5. Verify the plug-ins are installed:
41 |
42 | ```console
43 | zowe plugins list
44 | ```
45 |
46 | Displays a list of the installed plug-ins:
47 |
48 |
59 |
--------------------------------------------------------------------------------
/docs/pages/cdp/cdp-Requirements-on-zOS.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Requirements on z/OS
3 | tags: [getting_started, requirements]
4 | keywords:
5 | summary: "The cics-deploy plug-in is dependent on several servers and facilities that need to be set up on z/OS®."
6 | sidebar: cdp_sidebar
7 | permalink: cdp-Requirements-on-zOS.html
8 | folder: cdp
9 | toc: false
10 | ---
11 |
12 | ### z/OS Management Facility
13 |
14 | A [z/OS Management Facility (z/OSMF)](https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.izua300/IZUHPINFO_PartConfiguring.htm) server is required to run the [`zowe cics-deploy push bundle`](cdp-CLIReadMe#push--p), [`zowe cics-deploy deploy bundle`](cdp-CLIReadMe#deploy--d--dep), and [`zowe cics-deploy undeploy bundle`](cdp-CLIReadMe#undeploy--u--udep) commands. These commands call the API for [`zowe zos-jobs submit`](https://github.com/zowe/zowe-cli/blob/master/docs/CLIReadme.md#module-submit) to submit JCL to execute the DFHDPLOY utility to deploy and undeploy CICS® bundles.
15 |
16 | The z/OSMF server is also required by the [`zowe cics-deploy push bundle`](cdp-CLIReadMe#push--p) command when it uses the API for [`zowe zos-files upload dir-to-uss`](https://github.com/zowe/zowe-cli/blob/master/docs/CLIReadme.md#command-dir-to-uss) to copy a CICS bundle to a z/OS directory.
17 |
18 | ### z/OS Secure SHell daemon
19 |
20 | The [z/OS Secure SHell daemon (sshd)](https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.foto100/sshset.htm) is required to run the [`zowe cics-deploy push bundle`](cdp-CLIReadMe#push--p) command. This command uses the API for [`zowe zos-uss issue ssh`](https://github.com/zowe/zowe-cli/blob/master/docs/CLIReadme.md#command-ssh) to remove old files from the CICS bundle directory on z/OS and execute `npm` on z/OS to install and uninstall dependencies for Node.js applications.
21 |
22 | ### DFHDPLOY utility
23 |
24 | The [DFHDPLOY](https://www.ibm.com/support/knowledgecenter/SSGMCP_5.5.0/applications/deploying/dfhdploy_overview.html) utility is provided with IBM® CICS Transaction Server (CICS) and is required to run the [`zowe cics-deploy push bundle`](cdp-CLIReadMe#push--p), [`zowe cics-deploy deploy bundle`](cdp-CLIReadMe#deploy--d--dep), and [`zowe cics-deploy undeploy bundle`](cdp-CLIReadMe#undeploy--u--udep) commands. These commands start DFHDPLOY with a script to perform deploy and undeploy operations.
25 |
26 | ### CICSPlex System Manager
27 |
28 | CICSPlex® System Manager \(CPSM\) is provided with CICS and is required to run the DFHDPLOY utility, and for the [`zowe cics-deploy push bundle`](cdp-CLIReadMe#push--p) command to query application resources via the CICS Management Client Interface (CMCI). CPSM should be connected to the CICS regions into which the application is being installed.
29 |
30 | ### Node.js SDK
31 |
32 | If you intend to run Node.js applications on z/OS, you must install the IBM SDK for Node.js - z/OS. See [Installing and configuring IBM SDK for Node.js - z/OS](https://www.ibm.com/support/knowledgecenter/en/SSTRRS_8.0.0/com.ibm.nodejs.zos.v8.doc/install.htm) for full details.
--------------------------------------------------------------------------------
/docs/pages/cdp/cdp-Tutorials-overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Tutorials overview
3 | tags: [tutorial]
4 | keywords:
5 | summary: "Summary of the tutorials to provision a CICS® region and deploy applications to it."
6 | sidebar: cdp_sidebar
7 | permalink: cdp-Tutorials-overview.html
8 | folder: cdp
9 | toc: true
10 | ---
11 |
12 | Firstly, you will need a CICS region:
13 |
14 | * The z/OS® Provisioning Toolkit enables you to provision CICS regions yourself:
15 |
16 | * [Preparing a z/OS Provisioning Toolkit image](cdp-Preparing-a-zOS-PT-image) - prepare a z/OS Provisioning Toolkit image for CICS, and optionally include an application in the image.
17 |
18 | * [Provisioning a CICS region](cdp-Provisioning-a-CICS-region) - provision a CICS region from a z/OS Provisioning Toolkit image.
19 |
20 | * Alternatively, work with your CICS and z/OS system administrators [Creating Zowe CLI profiles](cdp-Creating-Zowe-CLI-profiles) based on the z/OS system and CICS region you can use.
21 |
22 | Next, deploy a CICS bundle containing an application to the CICS region:
23 |
24 | * [Deploying a Node.js application](cdp-Deploying-a-Nodejs-application) - create a Node.js application using the Express Application Generator, package it into a CICS bundle, and deploy it.
25 |
26 | * [Deploying a CICS policy](cdp-Deploying-a-CICS-policy) - download a sample policy packaged in a CICS bundle, and deploy it.
27 |
28 | If you need more precise control of the deployment steps, for example if you are writing a CI-CD pipeline:
29 |
30 | * [Deploying using individual actions](cdp-Deploying-using-individual-actions) - steps that provide greater control when deploying a CICS bundle.
31 |
--------------------------------------------------------------------------------
/docs/pages/cdp/cdp-Zowe-CLI-CICS-deploy-plug-in.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Zowe CLI CICS deploy plug-in
3 | tags: [getting_started]
4 | keywords:
5 | summary: "The cics-deploy plug-in extends the Zowe command line interface (CLI) to deploy applications developed on a workstation to IBM® CICS® Transaction Server for z/OS® (CICS). The Zowe CLI and plug-ins provide a simple and streamlined way to interact with IBM z/OS."
6 | sidebar: cdp_sidebar
7 | permalink: index.html
8 | folder: cdp
9 | ---
10 |
11 | The cics-deploy plug-in provides a CICS deployment workflow for developers and CI/CD automation pipelines similar to that experienced when deploying applications to cloud environments.
12 |
13 | Before you start, and especially if you are not familiar with the world of z/OS, Zowe, and CICS, it's a good idea to read about some of the key concepts, which include [Zowe](cdp-Zowe-and-the-Zowe-CLI), [Zowe CLI profiles](cdp-Zowe-CLI-profiles) and [CICS bundles](cdp-CICS-bundles). If you're keen to get going quickly, you can jump right in and follow along with our tutorial on [Deploying a Node.js application](cdp-Deploying-a-Nodejs-application).
14 |
15 | When everything is [installed](cdp-Installing) and you have [created the Zowe CLI profiles](cdp-Creating-Zowe-CLI-profiles), you can deploy an application from your workstation to CICS in two steps:
16 |
17 | 1. Use the [zowe cics-deploy generate bundle](cdp-CLIReadMe#generate--g--gen) command to generate some metadata and artifacts that help the target CICS system understand your application.
18 |
19 | 2. Use the [zowe cics-deploy push bundle](cdp-CLIReadMe#push--p) command to push the generated bundle to one or more regions within a CICSplex, enabling and deploying it as an executing application.
20 |
21 | Should you need it, and if you understand a little more about CICS, further commands like [zowe cics-deploy deploy bundle](cdp-CLIReadMe#deploy--d--dep) and [zowe cics-deploy undeploy bundle](cdp-CLIReadMe#undeploy--u--udep) offer you finer-grained control of the process - for example, to enable you to install a bundle in subsets of CICS regions in a cluster in such a way as to maintain an application's availability for clients.
22 |
23 | If you hit any speed bumps on your journey, check out our [Troubleshooting](cdp-Log-and-trace-files) pages.
24 |
--------------------------------------------------------------------------------
/docs/pages/cdp/cdp-cics-bundles.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: CICS bundles
3 | tags: [getting_started, concepts]
4 | keywords:
5 | summary: "An overview of CICS® bundles and their contents."
6 | sidebar: cdp_sidebar
7 | permalink: cdp-CICS-bundles.html
8 | folder: cdp
9 | toc: false
10 | ---
11 | In CICS, Node.js applications are deployed as a CICS bundle.
12 |
13 | A CICS bundle is a directory that contains artifacts and a manifest that describes the bundle and its dependencies. CICS bundles allow you to group and manage resources relating to your Node.js application.
14 |
15 | The CICS BUNDLE resource represents the Node.js application to CICS and you can use it to manage the lifecycle of the application.
16 |
17 | When the bundle is deployed in CICS, the Node.js runtime starts and the associated application runs. When the bundle is undeployed, the Node.js application and runtime are stopped and the bundle is discarded.
18 |
19 | ## Contents of a CICS bundle
20 |
21 | {% include image.html file="CICSbundlecontents.png" alt="Contents of a CICS bundle with the myExpressApp Node.js application" caption="Contents of a CICS bundle with the myExpressApp Node.js application" %}
22 |
23 | When you generate a bundle, the following files are created from package.json:
24 |
25 | **cics.xml** contains a manifest of the contents of the bundle and is found in the /META-INF folder. It describes which resources to create in the CICS region and the location of the supporting artifacts, which prerequisites are required for the CICS bundle to run successfully, and any services that the CICS bundle can offer to other bundles. For more information on bundle manifests, see [Manifest contents for a CICS bundle](https://www.ibm.com/support/knowledgecenter/SSGMCP_5.5.0/configuring/resources/manifestdefinitions.html).
26 |
27 | **myexpressapp.nodejsapp** contains information about the Node.js application and references the JavaScript code to start the application.
28 |
29 | **myexpressapp.profile** contains configuration information for the runtime environment, including the PORT environment variable.
30 |
--------------------------------------------------------------------------------
/docs/pages/cdp/cdp-zowe-and-the-Zowe-CLI.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Zowe, the Zowe CLI and the cics-deploy plug-in
3 | tags: [getting_started, concepts]
4 | keywords:
5 | summary: "Zowe is an open source framework that bridges the divide between workstation and mainframe computing."
6 | sidebar: cdp_sidebar
7 | permalink: cdp-Zowe-and-the-Zowe-CLI.html
8 | folder: cdp
9 | ---
10 |
11 | ### Zowe
12 |
13 | Zowe consists of several components:
14 |
15 | * The core framework
16 | * The API mediation layer
17 | * The Zowe CLI
18 |
19 | The core framework and the API mediation layer are software components that need to be installed as part of the Zowe runtime on z/OS.
20 |
21 | You can read much more about the wider Zowe initiative here.
22 |
23 | ### Zowe CLI
24 |
25 | The Zowe CLI is installed on and runs on a local workstation, and does not need to be installed on z/OS. It does not depend on you having installed any other Zowe components, either locally or on z/OS. It *does* need a few familiar [facilities](cdp-Requirements-on-zOS.html) to be set up on the mainframe first.
26 |
27 | It allows developers to interact with the mainframe via a command-line interface, which may more approachable than alternative and proprietary front-end applications.
28 |
29 | The Zowe CLI is extended by creating and installing plug-ins.
30 |
31 | ### Zowe CLI CICS deploy plug-in
32 |
33 | The Zowe CLI CICS® deploy plug-in extends the Zowe CLI to offer a command-line mechanism for Node.js developers to deploy workstation-developed applications into a running CICS Transaction Server for z/OS region on a remote mainframe. It is the quickest way to get a Node.js application from your workstation into a running CICS region without any special CICS knowledge.
34 |
--------------------------------------------------------------------------------
/docs/pages/tags/tag_concepts.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Pages that explain basic concepts"
3 | tagName: concepts
4 | search: exclude
5 | permalink: tag_concepts.html
6 | sidebar: cdp_sidebar
7 | folder: tags
8 | ---
9 | {% include taglogic.html %}
10 |
11 | {% include links.html %}
12 |
--------------------------------------------------------------------------------
/docs/pages/tags/tag_getting_started.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Getting started pages"
3 | tagName: getting_started
4 | search: exclude
5 | permalink: tag_getting_started.html
6 | sidebar: mydoc_sidebar
7 | folder: tags
8 | ---
9 | {% include taglogic.html %}
10 |
11 | {% include links.html %}
12 |
--------------------------------------------------------------------------------
/docs/pages/tags/tag_navigation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Navigation pages"
3 | tagName: navigation
4 | search: exclude
5 | permalink: tag_navigation.html
6 | sidebar: mydoc_sidebar
7 | folder: tags
8 | ---
9 | {% include taglogic.html %}
10 |
11 | {% include links.html %}
12 |
--------------------------------------------------------------------------------
/docs/pages/tags/tag_troubleshooting.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Troubleshooting pages"
3 | tagName: troubleshooting
4 | search: exclude
5 | permalink: tag_troubleshooting.html
6 | sidebar: mydoc_sidebar
7 | folder: tags
8 | ---
9 | {% include taglogic.html %}
10 |
11 | {% include links.html %}
12 |
--------------------------------------------------------------------------------
/docs/pdf-all.sh:
--------------------------------------------------------------------------------
1 | . pdf-mydoc.sh; . pdf-product1.sh; . pdf-product2.sh;
--------------------------------------------------------------------------------
/docs/pdf-mydoc.sh:
--------------------------------------------------------------------------------
1 | # Note that .sh scripts work only on Mac. If you're on Windows, install Git Bash and use that as your client.
2 |
3 | echo 'Kill all Jekyll instances'
4 | kill -9 $(ps aux | grep '[j]ekyll' | awk '{print $2}')
5 | clear
6 |
7 | echo "Building PDF-friendly HTML site for Mydoc ...";
8 | bundle exec jekyll serve --detach --config _config.yml,pdfconfigs/config_mydoc_pdf.yml;
9 | echo "done";
10 |
11 | echo "Building the PDF ...";
12 | prince --javascript --input-list=_site/pdfconfigs/prince-list.txt -o pdf/mydoc.pdf;
13 |
14 | echo "Done. Look in the pdf directory to see if it printed successfully."
15 |
--------------------------------------------------------------------------------
/docs/pdf-product1.sh:
--------------------------------------------------------------------------------
1 | echo 'Killing all Jekyll instances'
2 | kill -9 $(ps aux | grep '[j]ekyll' | awk '{print $2}')
3 | clear
4 |
5 | echo "Building PDF-friendly HTML site for Product1 ...";
6 | bundle exec jekyll serve --detach --config _config.yml,pdfconfigs/config_product1_pdf.yml;
7 | echo "done";
8 |
9 | echo "Building the PDF ...";
10 | prince --javascript --input-list=_site/pdfconfigs/prince-list.txt -o pdf/product1.pdf;
11 | echo "done";
12 |
--------------------------------------------------------------------------------
/docs/pdf-product2.sh:
--------------------------------------------------------------------------------
1 | echo 'Killing all Jekyll instances'
2 | kill -9 $(ps aux | grep '[j]ekyll' | awk '{print $2}')
3 | clear
4 |
5 | echo "Building PDF-friendly HTML site for Product2 ...";
6 | bundle exec jekyll serve --detach --config _config.yml,pdfconfigs/config_product2_pdf.yml;
7 | echo "done";
8 |
9 | echo "Building the PDF ...";
10 | prince --javascript --input-list=_site/pdfconfigs/prince-list.txt -o pdf/product2.pdf;
11 | echo "done";
12 |
--------------------------------------------------------------------------------
/docs/pdfconfigs/config_mydoc_pdf.yml:
--------------------------------------------------------------------------------
1 | destination: _site/
2 | url: "http://127.0.0.1:4010"
3 | baseurl: "/mydoc-pdf"
4 | port: 4010
5 | output: pdf
6 | product: mydoc
7 | print_title: Jekyll theme for documentation — mydoc product
8 | print_subtitle: version 6.0
9 | output: pdf
10 | defaults:
11 | -
12 | scope:
13 | path: ""
14 | type: "pages"
15 | values:
16 | layout: "page_print"
17 | comments: true
18 | search: true
19 |
20 | pdf_sidebar: mydoc_sidebar
21 |
--------------------------------------------------------------------------------
/docs/pdfconfigs/config_product1_pdf.yml:
--------------------------------------------------------------------------------
1 | destination: _site/
2 | url: "http://127.0.0.1:4011"
3 | baseurl: "/product1-pdf"
4 | port: 4011
5 | output: pdf
6 | product: product1
7 | print_title: Product 1 documentation
8 | print_subtitle: version 1.0
9 | output: pdf
10 | defaults:
11 | -
12 | scope:
13 | path: ""
14 | type: "pages"
15 | values:
16 | layout: "page_print"
17 | comments: true
18 | search: true
19 |
20 | pdf_sidebar: product1_sidebar
21 |
--------------------------------------------------------------------------------
/docs/pdfconfigs/config_product2_pdf.yml:
--------------------------------------------------------------------------------
1 | destination: _site/
2 | url: "http://127.0.0.1:4012"
3 | baseurl: "/product2-pdf"
4 | port: 4012
5 | output: pdf
6 | product: product2
7 | print_title: Product 2 documentation
8 | print_subtitle: version 1.0
9 | output: pdf
10 | defaults:
11 | -
12 | scope:
13 | path: ""
14 | type: "pages"
15 | values:
16 | layout: "page_print"
17 | comments: true
18 | search: true
19 |
20 | pdf_sidebar: product2_sidebar
21 |
--------------------------------------------------------------------------------
/docs/pdfconfigs/prince-list.txt:
--------------------------------------------------------------------------------
1 | ---
2 | layout: none
3 | search: exclude
4 | ---
5 |
6 |
7 | {% assign sidebar = site.data.sidebars[site.pdf_sidebar].entries %}
8 |
9 | {% for entry in sidebar %}
10 |
11 | {% for folder in entry.folders %}
12 | {% if folder.output contains "pdf" %}
13 | {% for folderitem in folder.folderitems %}
14 | {% if folderitem.output contains "pdf" %}
15 | {{site.url}}{{site.baseurl}}{{folderitem.url}}
16 | {% for subfolders in folderitem.subfolders %}
17 | {% if subfolders.output contains "pdf" %}
18 | {% for subfolderitem in subfolders.subfolderitems %}
19 | {% if subfolderitem.output contains "pdf" %}
20 | {{site.url}}{{site.baseurl}}{{subfolderitem.url}}
21 | {% endif %}
22 | {% endfor %}
23 | {% endif %}
24 | {% endfor %}
25 | {% endif %}
26 | {% endfor %}
27 | {% endif %}
28 | {% endfor %}
29 | {% endfor %}
30 |
31 |
32 |
33 | {% comment %}
34 |
35 | {% assign sidebar = site.data.sidebars[page.sidebar].entries %}
36 |
37 | {% for entry in sidebar %}
38 | {% for folder in entry.folders %}
39 | {% if folder.output contains "web" %}
40 |
14 | {% for entry in sidebar %}
15 | {% for folder in entry.folders %}
16 | {% if folder.output contains "pdf" and folder.type != "frontmatter" %}
17 |
{{ folder.title }}
18 |
19 | {% for folderitem in folder.folderitems %}
20 | {% if folderitem.output contains "pdf" and folderitem.type != "frontmatter"%}
21 |
{{folderitem.title}}
22 | {% for subfolders in folderitem.subfolders %}
23 | {% if subfolders.output contains "pdf" and subfolders.type != "frontmatter" %}
24 |
{{ subfolders.title }}
25 |
26 | {% for subfolderitem in subfolders.subfolderitems%}
27 | {% if subfolderitem.output contains "pdf" and subfolderitem.type != "frontmatter"%}
28 |
This page is purposely separated out from the rest of theme so you can see the bare minimum code to add to a page, without all the other theme's code getting in the way.
66 |
67 |
Content in the tooltips (actually "popovers" according to Bootstrap lingo) can be pulled in dynamically by placing the JSON file on a remote host.
68 |
69 |
Note: Make sure you view the file source so you can read the notes I've added in code comments.
70 |
71 |
72 |
73 |
Basketball
74 |
75 |
Baseball
76 |
77 |
Football
78 |
79 |
Soccer
80 |
--------------------------------------------------------------------------------
/docs/tooltips.json:
--------------------------------------------------------------------------------
1 | ---
2 | layout: null
3 | search: exclude
4 | ---
5 |
6 | {
7 | "entries":
8 | [
9 | {% for page in site.tooltips %}
10 | {
11 | "doc_id": "{{ page.doc_id }}",
12 | "body": "{{ page.content | strip_newlines | replace: '\', '\\\\' | replace: '"', '\\"' }}"
13 | } {% unless forloop.last %},{% endunless %}
14 | {% endfor %}
15 | ]
16 | }
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/docs/update.sh:
--------------------------------------------------------------------------------
1 | git add .
2 | git status
3 | git commit -m "content update"
4 | git push
--------------------------------------------------------------------------------
/docs/var/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | apt-get update && \
3 | apt-get install -y libfontconfig zip npm git apt-transport-https ca-certificates curl openssl && \
4 | npm i -g npm && \
5 | npm cache clean -f && \
6 | npm install -g n && \
7 | n stable && \
8 | node --version && \
9 | npm --version && \
10 | bundle install
--------------------------------------------------------------------------------
/gulp/GulpHelpers.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | export interface ITaskFunction {
13 | (done?: any): any;
14 |
15 | description?: string;
16 | }
17 |
18 | export interface IGulpError extends Error {
19 | showStack?: boolean;
20 | }
21 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the *
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at *
4 | * https://www.eclipse.org/legal/epl-v20.html *
5 | * *
6 | * SPDX-License-Identifier: EPL-2.0 *
7 | * *
8 | * Copyright Contributors to the Zowe Project. *
9 | * Copyright IBM Corp. 2019 *
10 | * *
11 | */
12 |
13 | const gulp = require('gulp');
14 | require('ts-node/register');
15 |
16 | /**
17 | * Development related tasks
18 | */
19 | const docTask = require("./gulp/GenerateDoc");
20 | gulp.task('doc', docTask.doc);
21 |
--------------------------------------------------------------------------------
/jenkins/npm_login.expect:
--------------------------------------------------------------------------------
1 | #!/usr/bin/expect -f
2 |
3 | # set our args into variables
4 | set i 0; foreach n $argv {set "p[incr i]" $n}
5 |
6 | set timeout 60
7 | #npm login command, add whatever command-line args are necessary
8 | spawn npm login
9 | match_max 100000
10 |
11 | expect "Username"
12 | send "$p1\r"
13 |
14 | expect "Password"
15 | send "$p2\r"
16 |
17 | expect "Email"
18 | send "$p3\r"
19 |
20 | expect {
21 | timeout exit 1
22 | eof
23 | }
--------------------------------------------------------------------------------
/scripts/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "esversion": 6
3 | }
--------------------------------------------------------------------------------
/scripts/ReplaceVars.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | const fs = require("fs");
13 |
14 | //____________________________________________________________________________
15 | /**
16 | * Within the text of FileToReplace, replace all of occurrances of
17 | * variable names (specified as keys in varToValMap) with their values.
18 | *
19 | * @param {String} fileToReplace - The name of the text file for which
20 | * we want to replace variables with their values.
21 | *
22 | * @param {Object} varToValMap - A map of variable names. See replaceVarsInString()
23 | * for details.
24 | *
25 | * @returns {String} - The contents of FileToReplace with all variables
26 | * replaced with their values.
27 | */
28 | function replaceVarsInFile(fileToReplace, varToValMap) {
29 | const fileContents = fs.readFileSync(fileToReplace, "utf8");
30 | return replaceVarsInString(fileContents, varToValMap);
31 | }
32 |
33 | //____________________________________________________________________________
34 | /**
35 | * Within stringToReplace, replace all of occurrances of
36 | * variable names (specified as keys in varToValMap) with their values.
37 | *
38 | * @param {String} stringToReplace - The string into which we want to replace
39 | * variables with their values.
40 | *
41 | * @param {Object} varToValMap - A map of variable names to values used
42 | * to replace occurrences of the names within stringToReplace.
43 | * When using special characters to make your variable names stand out,
44 | * within stringToReplace, you must avoid characters that are special
45 | * to regular expressions (like $).
46 | *
47 | * @returns {String} - The contents of stringToReplace with all variables
48 | * replaced with their values.
49 | */
50 | function replaceVarsInString(stringToReplace, varToValMap) {
51 | // Iterate through keys. Replace each key with its value in stringToReplace.
52 | let replacedString = stringToReplace;
53 | Object.keys(varToValMap).forEach(varName => {
54 | const varMatcher = new RegExp(varName, 'g');
55 | replacedString = replacedString.replace(varMatcher, varToValMap[varName]);
56 | });
57 | return replacedString;
58 | }
59 | //____________________________________________________________________________
60 |
61 | module.exports = { replaceVarsInFile, replaceVarsInString };
62 |
--------------------------------------------------------------------------------
/scripts/askUser.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | const readline = require("readline");
13 |
14 | /**
15 | * Ask our user a question on the terminal's command line.
16 | * The script will wait for the user to type one line of text.
17 | *
18 | * @param {String} questionText - The text of the question to be asked.
19 | *
20 | * @returns A Promise containing the answer text that the user typed.
21 | */
22 | function askUser(questionText) {
23 | const conversation = readline.createInterface({
24 | input: process.stdin,
25 | output: process.stdout,
26 | history: 5
27 | });
28 |
29 | const answerProm = new Promise(function(resolve) {
30 | conversation.question(questionText, function(answer) {
31 | conversation.close();
32 | resolve(answer);
33 | });
34 | });
35 | return answerProm;
36 | }
37 |
38 | module.exports = { askUser };
39 |
--------------------------------------------------------------------------------
/scripts/unlinkImperative.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | /*
13 | * Script to remove the symbolic link to imperative after a build is complete
14 | */
15 |
16 | const fs = require("fs");
17 |
18 | const ok = 0;
19 | const error = 1;
20 | const impSymLinkPath = "./node_modules/@brightside/imperative";
21 |
22 | if (fs.existsSync(impSymLinkPath)) {
23 | // Get the file status to determine if it is a symlink.
24 | const fileStats = fs.lstatSync(impSymLinkPath);
25 | if (fileStats.isSymbolicLink()) {
26 | fs.unlinkSync(impSymLinkPath, (err) => {
27 | if (err) {
28 | console.log("\nEncountered the following error trying to delete\n " +
29 | impSymLinkPath + "\n" + err.message
30 | );
31 | process.exit(error);
32 | }
33 | });
34 | console.log("Deleted symbolic link " + impSymLinkPath);
35 | }
36 | }
37 |
38 | process.exit(ok);
--------------------------------------------------------------------------------
/src/api/BundlePush/CmciConfig.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | "use strict";
13 |
14 | import { IHandlerParameters, IProfile } from "@zowe/imperative";
15 |
16 |
17 | /**
18 | * Class to implement CMCI configuration.
19 | *
20 | * @export
21 | * @class CmciConfig
22 | */
23 | export class CmciConfig {
24 |
25 | /**
26 | * Merge command line overrides together with the optional cmciProfile into a
27 | * composite whole
28 | */
29 | public static mergeProfile(cmciProfile: IProfile, params: IHandlerParameters) {
30 |
31 | if (params.arguments.ch !== undefined) {
32 | cmciProfile.host = params.arguments.ch;
33 | cmciProfile.H = params.arguments.ch;
34 | }
35 |
36 | if (params.arguments.cpo !== undefined) {
37 | cmciProfile.port = params.arguments.cpo;
38 | cmciProfile.P = params.arguments.cpo;
39 | }
40 |
41 | if (params.arguments.cu !== undefined) {
42 | cmciProfile.user = params.arguments.cu;
43 | cmciProfile.u = params.arguments.cu;
44 | }
45 |
46 | if (params.arguments.cpw !== undefined) {
47 | cmciProfile.password = params.arguments.cpw;
48 | cmciProfile.pw = params.arguments.cpw;
49 | }
50 |
51 | if (params.arguments.cru !== undefined) {
52 | cmciProfile.rejectUnauthorized = params.arguments.cru;
53 | cmciProfile.ru = params.arguments.cru;
54 | }
55 |
56 | if (params.arguments.cpr !== undefined) {
57 | cmciProfile.protocol = params.arguments.cpr;
58 | cmciProfile.o = params.arguments.cpr;
59 | }
60 |
61 | // The CICS profile is optional, only validate it further if there is some content
62 | if (Object.keys(cmciProfile).length > 0) {
63 | CmciConfig.validateRequired(cmciProfile);
64 | }
65 | }
66 |
67 | private static DEFAULT_CMCI_PORT = 1490;
68 | private static validateRequired(cmciProfile: IProfile) {
69 | this.checkValueFound(cmciProfile.host, "cics-host");
70 | this.checkValueFound(cmciProfile.user, "cics-user");
71 | this.checkValueFound(cmciProfile.password, "cics-password");
72 |
73 | // Now implement the default value for the port
74 | if (cmciProfile.port === undefined) {
75 | cmciProfile.port = CmciConfig.DEFAULT_CMCI_PORT;
76 | cmciProfile.P = CmciConfig.DEFAULT_CMCI_PORT;
77 | }
78 |
79 | // Note, default values for protocol and rejectUnauthorized are implemented
80 | // in the underlying cics-plugin.
81 | }
82 |
83 | private static checkValueFound(value: string, parm: string) {
84 | if (value === undefined) {
85 | throw new Error("Partial cics plug-in configuration encountered, --" + parm + " is not set.");
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/src/api/BundlePush/SshConfig.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | "use strict";
13 |
14 | import { IHandlerParameters, IProfile } from "@zowe/imperative";
15 |
16 |
17 | /**
18 | * Class to implement SSH configuration.
19 | *
20 | * @export
21 | * @class SshConfig
22 | */
23 | export class SshConfig {
24 |
25 | /**
26 | * Merge command line overrides together with the optional sshProfile into a
27 | * composite whole
28 | */
29 | public static mergeProfile(sshProfile: IProfile, params: IHandlerParameters) {
30 |
31 | if (params.arguments.sh !== undefined) {
32 | sshProfile.host = params.arguments.sh;
33 | sshProfile.H = params.arguments.sh;
34 | }
35 |
36 | if (params.arguments.sp !== undefined) {
37 | sshProfile.port = params.arguments.sp;
38 | sshProfile.P = params.arguments.sp;
39 | }
40 |
41 | if (params.arguments.su !== undefined) {
42 | sshProfile.user = params.arguments.su;
43 | sshProfile.u = params.arguments.su;
44 | }
45 |
46 | if (params.arguments.spw !== undefined) {
47 | sshProfile.password = params.arguments.spw;
48 | sshProfile.pass = params.arguments.spw;
49 | sshProfile.pw = params.arguments.spw;
50 | }
51 |
52 | if (params.arguments.spk !== undefined) {
53 | sshProfile.privateKey = params.arguments.spk;
54 | sshProfile.key = params.arguments.spk;
55 | sshProfile.pk = params.arguments.spk;
56 | }
57 |
58 | if (params.arguments.skp !== undefined) {
59 | sshProfile.keyPassphrase = params.arguments.skp;
60 | sshProfile.passphrase = params.arguments.skp;
61 | sshProfile.kp = params.arguments.skp;
62 | }
63 |
64 | if (params.arguments.sht !== undefined) {
65 | sshProfile.handshakeTimeout = params.arguments.sht;
66 | sshProfile.timeout = params.arguments.sht;
67 | sshProfile.to = params.arguments.sht;
68 | }
69 |
70 | SshConfig.validateRequired(sshProfile);
71 | }
72 |
73 | private static DEFAULT_SSH_PORT = 22;
74 | private static validateRequired(sshProfile: IProfile) {
75 | this.checkValueFound(sshProfile.host, "ssh-host");
76 | this.checkValueFound(sshProfile.user, "ssh-user");
77 |
78 | // Now implement the default value for the port
79 | if (sshProfile.port === undefined) {
80 | sshProfile.port = SshConfig.DEFAULT_SSH_PORT;
81 | sshProfile.P = SshConfig.DEFAULT_SSH_PORT;
82 | }
83 | }
84 |
85 | private static checkValueFound(value: string, parm: string) {
86 | if (value === undefined) {
87 | throw new Error("Required parameter --" + parm + " is not set.");
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/api/BundlePush/SubtaskWithStatus.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 | import { ITaskWithStatus, TaskProgress, TaskStage, ImperativeExpect, ImperativeError, Logger} from "@zowe/imperative";
12 |
13 |
14 | export class SubtaskWithStatus {
15 |
16 | private parent: ITaskWithStatus;
17 | private ticks: number;
18 | private percentCompleteInternal: number;
19 |
20 | constructor(parent: ITaskWithStatus, ticks: number) {
21 | this.parent = parent;
22 | this.ticks = ticks;
23 | this.percentCompleteInternal = 0;
24 | if (this.ticks < 0 || this.ticks > TaskProgress.ONE_HUNDRED_PERCENT) {
25 | throw new ImperativeError({msg: "Ticks must be between 0 and 100"});
26 | }
27 | }
28 |
29 | public set statusMessage(statusMessage: string) {
30 | this.parent.statusMessage = statusMessage;
31 | }
32 |
33 | public get statusMessage() {
34 | return this.parent.statusMessage;
35 | }
36 |
37 | public set stageName(stageName: TaskStage) {
38 | if (stageName !== TaskStage.COMPLETE && stageName !== TaskStage.NOT_STARTED) {
39 | this.parent.stageName = stageName;
40 | }
41 | }
42 |
43 | public get stageName() {
44 | return this.parent.stageName;
45 | }
46 |
47 | public set percentComplete(percentComplete: number) {
48 | const delta = percentComplete - this.percentCompleteInternal;
49 | this.percentCompleteInternal = percentComplete;
50 | this.parent.percentComplete = this.parent.percentComplete + delta * (this.ticks / TaskProgress.ONE_HUNDRED_PERCENT);
51 | }
52 |
53 | public get percentComplete() {
54 | return this.percentCompleteInternal;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/api/BundlePush/ZosmfConfig.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | "use strict";
13 |
14 | import { IHandlerParameters, IProfile } from "@zowe/imperative";
15 |
16 |
17 | /**
18 | * Class to implement zosMF configuration.
19 | *
20 | * @export
21 | * @class ZosmfConfig
22 | */
23 | export class ZosmfConfig {
24 |
25 | /**
26 | * Merge command line overrides together with the optional zosmfProfile into a
27 | * composite whole
28 | */
29 | public static mergeProfile(zosmfProfile: IProfile, params: IHandlerParameters) {
30 |
31 | if (params.arguments.zh !== undefined) {
32 | zosmfProfile.host = params.arguments.zh;
33 | zosmfProfile.H = params.arguments.zh;
34 | }
35 |
36 | if (params.arguments.zp !== undefined) {
37 | zosmfProfile.port = params.arguments.zp;
38 | zosmfProfile.P = params.arguments.zp;
39 | }
40 |
41 | if (params.arguments.zu !== undefined) {
42 | zosmfProfile.user = params.arguments.zu;
43 | zosmfProfile.u = params.arguments.zu;
44 | }
45 |
46 | if (params.arguments.zpw !== undefined) {
47 | zosmfProfile.password = params.arguments.zpw;
48 | zosmfProfile.pass = params.arguments.zpw;
49 | zosmfProfile.pw = params.arguments.zpw;
50 | }
51 |
52 | if (params.arguments.zru !== undefined) {
53 | zosmfProfile.rejectUnauthorized = params.arguments.zru;
54 | zosmfProfile.ru = params.arguments.zru;
55 | }
56 |
57 | if (params.arguments.zbp !== undefined) {
58 | zosmfProfile.basePath = params.arguments.zbp;
59 | zosmfProfile.bp = params.arguments.zbp;
60 | }
61 |
62 | ZosmfConfig.validateRequired(zosmfProfile);
63 | }
64 |
65 | private static DEFAULT_ZOSMF_PORT = 443;
66 | private static validateRequired(zosmfProfile: IProfile) {
67 | this.checkValueFound(zosmfProfile.host, "zosmf-host");
68 | this.checkValueFound(zosmfProfile.user, "zosmf-user");
69 | this.checkValueFound(zosmfProfile.password, "zosmf-password");
70 |
71 | // Now implement the default value for the port
72 | if (zosmfProfile.port === undefined) {
73 | zosmfProfile.port = ZosmfConfig.DEFAULT_ZOSMF_PORT;
74 | zosmfProfile.P = ZosmfConfig.DEFAULT_ZOSMF_PORT;
75 | }
76 |
77 | // And for reject-unauthorized
78 | if (zosmfProfile.rejectUnauthorized === undefined) {
79 | zosmfProfile.rejectUnauthorized = true;
80 | zosmfProfile.ru = true;
81 | }
82 | }
83 |
84 | private static checkValueFound(value: string, parm: string) {
85 | if (value === undefined) {
86 | throw new Error("Required parameter --" + parm + " is not set.");
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/src/cli/deploy/Deploy.definition.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandDefinition } from "@zowe/imperative";
13 | import { DeployBundleDefinition } from "./bundle/DeployBundle.definition";
14 | /**
15 | * Imperative command to "deploy" a Bundle, etc.
16 | *
17 | */
18 | const DeployDefinition: ICommandDefinition = {
19 | name: "deploy",
20 | aliases: ["d", "dep"],
21 | summary: "Deploy a CICS bundle to one or more CICS regions within a CICSplex",
22 | description: "Deploy a CICS bundle from zFS to one or more CICS regions within a CICSplex. " +
23 | "A BUNDLE resource is installed, ENABLED and made AVAILABLE in the " +
24 | "target scope of the CICSplex.",
25 | type: "group",
26 | children: [DeployBundleDefinition],
27 | };
28 |
29 | export = DeployDefinition;
30 |
--------------------------------------------------------------------------------
/src/cli/deploy/bundle/DeployBundle.definition.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandDefinition } from "@zowe/imperative";
13 | import { NameOption } from "../../shared/Name.option";
14 | import { BundledirOption } from "./options/Bundledir.option";
15 | import { CicsplexOption } from "../../shared/Cicsplex.option";
16 | import { ScopeOption } from "../../shared/Scope.option";
17 | import { CsdgroupOption } from "../../shared/Csdgroup.option";
18 | import { ResgroupOption } from "../../shared/Resgroup.option";
19 | import { CicshlqOption } from "../../shared/Cicshlq.option";
20 | import { CpsmhlqOption } from "../../shared/Cpsmhlq.option";
21 | import { JobcardOption } from "../../shared/Jobcard.option";
22 | import { TimeoutOption } from "../../shared/Timeout.option";
23 | import { TargetStateOption } from "./options/TargetState.option";
24 | import { VerboseOption } from "../../shared/Verbose.option";
25 | import { DescriptionOption } from "./options/Description.option";
26 | import { ZosmfOptions } from "../../shared/ZosmfOptions";
27 |
28 |
29 | /**
30 | * Imperative command for the Bundle sub-option of Deploy.
31 | *
32 | */
33 | export const DeployBundleDefinition: ICommandDefinition = {
34 | name: "bundle",
35 | aliases: ["b", "bun", "bund"],
36 | summary: "Deploy a CICS bundle",
37 | description: "Deploy a CICS bundle from zFS to one or more CICS regions within a CICSplex. " +
38 | "The DFHDPLOY utility is used to install and make available a BUNDLE resource " +
39 | "in the target group of CICS regions.",
40 | type: "command",
41 | handler: __dirname + "/DeployBundle.handler",
42 | options: [ NameOption, BundledirOption, CicsplexOption, ScopeOption, CsdgroupOption , ResgroupOption,
43 | CicshlqOption, CpsmhlqOption, DescriptionOption, JobcardOption, TimeoutOption, TargetStateOption, VerboseOption]
44 | .concat(ZosmfOptions.CICS_DEPLOY_ZOSMF_CONNECTION_OPTIONS),
45 | profile: { optional: ["cics-deploy", "zosmf"] },
46 | examples: [
47 | {
48 | description: "Deploy a CICS bundle with a specific name and location to a default set of target regions",
49 | options: `--name EXAMPLE --bundle-directory /u/example/bundleDir`
50 | },
51 | {
52 | description: "Deploy a CICS bundle, but declare a timeout if the processing takes too long",
53 | options: `--name EXAMPLE --bundle-directory /u/example/bundleDir --timeout 60`
54 | },
55 | {
56 | description: "Deploy a CICS bundle to a specific target environment by using specific zosmf & cics-deploy profiles",
57 | options: `--name EXAMPLE --bundle-directory /u/example/bundleDir --cicsplex TESTPLEX --scope SCOPE --res-group BUNDGRP ` +
58 | `--cics-hlq CICSTS55.CICS720 --cpsm-hlq CICSTS55.CPSM550 --zosmf-profile testplex --cics-deploy-profile devcics`
59 | }
60 | ]
61 | };
62 |
--------------------------------------------------------------------------------
/src/cli/deploy/bundle/DeployBundle.handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandHandler, IHandlerParameters } from "@zowe/imperative";
13 | import { BundleParentHandler } from "../../shared/BundleParent.handler";
14 | import { BundleDeployer } from "../../../api/BundleDeploy/BundleDeployer";
15 |
16 | /**
17 | * Command handler for deploying a bundle
18 | * @export
19 | * @class DeployBundleHandler
20 | * @implements {ICommandHandler}
21 | */
22 | export default class DeployBundleHandler extends BundleParentHandler implements ICommandHandler {
23 |
24 | public actionName = "deployment";
25 |
26 | /**
27 | * Perform the DEPLOY BUNDLE action.
28 | *
29 | * @param {IHandlerParameters} params
30 | * @returns {Promise}
31 | * @throws ImperativeError
32 | * @memberof DeployBundleHandler
33 | */
34 | public async performAction(params: IHandlerParameters): Promise {
35 |
36 | const bdep = new BundleDeployer(params);
37 | const msg = await bdep.deployBundle();
38 | return msg;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/cli/deploy/bundle/options/Bundledir.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 255;
15 |
16 | /**
17 | * Imperative option for the "bundledir" parameter
18 | *
19 | */
20 | export const BundledirOption: ICommandOptionDefinition = {
21 | name: "bundle-directory",
22 | aliases: ["bd", "bundledir", "bundle-dir"],
23 | type: "string",
24 | required: true,
25 | stringLengthRange: [1, MAX_LENGTH],
26 | group: "cics-deploy Options",
27 | description: "Required. Specifies the location of the CICS bundle (up to 255 characters) on zFS."
28 | };
29 |
30 |
--------------------------------------------------------------------------------
/src/cli/deploy/bundle/options/Description.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 58;
15 |
16 | /**
17 | * Imperative option for the "description" parameter
18 | *
19 | */
20 | export const DescriptionOption: ICommandOptionDefinition = {
21 | name: "description",
22 | aliases: ["desc"],
23 | type: "string",
24 | required: false,
25 | stringLengthRange: [1, MAX_LENGTH],
26 | group: "cics-deploy Options",
27 | description: "An optional value that specifies a description of the bundle definition (up to 58 characters)."
28 | };
29 |
30 |
--------------------------------------------------------------------------------
/src/cli/deploy/bundle/options/TargetState.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "targetstate" parameter
16 | *
17 | */
18 | export const TargetStateOption: ICommandOptionDefinition = {
19 | name: "target-state",
20 | aliases: ["ts", "targetstate"],
21 | type: "string",
22 | required: false,
23 | defaultValue: "ENABLED",
24 | allowableValues: {
25 | values: ["DISABLED", "ENABLED", "AVAILABLE"],
26 | caseSensitive: false
27 | },
28 | group: "cics-deploy Options",
29 | description: "Specifies the target state for the deployed bundle."
30 | };
31 |
32 |
--------------------------------------------------------------------------------
/src/cli/generate/Generate.definition.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandDefinition } from "@zowe/imperative";
13 | import { GenerateBundleDefinition } from "./bundle/GenerateBundle.definition";
14 | /**
15 | * Imperative command to "generate" a Bundle, etc.
16 | *
17 | */
18 | const GenerateDefinition: ICommandDefinition = {
19 | name: "generate",
20 | aliases: ["g", "gen"],
21 | summary: "Transform the working directory into a CICS bundle",
22 | description: "Generate a CICS bundle and associated metadata files in the current working directory. " +
23 | "This allows the application in the current working directory to be deployed to CICS.",
24 | type: "group",
25 | children: [GenerateBundleDefinition]
26 | };
27 |
28 | export = GenerateDefinition;
29 |
--------------------------------------------------------------------------------
/src/cli/generate/bundle/GenerateBundle.definition.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandDefinition } from "@zowe/imperative";
13 | import { BundleidOption } from "./options/Bundleid.option";
14 | import { BundleversionOption } from "./options/Bundleversion.option";
15 | import { NodejsappOption } from "./options/Nodejsapp.option";
16 | import { StartscriptOption } from "./options/Startscript.option";
17 | import { PortOption } from "./options/Port.option";
18 | import { OverwriteOption } from "./options/Overwrite.option";
19 | import { MergeOption } from "./options/Merge.option";
20 |
21 | /**
22 | * Imperative command for the Bundle sub-option of Generate.
23 | *
24 | */
25 | export const GenerateBundleDefinition: ICommandDefinition = {
26 | name: "bundle",
27 | aliases: ["b", "bun", "bund"],
28 | summary: "Generate a CICS bundle",
29 | description: "Generate a CICS bundle in the working directory. " +
30 | "The associated data is constructed from a combination of the " +
31 | "command-line options and the contents of package.json. If package.json exists, " +
32 | "no options are required. If package.json does not exist, both --start-script and --nodejsapp are required.",
33 | type: "command",
34 | handler: __dirname + "/GenerateBundle.handler",
35 | options: [ BundleidOption, BundleversionOption, NodejsappOption, StartscriptOption, PortOption,
36 | OverwriteOption, MergeOption ],
37 | examples: [
38 | {
39 | description: "Generate a CICS bundle in the working directory, taking information from package.json",
40 | options: ``
41 | },
42 | {
43 | description: "Generate a CICS bundle in the working directory, based on package.json but using a bundle ID of \"mybundle\"",
44 | options: `--bundle-id mybundle`
45 | },
46 | {
47 | description: "Generate a CICS bundle in the working directory in which a package.json does not exist",
48 | options: `--bundle-id mybundle --nodejsapp myapp --start-script server.js`
49 | }
50 | ]
51 | };
52 |
--------------------------------------------------------------------------------
/src/cli/generate/bundle/GenerateBundle.handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { Logger, ICommandHandler, IHandlerParameters, ICommandArguments, ImperativeError } from "@zowe/imperative";
13 | import { AutoBundler } from "../../../api/BundleContent/AutoBundler";
14 | import { BundleParentHandler } from "../../shared/BundleParent.handler";
15 |
16 | /**
17 | * Command handler for generating a bundle
18 | * @export
19 | * @class GenerateBundleHandler
20 | * @implements {ICommandHandler}
21 | */
22 | export default class GenerateBundleHandler extends BundleParentHandler implements ICommandHandler {
23 |
24 | public actionName = "generation";
25 |
26 | /**
27 | * Perform the GENERATE BUNDLE action.
28 | *
29 | * @param {IHandlerParameters} params
30 | * @returns {Promise}
31 | * @throws ImperativeError
32 | * @memberof DeployBundleHandler
33 | */
34 | public async performAction(params: IHandlerParameters): Promise {
35 | const autobundler = new AutoBundler(process.cwd(), params);
36 | if (params.arguments.nosave !== "true") {
37 | autobundler.save();
38 | }
39 |
40 | // Create a response message
41 | let msg;
42 | if (autobundler.getBundle().getId() === undefined) {
43 | msg = "Anonymous CICS Bundle generated";
44 | }
45 | else {
46 | msg = 'CICS Bundle generated with bundleid "' + autobundler.getBundle().getId() + '"';
47 | }
48 | return msg;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/cli/generate/bundle/options/Bundleid.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "bundleid" parameter
16 | *
17 | */
18 | export const BundleidOption: ICommandOptionDefinition = {
19 | name: "bundle-id",
20 | aliases: ["b", "id", "bundleid"],
21 | type: "string",
22 | group: "cics-deploy Options",
23 | description: "The ID for the generated CICS bundle, up to 64 characters. If no value is " +
24 | "specified, a default value is created from the 'name' property " +
25 | "in the package.json file in the current working directory. " +
26 | "If the value is too long, it is truncated. If it contains characters " +
27 | "that are not supported by CICS, each character is replaced by an X."
28 | };
29 |
30 |
--------------------------------------------------------------------------------
/src/cli/generate/bundle/options/Bundleversion.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "bundleversion" parameter
16 | *
17 | */
18 | export const BundleversionOption: ICommandOptionDefinition = {
19 | name: "bundle-version",
20 | aliases: ["bv", "bundleversion"],
21 | type: "string",
22 | group: "cics-deploy Options",
23 | description: "The major.minor.micro version number for the generated CICS bundle. If no value is " +
24 | "specified, a default value of 1.0.0 is used."
25 | };
26 |
27 |
--------------------------------------------------------------------------------
/src/cli/generate/bundle/options/Merge.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "merge" parameter
16 | *
17 | */
18 | export const MergeOption: ICommandOptionDefinition = {
19 | name: "merge",
20 | aliases: ["me"],
21 | type: "boolean",
22 | defaultValue: false,
23 | required: false,
24 | implies: ["overwrite"],
25 | group: "cics-deploy Options",
26 | description: "Enable or disable the ability to merge new resources into an existing CICS bundle manifest. " +
27 | "Requires --overwrite to be specified."
28 | };
29 |
30 |
--------------------------------------------------------------------------------
/src/cli/generate/bundle/options/Nodejsapp.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "nodejsapp" parameter
16 | *
17 | */
18 | export const NodejsappOption: ICommandOptionDefinition = {
19 | name: "nodejsapp",
20 | aliases: ["n", "nj", "nja"],
21 | type: "string",
22 | group: "cics-deploy Options",
23 | description: "The ID of the generated CICS NODEJSAPP resource, up to 32 characters. If no value is " +
24 | "specified, a default value is created from the " +
25 | "'name' property in package.json, or the bundleid option if specified. " +
26 | "If the value is too long it is truncated. If it contains characters " +
27 | "that are not supported by CICS, each character is replaced by an X."
28 |
29 | };
30 |
31 |
--------------------------------------------------------------------------------
/src/cli/generate/bundle/options/Overwrite.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "overwrite" parameter
16 | *
17 | */
18 | export const OverwriteOption: ICommandOptionDefinition = {
19 | name: "overwrite",
20 | aliases: ["ow"],
21 | type: "boolean",
22 | defaultValue: false,
23 | required: false,
24 | group: "cics-deploy Options",
25 | description: "Enable or disable the ability to replace existing files within a CICS bundle."
26 | };
27 |
28 |
--------------------------------------------------------------------------------
/src/cli/generate/bundle/options/Port.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "bundleid" parameter
16 | *
17 | */
18 | export const PortOption: ICommandOptionDefinition = {
19 | name: "port",
20 | aliases: ["p"],
21 | type: "string",
22 | group: "cics-deploy Options",
23 | description: "The TCP/IP port number the Node.js application should use for clients to connect to. " +
24 | "If a value is specified, it is set within the generated NODEJSAPP's profile. " +
25 | "The Node.js application can reference this value by accessing the PORT environment variable, " +
26 | "for example using process.env.PORT. " +
27 | "Additional environment variables can be set by manually editing the profile."
28 | };
29 |
--------------------------------------------------------------------------------
/src/cli/generate/bundle/options/Startscript.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "startscript" parameter
16 | *
17 | */
18 | export const StartscriptOption: ICommandOptionDefinition = {
19 | name: "start-script",
20 | aliases: ["s", "ss", "startscript"],
21 | type: "string",
22 | group: "cics-deploy Options",
23 | description: "Up to 255 character path to the Node.js start script that runs when " +
24 | "the associated bundle is enabled in CICS. If a value is not " +
25 | "specified, a default value is created from either the 'scripts.start' property " +
26 | "of the package.json file in the current working directory, or from the 'main' property."
27 | };
28 |
29 |
--------------------------------------------------------------------------------
/src/cli/push/Push.definition.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandDefinition } from "@zowe/imperative";
13 | import { PushBundleDefinition } from "./bundle/PushBundle.definition";
14 | /**
15 | * Imperative command to "push" a Bundle, etc.
16 | *
17 | */
18 | const PushDefinition: ICommandDefinition = {
19 | name: "push",
20 | aliases: ["p"],
21 | summary: "Push a CICS bundle from the working directory to one or more CICS regions within a CICSplex",
22 | description: "Push combines several actions for deploying a bundle to CICS into a single command. It uploads the " +
23 | "bundle to z/OS, optionally runs an 'npm install' command on the remote system, then uses " +
24 | "DFHDPLOY to install and enable the bundle in a target CICS environment.",
25 | type: "group",
26 | children: [PushBundleDefinition]
27 | };
28 |
29 | export = PushDefinition;
30 |
--------------------------------------------------------------------------------
/src/cli/push/bundle/PushBundle.definition.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandDefinition } from "@zowe/imperative";
13 | import { NameOption } from "../../shared/Name.option";
14 | import { TargetdirOption } from "./options/Targetdir.option";
15 | import { CicsplexOption } from "../../shared/Cicsplex.option";
16 | import { ScopeOption } from "../../shared/Scope.option";
17 | import { CsdgroupOption } from "../../shared/Csdgroup.option";
18 | import { ResgroupOption } from "../../shared/Resgroup.option";
19 | import { CicshlqOption } from "../../shared/Cicshlq.option";
20 | import { CpsmhlqOption } from "../../shared/Cpsmhlq.option";
21 | import { JobcardOption } from "../../shared/Jobcard.option";
22 | import { TimeoutOption } from "../../shared/Timeout.option";
23 | import { TargetStateOption } from "../../deploy/bundle/options/TargetState.option";
24 | import { DescriptionOption } from "../../deploy/bundle/options/Description.option";
25 | import { VerboseOption } from "../../shared/Verbose.option";
26 | import { OverwriteOption } from "./options/Overwrite.option";
27 | import { ZosmfOptions } from "../../shared/ZosmfOptions";
28 | import { SshOptions } from "./options/SshOptions";
29 | import { CmciOptions } from "./options/CmciOptions";
30 |
31 | /**
32 | * Imperative command for the Bundle sub-option of Push.
33 | *
34 | */
35 | export const PushBundleDefinition: ICommandDefinition = {
36 | name: "bundle",
37 | aliases: ["b", "bun", "bund"],
38 | summary: "Push a CICS bundle",
39 | description: "Push a CICS bundle from the working directory to a target CICSplex.",
40 | type: "command",
41 | handler: __dirname + "/PushBundle.handler",
42 | options: [ NameOption, TargetdirOption, CicsplexOption, ScopeOption, CsdgroupOption , ResgroupOption,
43 | CicshlqOption, CpsmhlqOption, DescriptionOption, JobcardOption, TimeoutOption, TargetStateOption,
44 | VerboseOption, OverwriteOption ]
45 | .concat(ZosmfOptions.CICS_DEPLOY_ZOSMF_CONNECTION_OPTIONS)
46 | .concat(SshOptions.CICS_DEPLOY_SSH_CONNECTION_OPTIONS)
47 | .concat(CmciOptions.CICS_DEPLOY_CMCI_CONNECTION_OPTIONS),
48 | profile: { optional: ["cics-deploy", "zosmf", "ssh", "cics"] },
49 | examples: [
50 | {
51 | description: "Push a CICS bundle from the working directory by using default cics-deploy, cics, ssh and zosmf profiles",
52 | options: `--name EXAMPLE --target-directory /u/example/bundles`
53 | },
54 | {
55 | description: "Push a CICS bundle from the working directory by using specific zosmf, ssh & cics-deploy profiles",
56 | options: `--name EXAMPLE --target-directory /u/example/bundles --zosmf-profile testplex --cics-deploy-profile devcics --ssh-profile ssh`
57 | },
58 | {
59 | description: "Push a CICS bundle from the working directory replacing any bundle of the same name that is already deployed",
60 | options: `--name EXAMPLE --target-directory /u/example/bundles --overwrite`
61 | }
62 | ]
63 | };
64 |
--------------------------------------------------------------------------------
/src/cli/push/bundle/PushBundle.handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandHandler, IHandlerParameters } from "@zowe/imperative";
13 | import { BundleParentHandler } from "../../shared/BundleParent.handler";
14 | import { BundlePusher } from "../../../api/BundlePush/BundlePusher";
15 |
16 | /**
17 | * Command handler for pushing a bundle
18 | * @export
19 | * @class GenerateBundleHandler
20 | * @implements {ICommandHandler}
21 | */
22 | export default class PushBundleHandler extends BundleParentHandler implements ICommandHandler {
23 |
24 | public actionName = "pushing";
25 |
26 | /**
27 | * Perform the PUSH BUNDLE action.
28 | *
29 | * @param {IHandlerParameters} params
30 | * @returns {Promise}
31 | * @throws ImperativeError
32 | * @memberof DeployBundleHandler
33 | */
34 | public async performAction(params: IHandlerParameters): Promise {
35 |
36 | const pusher = await new BundlePusher(params, process.cwd());
37 | return pusher.performPush();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/cli/push/bundle/options/CmciOptions.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * scmci command line options, derived from zowe-cics equivalents
16 | */
17 | export class CmciOptions {
18 | public static GROUP = "CICS Connection Options";
19 |
20 | public static CICS_DEPLOY_CMCI_OPTION_HOST: ICommandOptionDefinition = {
21 | name: "cics-host",
22 | aliases: ["ch"],
23 | description: "The CMCI server host name.",
24 | type: "string",
25 | required: false,
26 | group: CmciOptions.GROUP
27 | };
28 |
29 | public static CICS_DEPLOY_CMCI_OPTION_PORT: ICommandOptionDefinition = {
30 | name: "cics-port",
31 | aliases: ["cpo"],
32 | description: "The CICS server port.",
33 | type: "number",
34 | required: false,
35 | group: CmciOptions.GROUP
36 | };
37 |
38 | public static CICS_DEPLOY_CMCI_OPTION_USER: ICommandOptionDefinition = {
39 | name: "cics-user",
40 | aliases: ["cu"],
41 | description: "Mainframe (CICS) user name, which can be the same as your TSO login.",
42 | type: "string",
43 | required: false,
44 | group: CmciOptions.GROUP
45 | };
46 |
47 | public static CICS_DEPLOY_CMCI_OPTION_PASSWORD: ICommandOptionDefinition = {
48 | name: "cics-password",
49 | aliases: ["cpw"],
50 | description: "Mainframe (CICS) password, which can be the same as your TSO password.",
51 | type: "string",
52 | required: false,
53 | group: CmciOptions.GROUP
54 | };
55 |
56 | public static CICS_DEPLOY_CMCI_OPTION_REJECT_UNAUTHORIZED: ICommandOptionDefinition = {
57 | name: "cics-reject-unauthorized",
58 | aliases: ["cru"],
59 | description: "Reject self-signed certificates.",
60 | type: "boolean",
61 | required: false,
62 | group: CmciOptions.GROUP
63 | };
64 |
65 | public static CICS_DEPLOY_CMCI_OPTION_PROTOCOL: ICommandOptionDefinition = {
66 | name: "cics-protocol",
67 | aliases: ["cpr"],
68 | description: "Specifies CMCI protocol (http or https).",
69 | type: "string",
70 | required: false,
71 | allowableValues: {values: ["http", "https"], caseSensitive: false},
72 | group: CmciOptions.GROUP
73 | };
74 |
75 |
76 | /**
77 | * Options related to connecting to CMCI
78 | */
79 | public static CICS_DEPLOY_CMCI_CONNECTION_OPTIONS: ICommandOptionDefinition[] = [
80 | CmciOptions.CICS_DEPLOY_CMCI_OPTION_HOST,
81 | CmciOptions.CICS_DEPLOY_CMCI_OPTION_PORT,
82 | CmciOptions.CICS_DEPLOY_CMCI_OPTION_USER,
83 | CmciOptions.CICS_DEPLOY_CMCI_OPTION_PASSWORD,
84 | CmciOptions.CICS_DEPLOY_CMCI_OPTION_REJECT_UNAUTHORIZED,
85 | CmciOptions.CICS_DEPLOY_CMCI_OPTION_PROTOCOL
86 | ];
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/src/cli/push/bundle/options/Overwrite.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "overwrite" parameter
16 | *
17 | */
18 | export const OverwriteOption: ICommandOptionDefinition = {
19 | name: "overwrite",
20 | aliases: ["ow"],
21 | type: "boolean",
22 | defaultValue: false,
23 | required: false,
24 | group: "cics-deploy Options",
25 | description: "Enable or disable the ability to replace an existing bundle directory or bundle on the remote system."
26 | };
27 |
28 |
--------------------------------------------------------------------------------
/src/cli/push/bundle/options/Targetdir.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 255;
15 |
16 | /**
17 | * Imperative option for the "targetdir" parameter
18 | *
19 | */
20 | export const TargetdirOption: ICommandOptionDefinition = {
21 | name: "target-directory",
22 | aliases: ["td", "targetdir", "target-dir"],
23 | type: "string",
24 | required: true,
25 | stringLengthRange: [1, MAX_LENGTH],
26 | group: "cics-deploy Options",
27 | description: "Specifies the target zFS location in which the CICS bundle is to be created (up to 255 characters). " +
28 | "This parameter defaults to the value specified in the cics-deploy profile."
29 | };
30 |
31 |
--------------------------------------------------------------------------------
/src/cli/shared/Cicshlq.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 35;
15 |
16 | /**
17 | * Imperative option for the "cicshlq" parameter
18 | *
19 | */
20 | export const CicshlqOption: ICommandOptionDefinition = {
21 | name: "cics-hlq",
22 | aliases: ["cq", "cicshlq"],
23 | type: "string",
24 | required: false,
25 | stringLengthRange: [1, MAX_LENGTH],
26 | group: "cics-deploy Options",
27 | description: "Specifies the high-level qualifier (up to 35 characters) at which the CICS " +
28 | "datasets can be found in the target environment. " +
29 | "This parameter defaults to the value specified in the cics-deploy profile."
30 | };
31 |
--------------------------------------------------------------------------------
/src/cli/shared/Cicsplex.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 8;
15 |
16 | /**
17 | * Imperative option for the "cicsplex" parameter
18 | *
19 | */
20 | export const CicsplexOption: ICommandOptionDefinition = {
21 | name: "cicsplex",
22 | aliases: ["cp"],
23 | type: "string",
24 | stringLengthRange: [1, MAX_LENGTH],
25 | group: "cics-deploy Options",
26 | description: "Specifies the CICSplex (up to 8 characters) to target. " +
27 | "This parameter defaults to the value specified in the cics-deploy profile."
28 | };
29 |
--------------------------------------------------------------------------------
/src/cli/shared/Cpsmhlq.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 35;
15 |
16 | /**
17 | * Imperative option for the "cpsmhlq" parameter
18 | *
19 | */
20 | export const CpsmhlqOption: ICommandOptionDefinition = {
21 | name: "cpsm-hlq",
22 | aliases: ["cph", "cpsmhlq"],
23 | type: "string",
24 | required: false,
25 | stringLengthRange: [1, MAX_LENGTH],
26 | group: "cics-deploy Options",
27 | description: "Specifies the high-level qualifier (up to 35 characters) at which the CPSM " +
28 | "datasets can be found in the target environment. " +
29 | "This parameter defaults to the value specified in the cics-deploy profile."
30 | };
31 |
--------------------------------------------------------------------------------
/src/cli/shared/Csdgroup.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 8;
15 |
16 | /**
17 | * Imperative option for the "csdgroup" parameter
18 | *
19 | */
20 | export const CsdgroupOption: ICommandOptionDefinition = {
21 | name: "csd-group",
22 | aliases: ["cg", "csdgroup"],
23 | type: "string",
24 | stringLengthRange: [1, MAX_LENGTH],
25 | group: "cics-deploy Options",
26 | description: "Specifies the CSD group (up to 8 characters) for the bundle resource. If a bundle is " +
27 | "deployed, a definition is added to this group. If a bundle is undeployed, then the " +
28 | "definition is removed from this group. The definition is added or removed from the CSD of each system " +
29 | "that is specified by the --scope option. The --csd-group and --res-group options are " +
30 | "mutually exclusive."
31 | };
32 |
33 |
--------------------------------------------------------------------------------
/src/cli/shared/Jobcard.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "jobcard" parameter
16 | *
17 | */
18 | export const JobcardOption: ICommandOptionDefinition = {
19 | name: "job-card",
20 | aliases: ["jc", "jobcard"],
21 | type: "string",
22 | description: "Specifies the job card to use with any generated DFHDPLOY JCL. Use this parameter " +
23 | "if you need to tailor the job card and you have not set the --cics-deploy-profile " +
24 | "option. You can separate multiple lines of the jobcard with \\n.",
25 | defaultValue: "//DFHDPLOY JOB DFHDPLOY,CLASS=A,MSGCLASS=X,TIME=NOLIMIT",
26 | group: "cics-deploy Options",
27 | required: false
28 | };
29 |
30 |
--------------------------------------------------------------------------------
/src/cli/shared/Name.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 8;
15 |
16 | /**
17 | * Imperative option for the "name" parameter
18 | *
19 | */
20 | export const NameOption: ICommandOptionDefinition = {
21 | name: "name",
22 | aliases: ["n"],
23 | type: "string",
24 | required: true,
25 | stringLengthRange: [1, MAX_LENGTH],
26 | group: "cics-deploy Options",
27 | description: "Required. Specifies the name of the CICS BUNDLE resource (up to 8 characters) to deploy or undeploy."
28 | };
29 |
30 |
--------------------------------------------------------------------------------
/src/cli/shared/Resgroup.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 8;
15 |
16 | /**
17 | * Imperative option for the "resgroup" parameter
18 | *
19 | */
20 | export const ResgroupOption: ICommandOptionDefinition = {
21 | name: "res-group",
22 | aliases: ["rg", "resgroup"],
23 | type: "string",
24 | stringLengthRange: [1, MAX_LENGTH],
25 | conflictsWith: [ "csdgroup" ],
26 | group: "cics-deploy Options",
27 | description: "Specifies the BAS resource group (up to 8 characters) for the bundle resource. If a bundle is " +
28 | "deployed, a resource is defined in the BAS data repository. If a bundle is undeployed, the " +
29 | "definition is removed. The --csd-group and --res-group options are " +
30 | "mutually exclusive."
31 | };
32 |
33 |
--------------------------------------------------------------------------------
/src/cli/shared/Scope.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_LENGTH = 8;
15 |
16 | /**
17 | * Imperative option for the "scope" parameter
18 | *
19 | */
20 | export const ScopeOption: ICommandOptionDefinition = {
21 | name: "scope",
22 | aliases: ["sc"],
23 | type: "string",
24 | stringLengthRange: [1, MAX_LENGTH],
25 | group: "cics-deploy Options",
26 | description: "Specifies the name of the CICS System, or CICS System Group " +
27 | "(up to 8 characters) to target. " +
28 | "This parameter defaults to the value specified in the cics-deploy profile."
29 | };
30 |
--------------------------------------------------------------------------------
/src/cli/shared/Timeout.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | const MAX_VALUE = 1800;
15 |
16 | /**
17 | * Imperative option for the "timeout" parameter
18 | *
19 | */
20 | export const TimeoutOption: ICommandOptionDefinition = {
21 | name: "timeout",
22 | aliases: ["to"],
23 | type: "number",
24 | numericValueRange: [1, MAX_VALUE],
25 | group: "cics-deploy Options",
26 | description: "An optional numerical value that specifies the maximum amount of time in seconds " +
27 | "(1 - " + MAX_VALUE + " inclusive) for the DFHDPLOY command to complete. If not specified " +
28 | "DFHDPLOY will use its default of 300 seconds."
29 | };
30 |
--------------------------------------------------------------------------------
/src/cli/shared/Verbose.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "verbose" parameter
16 | *
17 | */
18 | export const VerboseOption: ICommandOptionDefinition = {
19 | name: "verbose",
20 | aliases: ["v"],
21 | type: "boolean",
22 | defaultValue: false,
23 | required: false,
24 | group: "cics-deploy Options",
25 | description: "Enable or suppress verbose output from the DFHDPLOY tool."
26 | };
27 |
28 |
--------------------------------------------------------------------------------
/src/cli/shared/ZosmfOptions.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 | import { ZosmfSession } from "@zowe/cli";
14 |
15 | /**
16 | * zosMF command line options, derived from zowe-cli equivalents
17 | */
18 | export class ZosmfOptions {
19 |
20 | public static CICS_DEPLOY_ZOSMF_OPTION_HOST: ICommandOptionDefinition = {
21 | name: "zosmf-host",
22 | aliases: ["zh"],
23 | description: ZosmfSession.ZOSMF_OPTION_HOST.description,
24 | type: ZosmfSession.ZOSMF_OPTION_HOST.type,
25 | required: false,
26 | group: ZosmfSession.ZOSMF_CONNECTION_OPTION_GROUP
27 | };
28 |
29 | public static CICS_DEPLOY_ZOSMF_OPTION_PORT: ICommandOptionDefinition = {
30 | name: "zosmf-port",
31 | aliases: ["zp"],
32 | description: ZosmfSession.ZOSMF_OPTION_PORT.description,
33 | type: ZosmfSession.ZOSMF_OPTION_PORT.type,
34 | required: false,
35 | group: ZosmfSession.ZOSMF_CONNECTION_OPTION_GROUP
36 | };
37 |
38 | public static CICS_DEPLOY_ZOSMF_OPTION_USER: ICommandOptionDefinition = {
39 | name: "zosmf-user",
40 | aliases: ["zu"],
41 | description: ZosmfSession.ZOSMF_OPTION_USER.description,
42 | type: ZosmfSession.ZOSMF_OPTION_USER.type,
43 | required: false,
44 | group: ZosmfSession.ZOSMF_CONNECTION_OPTION_GROUP
45 | };
46 |
47 | public static CICS_DEPLOY_ZOSMF_OPTION_PASSWORD: ICommandOptionDefinition = {
48 | name: "zosmf-password",
49 | aliases: ["zpw"],
50 | description: ZosmfSession.ZOSMF_OPTION_PASSWORD.description,
51 | type: ZosmfSession.ZOSMF_OPTION_PASSWORD.type,
52 | required: false,
53 | group: ZosmfSession.ZOSMF_CONNECTION_OPTION_GROUP
54 | };
55 |
56 | public static CICS_DEPLOY_ZOSMF_OPTION_REJECT_UNAUTHORIZED: ICommandOptionDefinition = {
57 | name: "zosmf-reject-unauthorized",
58 | aliases: ["zru"],
59 | description: ZosmfSession.ZOSMF_OPTION_REJECT_UNAUTHORIZED.description,
60 | type: ZosmfSession.ZOSMF_OPTION_REJECT_UNAUTHORIZED.type,
61 | required: false,
62 | group: ZosmfSession.ZOSMF_CONNECTION_OPTION_GROUP
63 | };
64 |
65 | public static CICS_DEPLOY_ZOSMF_OPTION_BASE_PATH: ICommandOptionDefinition = {
66 | name: "zosmf-base-path",
67 | aliases: ["zbp"],
68 | description: ZosmfSession.ZOSMF_OPTION_BASE_PATH.description,
69 | type: ZosmfSession.ZOSMF_OPTION_BASE_PATH.type,
70 | required: false,
71 | group: ZosmfSession.ZOSMF_CONNECTION_OPTION_GROUP
72 | };
73 |
74 | /**
75 | * Options related to connecting to z/OSMF
76 | */
77 | public static CICS_DEPLOY_ZOSMF_CONNECTION_OPTIONS: ICommandOptionDefinition[] = [
78 | ZosmfOptions.CICS_DEPLOY_ZOSMF_OPTION_HOST,
79 | ZosmfOptions.CICS_DEPLOY_ZOSMF_OPTION_PORT,
80 | ZosmfOptions.CICS_DEPLOY_ZOSMF_OPTION_USER,
81 | ZosmfOptions.CICS_DEPLOY_ZOSMF_OPTION_PASSWORD,
82 | ZosmfOptions.CICS_DEPLOY_ZOSMF_OPTION_REJECT_UNAUTHORIZED,
83 | ZosmfOptions.CICS_DEPLOY_ZOSMF_OPTION_BASE_PATH
84 | ];
85 | }
86 |
--------------------------------------------------------------------------------
/src/cli/undeploy/Undeploy.definition.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandDefinition } from "@zowe/imperative";
13 | import { UndeployBundleDefinition } from "./bundle/UndeployBundle.definition";
14 | /**
15 | * Imperative command to "undeploy" a Bundle, etc.
16 | *
17 | */
18 | const UndeployDefinition: ICommandDefinition = {
19 | name: "undeploy",
20 | aliases: ["u", "udep"],
21 | summary: "Undeploy a CICS bundle from one or more CICS regions within a CICSplex",
22 | description: "Undeploy a CICS bundle from one or more CICS regions within a CICSplex. " +
23 | "A BUNDLE resource is made UNAVAILABLE, it is then DISABLED and " +
24 | "DISCARDED from the target scope with the CICSplex.",
25 | type: "group",
26 | children: [UndeployBundleDefinition]
27 | };
28 |
29 | export = UndeployDefinition;
30 |
--------------------------------------------------------------------------------
/src/cli/undeploy/bundle/UndeployBundle.definition.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandDefinition } from "@zowe/imperative";
13 | import { NameOption } from "../../shared/Name.option";
14 | import { CicsplexOption } from "../../shared/Cicsplex.option";
15 | import { ScopeOption } from "../../shared/Scope.option";
16 | import { CsdgroupOption } from "../../shared/Csdgroup.option";
17 | import { ResgroupOption } from "../../shared/Resgroup.option";
18 | import { CicshlqOption } from "../../shared/Cicshlq.option";
19 | import { CpsmhlqOption } from "../../shared/Cpsmhlq.option";
20 | import { JobcardOption } from "../../shared/Jobcard.option";
21 | import { TimeoutOption } from "../../shared/Timeout.option";
22 | import { TargetStateOption } from "./options/TargetState.option";
23 | import { VerboseOption } from "../../shared/Verbose.option";
24 | import { ZosmfOptions } from "../../shared/ZosmfOptions";
25 |
26 | /**
27 | * Imperative command for the Bundle sub-option of Deploy.
28 | *
29 | */
30 | export const UndeployBundleDefinition: ICommandDefinition = {
31 | name: "bundle",
32 | aliases: ["b", "bun", "bund"],
33 | summary: "Deploy a CICS bundle",
34 | description: "Undeploy a CICS bundle from one or more CICS regions within a CICSplex. " +
35 | "The DFHDPLOY utility is used to undeploy and remove a BUNDLE resource " +
36 | "from the target group of CICS regions.",
37 | type: "command",
38 | handler: __dirname + "/UndeployBundle.handler",
39 | options: [ NameOption, CicsplexOption, ScopeOption, CsdgroupOption , ResgroupOption,
40 | CicshlqOption, CpsmhlqOption, JobcardOption, TimeoutOption, TargetStateOption,
41 | VerboseOption]
42 | .concat(ZosmfOptions.CICS_DEPLOY_ZOSMF_CONNECTION_OPTIONS),
43 | profile: { optional: ["cics-deploy", "zosmf"] },
44 | examples: [
45 | {
46 | description: "Undeploy a CICS bundle by using the default cics-deploy and zosmf profiles",
47 | options: `--name EXAMPLE`
48 | },
49 | {
50 | description: "Undeploy a CICS bundle, and declare a timeout if the processing takes too long",
51 | options: `--name EXAMPLE --timeout 60`
52 | },
53 | {
54 | description: "Undeploy a CICS bundle from a specific target environment by using specific zosmf and cics-deploy profiles",
55 | options: `--name EXAMPLE --cics-plex TESTPLEX --scope SCOPE --res-group BUNDGRP ` +
56 | `--cics-hlq CICSTS55.CICS720 --cpsm-hlq CICSTS55.CPSM550 --zosmf-profile testplex --cics-deploy-profile devcics`
57 | }
58 | ]
59 | };
60 |
--------------------------------------------------------------------------------
/src/cli/undeploy/bundle/UndeployBundle.handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { Logger, ICommandHandler, IHandlerParameters, ICommandArguments, ImperativeError } from "@zowe/imperative";
13 | import { BundleParentHandler } from "../../shared/BundleParent.handler";
14 | import { BundleDeployer } from "../../../api/BundleDeploy/BundleDeployer";
15 |
16 | /**
17 | * Command handler for undeploying a bundle
18 | * @export
19 | * @class UndeployBundleHandler
20 | * @implements {ICommandHandler}
21 | */
22 | export default class UndeployBundleHandler extends BundleParentHandler implements ICommandHandler {
23 |
24 | public actionName = "undeployment";
25 |
26 | /**
27 | * Perform the UNDEPLOY BUNDLE action.
28 | *
29 | * @param {IHandlerParameters} params
30 | * @returns {Promise}
31 | * @throws ImperativeError
32 | * @memberof UndeployBundleHandler
33 | */
34 | public async performAction(params: IHandlerParameters): Promise {
35 | const bdep = new BundleDeployer(params);
36 | const msg = await bdep.undeployBundle();
37 | return msg;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/cli/undeploy/bundle/options/TargetState.option.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 |
12 | import { ICommandOptionDefinition } from "@zowe/imperative";
13 |
14 | /**
15 | * Imperative option for the "targetstate" parameter
16 | *
17 | */
18 | export const TargetStateOption: ICommandOptionDefinition = {
19 | name: "target-state",
20 | aliases: ["ts", "targetstate"],
21 | type: "string",
22 | required: false,
23 | defaultValue: "DISCARDED",
24 | allowableValues: {
25 | values: ["UNAVAILABLE", "DISABLED", "DISCARDED"],
26 | caseSensitive: false
27 | },
28 | group: "cics-deploy Options",
29 | description: "Specifies the target state for the undeployed bundle."
30 | };
31 |
32 |
--------------------------------------------------------------------------------
/src/healthCheck.handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright Contributors to the Zowe Project.
9 | *
10 | */
11 |
12 | import {ICommandHandler, IHandlerParameters, Logger} from "@zowe/imperative";
13 |
14 | export default class HealthCheckHandler implements ICommandHandler {
15 | public async process(params: IHandlerParameters): Promise {
16 | Logger.getImperativeLogger().debug("Invoked health check handler");
17 | params.response.console.log("You would report problems identified by healthCheck.\n" +
18 | "This handler is not currently called by Imperative, but\n" +
19 | "its existence prevents a warning during plugin validation."
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * This program and the accompanying materials are made available under the terms of the
3 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4 | * https://www.eclipse.org/legal/epl-v20.html
5 | *
6 | * SPDX-License-Identifier: EPL-2.0
7 | *
8 | * Copyright IBM Corp, 2019
9 | *
10 | */
11 | export * from "./api/BundleContent/AutoBundler";
12 | export * from "./api/BundleContent/Bundle";
13 | export * from "./api/BundleContent/BundlePart";
14 | export * from "./api/BundleContent/Manifest";
15 | export * from "./api/BundleContent/NodejsappBundlePart";
16 | export * from "./api/BundleDeploy/BundleDeployer";
17 | export * from "./api/BundlePush/BundlePusher";
18 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | /*
3 | * This program and the accompanying materials are made available under the terms of the
4 | * Eclipse Public License v2.0 which accompanies this distribution, and is available at
5 | * https://www.eclipse.org/legal/epl-v20.html
6 | *
7 | * SPDX-License-Identifier: EPL-2.0
8 | *
9 | * Copyright Contributors to the Zowe Project.
10 | * Copyright IBM Corp, 2019
11 | *
12 | */
13 |
14 |
15 | import { Imperative } from "@zowe/imperative";
16 | // init imperative & parse the CLI input.
17 | Imperative.init().then(() => {
18 | Imperative.api.imperativeLogger.info("Imperative Initialized the cics-deploy CLI!");
19 | Imperative.parse();
20 | Imperative.api.imperativeLogger.info("Parsed the input command!");
21 | }).catch((error) => {
22 | Imperative.console.error(`An error occured during imperative initalization:\n${error}`);
23 | });
24 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "types": [
4 | "node",
5 | "jest"
6 | ],
7 | "target": "es2015",
8 | "module": "commonjs",
9 | "declaration": true,
10 | "moduleResolution": "node",
11 | "noImplicitAny": true,
12 | "outDir": "./lib",
13 | "preserveConstEnums": true,
14 | "removeComments": false,
15 | "pretty": true,
16 | "sourceMap": true,
17 | "newLine": "lf"
18 | },
19 | "include": [
20 | "src/**/*"
21 | ],
22 | "exclude": [
23 | "lib",
24 | "node_modules",
25 | "**/__mocks__/*",
26 | "**/__tests__/*",
27 | "**/*.test.ts"
28 | ]
29 | }
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "tslint:latest",
3 | "rules": {
4 | "object-literal-sort-keys": false,
5 | "ordered-imports": false,
6 | "one-line": false,
7 | "space-within-parens": false,
8 | "no-var-requires": false,
9 | "trailing-comma": false,
10 | "no-submodule-imports": [
11 | true
12 | ],
13 | "max-line-length": [
14 | true,
15 | 150
16 | ],
17 | "no-magic-numbers": [
18 | true,
19 | -1,
20 | 0,
21 | 1,
22 | 2
23 | ],
24 | "no-consecutive-blank-lines": [
25 | true,
26 | 2
27 | ],
28 | "prefer-conditional-expression": false,
29 | "no-implicit-dependencies": [true]
30 | },
31 | "exclude": "node_modules",
32 | "type-check": true
33 | }
34 |
35 |
--------------------------------------------------------------------------------