IBM / zowe-cli-cics-deploy-plugin

Provides the cics-deploy plug-in for Zowe CLI https://github.com/zowe/zowe-cli to deploy Node.js and other applications from a workstation to IBM CICS Transaction Server within a CICS bundle. Documentation is available at https://ibm.github.io/zowe-cli-cics-deploy-plugin/
Eclipse Public License 2.0
13 stars 12 forks source link

Should there be options on the generate bundle for more items in the profile other than the port ? #112

Closed ChrisAtkinson1 closed 5 years ago

ChrisAtkinson1 commented 5 years ago

We have these as required for example.

#**********************************************************************
#
#                      Required parameters
#                      -------------------
#
# NODE_HOME specifies the location of IBM SDK for Node.js - z/OS.
#
# NODE_HOME=/usr/lpp/IBM/cnj/IBM/node-v6.14.4-os390-s390x
#
#
# WORK_DIR specifies the root directory in which CICS will create log
# files. The default value is /tmp. A value of . means the home
# directory of the user id running the CICS job.
#
# WORK_DIR=.
#

And this as generated.

#**********************************************************************
#
#                      Including files in the profile
#                      ------------------------------
#
# %INCLUDE specifies a file to be included in this profile. The file can
# contain common system-wide configuration that can then be maintained
# separate to the application configuration. Symbols can be used when
# specifying the file to be included.
#
# Examples:
# %INCLUDE=/etc/cicsts/prodplex/nodejs/sdk.profile
# %INCLUDE=&USSCONFIG;/nodejs/sdk.profile
# %INCLUDE=&CONFIGROOT;/debug.profile
#
%INCLUDE=&USSCONFIG;/nodejsprofiles/general.profile
#

And this as Optional.

#**********************************************************************
#
#                      Optional parameters
#                      -------------------
#
# NODEJSAPP_DISABLE_TIMEOUT specifies the time in milliseconds that
# CICS will wait when attempting to disable a NODEJSAPP. If the process
# has not terminated in this time then CICS will send a SIGKILL signal
# to force the process to end. The default value is 10000 (10 seconds).
#
# Example:
# NODEJSAPP_DISABLE_TIMEOUT=30000

The Port can be specified.

Or would we expect the user to edit by hand before pushing ?

matthewpwilson commented 5 years ago

I think it's reasonable to edit the profile by hand if other stuff needs to be changed. If you know enough to know you want to change something in the profile it's probably no harder than specifying a command line parameter.

pcoop commented 5 years ago

If we made some of those things configurable it would introduce uncertainty: e.g. which NODE_HOME will win, the one configured by 'generate bundle' or the one that's provisioned in the target system?

We've not stopped a power user from editing/scripting any changes they like to the Bundle, but our defaults encourage a separation of concerns between the Application and System configuration information. The port number is a special case however, that spans both environments.

markcocker commented 5 years ago

I can think of two approaches that could help.

  1. Replace --port option with one that accepts a string of name/value pairs that are added to the profile (choosing a separator character will be interesting). We can add examples in the help to show use of PORT as it will be the common use case. Eg:
    zowe cics-deploy generate bundle --profile-envvars "PORT=27501" 
  2. Update the help for --port to say additional environment variables can be added by editing the generated profile.
markcocker commented 5 years ago

Suggestion is to have a doc topic to say if more environment variables are required, you can edit the profile.

markcocker commented 5 years ago

@ChrisAtkinson1 Pull request #160 updated topic Deploying your first app to include:

  1. Update the CICS Node.js application profile if your application requires environment variables to be set. Edit the .profile file created in step 4, for example nodejsapps/myexpressapp.profile.