├── .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 | [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](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: '