diff --git a/README.md b/README.md index 6751544..b4353f2 100644 --- a/README.md +++ b/README.md @@ -68,28 +68,19 @@ pax -ppx -rf ../.pax ssh ibmuser@my.mainframe.com ``` -### 2) install dependencies +### 2) install component using zowe-install-component.sh script ``` -cd /sample-node-api -npm install --only=prod + +.//bin/zowe-install-component.sh -c -i -o -l ``` -### 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=/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 diff --git a/bin/configure.sh b/bin/configure.sh old mode 100755 new mode 100644 index ae8d456..2430099 --- a/bin/configure.sh +++ b/bin/configure.sh @@ -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'