mirror of
https://github.com/jlengrand/sample-node-api.git
synced 2026-03-10 08:41:23 +00:00
generate tar gz package
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
This commit is contained in:
11
.gitignore
vendored
11
.gitignore
vendored
@@ -4,3 +4,14 @@ node_modules/
|
||||
output
|
||||
dist
|
||||
.history/
|
||||
|
||||
#pax ignore
|
||||
.pax/*
|
||||
!.pax/.keep
|
||||
!.pax/pre-packaging.sh
|
||||
!.pax/post-packaging.sh
|
||||
!.pax/prepare-workspace.sh
|
||||
!.pax/catchall-packaging.sh
|
||||
|
||||
# jenkin ignore
|
||||
**/*@tmp/
|
||||
|
||||
@@ -19,15 +19,15 @@
|
||||
# contants
|
||||
SCRIPT_NAME=$(basename "$0")
|
||||
BASEDIR=$(dirname "$0")
|
||||
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
ROOT_DIR=$(cd "$SCRIPT_DIR" && cd .. && pwd)
|
||||
PAX_WORKSPACE_DIR=.pax
|
||||
cd "${ROOT_DIR}"
|
||||
PACKAGE_NAME=$(node -e "console.log(require('./package.json').name)")
|
||||
PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)")
|
||||
PACKAGE_DESC=$(node -e "console.log(require('./package.json').description)")
|
||||
ZOWE_PLUGIN_ID="com.ibm.${PACKAGE_NAME}"
|
||||
|
||||
cd $BASEDIR
|
||||
cd ..
|
||||
ROOT_DIR=$(pwd)
|
||||
|
||||
# prepare pax workspace
|
||||
echo "[${SCRIPT_NAME}] cleaning PAX workspace ..."
|
||||
@@ -40,6 +40,16 @@ cp LICENSE "${PAX_WORKSPACE_DIR}/content"
|
||||
|
||||
# build client
|
||||
echo "[${SCRIPT_NAME}] building client ..."
|
||||
# build client
|
||||
if [ ! -d "dist" ] || [ -z "$(ls -1 dist/src/index.js)" ]; then
|
||||
echo "[${SCRIPT_NAME}] building client ..."
|
||||
if [ ! -d "node_modules" ]; then
|
||||
npm install
|
||||
fi
|
||||
echo "[${SCRIPT_NAME}] run build ..."
|
||||
npm run build
|
||||
fi
|
||||
|
||||
cd "dist"
|
||||
npm install --only=prod
|
||||
|
||||
@@ -77,4 +87,18 @@ rsync -rv \
|
||||
"${PAX_WORKSPACE_DIR}/ascii"
|
||||
|
||||
echo "[${SCRIPT_NAME}] ${PAX_WORKSPACE_DIR} folder is prepared."
|
||||
|
||||
echo "[${SCRIPT_NAME}] ${PAX_WORKSPACE_DIR} prepare local-build and *.tar.gz"
|
||||
cd "${PAX_WORKSPACE_DIR}"
|
||||
# remove folder for local build & tar
|
||||
rm -fr "sample-node-api"
|
||||
rm -f "sample-node-api.tar.gz"
|
||||
|
||||
# copy ascii to sample-node-api
|
||||
cp -r "ascii" "sample-node-api"
|
||||
|
||||
# tar sample-node-api
|
||||
tar -zcvf "sample-node-api.tar.gz" "sample-node-api"
|
||||
echo "[${SCRIPT_NAME}] ${PAX_WORKSPACE_DIR} local-build and *.tar.gz is generated"
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -68,7 +68,7 @@ ssh ibmuser@my.mainframe.com
|
||||
|
||||
### 2) install component using zowe-install-component.sh script
|
||||
```
|
||||
./<zowe-runtime-dir>/bin/zowe-install-component.sh -d <zowe-extensions-dir> -i <zowe-instance-dir> -o <component-file-path> -l <log-folder>
|
||||
./<zowe-runtime-dir>/bin/zowe-install-component.sh -i <zowe-instance-dir> -o <component-file-path> -l <log-folder>
|
||||
```
|
||||
```
|
||||
<zowe-extensions-dir> - Directory that will hold all external extensions installed onto zowe
|
||||
@@ -86,7 +86,7 @@ We expect following in service folder `start.sh`. In our case its bin folder wit
|
||||
|
||||
### 4) Access newly deployed webservice
|
||||
|
||||
Please see static definition file `sample-node-api.yml`
|
||||
Please see static definition file `sample-node-api.yaml.template`
|
||||
It configures service endpoint as `sample-node-api` with property `serviceId`
|
||||
We also provide api gateway base path `api\v1` with property `gatewayUrl` in same file.
|
||||
|
||||
|
||||
@@ -15,4 +15,4 @@ commands:
|
||||
start: bin/start.sh
|
||||
apimlServices:
|
||||
static:
|
||||
- file: sample-node-api.yml
|
||||
- file: sample-node-api.yaml.template
|
||||
10
package-lock.json
generated
10
package-lock.json
generated
@@ -403,7 +403,7 @@
|
||||
},
|
||||
"decamelize": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-release/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
|
||||
},
|
||||
"decompress-response": {
|
||||
@@ -1092,7 +1092,7 @@
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-release/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
@@ -1214,7 +1214,7 @@
|
||||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-release/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
|
||||
},
|
||||
"require-main-filename": {
|
||||
@@ -1313,7 +1313,7 @@
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-release/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
},
|
||||
"setprototypeof": {
|
||||
@@ -1502,7 +1502,7 @@
|
||||
},
|
||||
"which-module": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
|
||||
"resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-release/which-module/-/which-module-2.0.0.tgz",
|
||||
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
|
||||
},
|
||||
"widest-line": {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"dev": "nodemon src/index.js",
|
||||
"dev:https": "nodemon src/index.js --key sslcert/server.key --cert sslcert/server.cert",
|
||||
"start": "node src/index.js",
|
||||
"build": "npm run clean && cp -r src dist/src && cp -r bin dist/bin && cp *.yml dist && cp *.yaml dist && cp *.json dist && cp README.md dist && cp LICENSE dist",
|
||||
"build": "npm run clean && cp -r src dist/src && cp -r bin dist/bin && cp *.yaml.template dist && cp *.yaml dist && cp *.json dist && cp README.md dist && cp LICENSE dist",
|
||||
"clean": "rimraf dist && mkdirp dist"
|
||||
},
|
||||
"author": "",
|
||||
|
||||
@@ -5,7 +5,7 @@ services:
|
||||
description: Sample Node API
|
||||
catalogUiTileId: sample-node-api
|
||||
instanceBaseUrls:
|
||||
- http://mymainframe.ibm.com:18000/
|
||||
- https://${ZOWE_EXPLORER_HOST}:18000/
|
||||
homePageRelativeUrl: # Home page is at the same URL
|
||||
routedServices:
|
||||
- gatewayUrl: api/v1 # [api/ui/ws]/v{majorVersion}
|
||||
@@ -14,8 +14,8 @@ services:
|
||||
- apiId: com.ibm.sample-node-api
|
||||
gatewayUrl: api/v1
|
||||
version: 1.0.0
|
||||
swaggerUrl: http://mymainframe.ibm.com:18000/api-docs
|
||||
documentationUrl: http://mymainframe.ibm.com:18000/api-docs-ui
|
||||
swaggerUrl: https://${ZOWE_EXPLORER_HOST}:18000/api-docs
|
||||
documentationUrl: https://${ZOWE_EXPLORER_HOST}:18000/api-docs-ui
|
||||
|
||||
catalogUiTiles:
|
||||
sample-node-api:
|
||||
@@ -3,13 +3,17 @@ node src/index.js --service sample-node-api --port 8080 --key sslcert/server.key
|
||||
|
||||
cd ~/zowe/extenders/sample-node-api
|
||||
## start on z/os uss
|
||||
KEYSTORE_DIRECTORY=~/zowe/keystore
|
||||
KEYSTORE_DIRECTORY=/u/nakul/zowe/keystore
|
||||
KEYSTORE_ALIAS=localhost
|
||||
KEYSTORE_PREFIX="${KEYSTORE_DIRECTORY}/${KEYSTORE_ALIAS}/${KEYSTORE_ALIAS}.keystore"
|
||||
KEYSTORE_KEY=${KEYSTORE_PREFIX}.key
|
||||
KEYSTORE_CERTIFICATE=${KEYSTORE_PREFIX}.cer-ebcdic
|
||||
export __UNTAGGED_READ_MODE=V6
|
||||
node src/index.js --service sample-node-api --port 18000 --key ${KEYSTORE_KEY} --cert ${KEYSTORE_CERTIFICATE} -v
|
||||
|
||||
/usr/lpp/IBM/cnj/v12r0/IBM/node-v12.14.1-os390-s390x/bin/node src/index.js --service jes --path /ui/v1/explorer-jes --dir /u/nakul/zowe/runtime/components/explorer-jes/bin/app --port 48546 --key ${KEYSTORE_KEY} --cert ${KEYSTORE_CERTIFICATE} --csp tvt5003.svl.ibm.com:*
|
||||
/usr/lpp/IBM/cnj/v8r0/IBM/node-v8.17.0.1-os390-s390x/bin/node src/index.js --service jes --path /ui/v1/explorer-jes --dir /u/nakul/zowe/runtime/components/explorer-jes/bin/app --port 48546 --key ${KEYSTORE_KEY} --cert ${KEYSTORE_CERTIFICATE} --csp tvt5003.svl.ibm.com:*
|
||||
|
||||
# register with API ML layer
|
||||
cd ~/zowe/extenders/sample-node-api
|
||||
iconv -f IBM-1047 -t IBM-850 sample-node-api.yml > ~/zowe/instance/workspace/api-mediation/api-defs/sample-node-api.yml
|
||||
Reference in New Issue
Block a user