mirror of
https://github.com/jlengrand/sample-node-api.git
synced 2026-03-10 08:41:23 +00:00
Modified configure.sh and README.md
Signed-off-by: Jadin Luong <Jadin.Luong@ibm.com>
This commit is contained in:
21
README.md
21
README.md
@@ -68,28 +68,19 @@ pax -ppx -rf ../<pax-name>.pax
|
||||
ssh ibmuser@my.mainframe.com
|
||||
```
|
||||
|
||||
### 2) install dependencies
|
||||
### 2) install component using zowe-install-component.sh script
|
||||
```
|
||||
cd </usr/lpp/extender>/sample-node-api
|
||||
npm install --only=prod
|
||||
|
||||
./<zowe-runtime-dir>/bin/zowe-install-component.sh -c <component-name> -i <zowe-instance-dir> -o <component-pax-file> -l <log-folder>
|
||||
|
||||
```
|
||||
|
||||
### 3) Manage lifecycle of service with core zowe components
|
||||
### 3) Lifecycle scripts of the component
|
||||
|
||||
Use property `EXTERNAL_COMPONENTS` located in file `$INSTANCE_DIR/instance.env`
|
||||
Append it (comma separated) with the directory containing your service lifecycle scripts.
|
||||
|
||||
In our sample it is:
|
||||
```
|
||||
vi INSTANCE_DIR/instance.env
|
||||
EXTERNAL_COMPONENTS=</usr/lpp/extender>/sample-node-api/bin
|
||||
```
|
||||
|
||||
We expect following in service folder `start.sh` and `configure.sh`.
|
||||
We expect following in service folder `start.sh`, `configure.sh` and `validate.sh`.
|
||||
In our case its bin folder with relevant scripts.
|
||||
|
||||
`configure.sh` it adds static definition for sample-node-api to folder ${INSTANCE_DIR}/workspace/api-mediation/api-defs in IBM-850 encoding
|
||||
`configure.sh` sets up specified variables and configuration to help get the component started
|
||||
`start.sh` starts node app on configured port
|
||||
`env.sh` its custom script use to configure port for our node app, feel free to use your desired way
|
||||
|
||||
|
||||
13
bin/configure.sh
Executable file → Normal file
13
bin/configure.sh
Executable file → Normal file
@@ -26,17 +26,4 @@ echo "COMPONENT_DIR: ${COMPONENT_DIR}"
|
||||
echo 'load sample-node-api config'
|
||||
. ${COMPONENT_DIR}/bin/env.sh
|
||||
|
||||
echo 'Add static definition for sample-node-api'
|
||||
#configure based on env.sh
|
||||
sed -e "s/mymainframe.ibm.com/${ZOWE_EXPLORER_HOST}/g" \
|
||||
-e "s/18000/${MY_API_PORT}/g" \
|
||||
${COMPONENT_DIR}/${MY_API_NAME}.yml \
|
||||
> ${STATIC_DEF_CONFIG_DIR}/${MY_API_NAME}.ebcidic.yml
|
||||
|
||||
echo 'change sample-node-api.ebcidic.yml encoding from ibm-1047 to ibm-850'
|
||||
# basically this yml file is only thing we need to do register our service with apiml
|
||||
iconv -f IBM-1047 -t IBM-850 ${STATIC_DEF_CONFIG_DIR}/${MY_API_NAME}.ebcidic.yml > $STATIC_DEF_CONFIG_DIR/${MY_API_NAME}.yml
|
||||
rm ${STATIC_DEF_CONFIG_DIR}/${MY_API_NAME}.ebcidic.yml
|
||||
chmod 770 $STATIC_DEF_CONFIG_DIR/${MY_API_NAME}.yml
|
||||
|
||||
echo 'sample-node-api configure done'
|
||||
|
||||
Reference in New Issue
Block a user