diff --git a/.pax/prepare-workspace.sh b/.pax/prepare-workspace.sh index 2d834be..c9283cd 100755 --- a/.pax/prepare-workspace.sh +++ b/.pax/prepare-workspace.sh @@ -34,6 +34,10 @@ echo "[${SCRIPT_NAME}] cleaning PAX workspace ..." rm -fr "${PAX_WORKSPACE_DIR}/content" mkdir -p "${PAX_WORKSPACE_DIR}/content" +cp manifest.yaml "${PAX_WORKSPACE_DIR}/content" +cp README.md "${PAX_WORKSPACE_DIR}/content" +cp LICENSE "${PAX_WORKSPACE_DIR}/content" + # build client echo "[${SCRIPT_NAME}] building client ..." cd "dist" @@ -50,6 +54,21 @@ cp -r dist/. "${PAX_WORKSPACE_DIR}/content" # move content to another folder rm -fr "${PAX_WORKSPACE_DIR}/ascii" mkdir -p "${PAX_WORKSPACE_DIR}/ascii" + +# update build information +# BRANCH_NAME and BUILD_NUMBER is Jenkins environment variable +commit_hash=$(git rev-parse --verify HEAD) +current_timestamp=$(date +%s%3N) +sed -e "s|{{build\.branch}}|${BRANCH_NAME}|g" \ + -e "s|{{build\.number}}|${BUILD_NUMBER}|g" \ + -e "s|{{build\.commitHash}}|${commit_hash}|g" \ + -e "s|{{build\.timestamp}}|${current_timestamp}|g" \ + "${PAX_WORKSPACE_DIR}/content/manifest.yaml" > "${PAX_WORKSPACE_DIR}/content/manifest.yaml.tmp" +mv "${PAX_WORKSPACE_DIR}/content/manifest.yaml.tmp" "${PAX_WORKSPACE_DIR}/content/manifest.yaml" +echo "[${SCRIPT_NAME}] manifest:" +cat "${PAX_WORKSPACE_DIR}/content/manifest.yaml" +echo + rsync -rv \ --include '*.json' --include '*.html' --include '*.jcl' --include '*.template' \ --exclude '*.zip' --exclude '*.png' --exclude '*.tgz' --exclude '*.tar.gz' --exclude '*.pax' \ diff --git a/README.md b/README.md index 7769fec..6751544 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ In our sample it is: EXTERNAL_COMPONENTS=/sample-node-api/bin ``` -We expect following in service folder `start.sh`, `configure.sh` and `validate.sh`. +We expect following in service folder `start.sh` and `configure.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 diff --git a/bin/configure-2.sh b/bin/configure-2.sh old mode 100644 new mode 100755 diff --git a/bin/configure.sh b/bin/configure.sh old mode 100644 new mode 100755 diff --git a/bin/env.sh b/bin/env.sh old mode 100644 new mode 100755 diff --git a/bin/start.sh b/bin/start.sh old mode 100644 new mode 100755 diff --git a/manifest.yaml b/manifest.yaml new file mode 100644 index 0000000..95b6bfa --- /dev/null +++ b/manifest.yaml @@ -0,0 +1,19 @@ +name: sample-node-api +id: org.zowe.sample-node-api +title: Sample Node API +description: A Sample Node API extension for Zowe +license: EPL-2.0 +repository: + type: git + url: https://github.com/zowe/sample-node-api.git +build: + branch: "{{build.branch}}" + number: "{{build.number}}" + commitHash: "{{build.commitHash}}" + timestamp: "{{build.timestamp}}" +commands: + start: bin/start.sh + configure: bin/configure.sh +apimlServices: + static: + - file: sample-node-api.yml \ No newline at end of file