diff --git a/.github/workflows/build-core.yml b/.github/workflows/build-core.yml new file mode 100644 index 00000000..67ac4a57 --- /dev/null +++ b/.github/workflows/build-core.yml @@ -0,0 +1,102 @@ +name: Build Core +on: + push: + branches: + - staging, master, rc + pull_request: + types: [opened, reopened, synchronize] + + workflow_dispatch: + inputs: + ZLUX_APP_MANAGER: + description: 'zlux-app-manager PR number' + required: false + ZLUX_APP_SERVER: + description: 'zlux-app-server PR number' + required: false + ZLUX_BUILD: + description: 'zlux-build PR number' + required: false + ZLUX_PLATFORM: + description: 'zlux-platform PR number' + required: false + + ZLUX_SERVER_FRAMEWORK: + description: 'zlux-server-framework PR number' + required: false + ZLUX_SHARED: + description: 'zlux-shared PR number' + required: false + DEFAULT_BRANCH: + description: 'please enter the default branch you would like to build with, default will be v2.x/staging' + required: false + default: 'staging' + +jobs: + check-permission: + runs-on: ubuntu-latest + steps: + # this action will fail the whole workflow if permission check fails + - name: check permission + uses: zowe-actions/shared-actions/permission-check@main + with: + user: ${{ github.actor }} + github-repo: ${{ github.repository }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + build: + runs-on: ubuntu-latest + needs: check-permission + steps: + + - name: '[Prep 1] Cache node modules' + uses: actions/cache@v2 + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: | + ~/.npm + ~/.nvm/.cache + ~/.nvm/versions + key: ${{ runner.os }}-build-cache-node-modules-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-cache-node-modules- + + - name: '[Prep 2] Setup Node' + uses: actions/setup-node@v2 + with: + node-version: 14 + + - name: '[Prep 3] Setup jFrog CLI' + uses: jfrog/setup-jfrog-cli@v2 + env: + JF_ARTIFACTORY_1: ${{ secrets.JF_ARTIFACTORY_TOKEN }} + + - name: '[Prep 4] prepare workflow' + uses: zowe-actions/zlux-builds/core/prepare@main + with: + github-user: ${{ secrets.ZOWE_ROBOT_USER }} + github-password: ${{ secrets.ZOWE_ROBOT_TOKEN }} + github-email: ${{ secrets.ZOWE_ROBOT_EMAIL }} + github-branch: ${{ github.event.inputs.BRANCH_NAME }} + default-base: ${{ github.event.inputs.DEFAULT_BRANCH }} + + - name: '[Prep 5] build' + uses: zowe-actions/zlux-builds/core/build@main + with: + zlux-app-manager: ${{ github.event.inputs.ZLUX_APP_MANAGER }} + zlux-app-server: ${{ github.event.inputs.ZLUX_APP_SERVER }} + zlux-build: ${{ github.event.inputs.ZLUX_BUILD }} + zlux-platform: ${{ github.event.inputs.ZLUX_PLATFORM }} + zlux-server-framework: ${{ github.event.inputs.ZLUX_SERVER_FRAMEWORK }} + zlux-shared: ${{ github.event.inputs.ZLUX_SHARED }} + + - name: '[Prep 6] packaging' + uses: zowe-actions/zlux-builds/core/package@main + with: + pax-ssh-username: ${{ secrets.SSH_MARIST_USERNAME }} + pax-ssh-password: ${{ secrets.SSH_MARIST_RACF_PASSWORD }} + pax-name: zlux-core + + - name: '[Prep 7] deploy' + uses: zowe-actions/zlux-builds/core/deploy@main + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8946f1a3..b725a376 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zlux App Server package will be documented in this file. +## v1.28.0 + +- Bugfix: App-server had a jobname prefix regression for several releases when it recieved an incorrect value for ZOWE_PREFIX when LAUNCH_COMPONENT_GROUPS included GATEWAY + ## v1.27.0 - Bugfix: Fix development environment case in which app-server would crash without agent config being fully defined. diff --git a/bin/app-server.sh b/bin/app-server.sh index a7561acb..682eb6d6 100755 --- a/bin/app-server.sh +++ b/bin/app-server.sh @@ -188,5 +188,15 @@ then else ZLUX_SERVER_FILE=zluxServer.js fi + +# Weird bug in recent releases has app-server not having the same jobname prefix as other services. +# This only happens when LAUNCH_COMPONENT_GROUPS includes GATEWAY. +# Possibly due to hacks elsewhere that we weren't notified of https://github.com/zowe/zowe-install-packaging/commit/0ccb77afca8f6dd8e2782c25490283739ab2791c +if [ -n "${ZOWE_INSTANCE}" ]; then + if [[ "${ZOWE_PREFIX}" != *"${ZOWE_INSTANCE}" ]]; then + export ZOWE_PREFIX=${ZOWE_PREFIX}${ZOWE_INSTANCE} + fi +fi + { __UNTAGGED_READ_MODE=V6 _BPX_JOBNAME=${ZOWE_PREFIX}DS1 ${NODE_BIN} --harmony ${ZOWE_LIB_DIR}/${ZLUX_SERVER_FILE} --config="${CONFIG_FILE}" "$@" 2>&1 ; echo "Ended with rc=$?" ; } | tee $ZLUX_NODE_LOG_FILE diff --git a/bin/convert-env.sh b/bin/convert-env.sh index eefdafcb..3ce918b1 100755 --- a/bin/convert-env.sh +++ b/bin/convert-env.sh @@ -181,20 +181,6 @@ then export ZWED_agent_jwt_fallback=$SSO_FALLBACK_TO_NATIVE_AUTH fi fi -if [ -z "$ZWED_agent_jwt_token_name" ] -then - if [ -n "$PKCS11_TOKEN_NAME" ] - then - export ZWED_agent_jwt_token_name=$PKCS11_TOKEN_NAME - fi -fi -if [ -z "$ZWED_agent_jwt_token_label" ] -then - if [ -n "$PKCS11_TOKEN_LABEL" ] - then - export ZWED_agent_jwt_token_label=$PKCS11_TOKEN_LABEL - fi -fi # app server if [ -z "$ZWED_node_https_port" ] diff --git a/package-lock.json b/package-lock.json index dfd11d4e..d4098f27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,90 @@ { "name": "zlux-app-server", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "zlux-app-server", + "version": "1.0.0", + "dependencies": { + "mkdirp": "~0.5.1", + "zlux-server-framework": "file:../zlux-server-framework" + } + }, + "../zlux-server-framework": { + "version": "0.0.0-zlux.version.replacement", + "license": "EPL-2.0", + "dependencies": { + "@rocketsoftware/eureka-js-client": "~4.5.3", + "@rocketsoftware/express-ws": "^5.0.0", + "accept-language-parser": "~1.5.0", + "axios": "~0.22.0", + "bluebird": "~3.5.1", + "body-parser": "~1.18.3", + "cookie-parser": "~1.4.3", + "diffie-hellman": "^5.0.3", + "express": "~4.16.3", + "express-session": "~1.15.6", + "express-static-gzip": "~1.1.3", + "glob": "~7.1.3", + "graceful-fs": "~4.1.15", + "ipaddr.js": "~1.8.0", + "js-yaml": "~3.13.1", + "lodash": "~4.17.21", + "mkdirp": "~0.5.1", + "ncp": "~2.0.0", + "node-forge": "~1.2.0", + "normalize-url": "~7.0.0", + "require-from-string": "~2.0.2", + "rimraf": "~2.6.3", + "semver": "~5.5.1", + "swagger-parser": "~10.0.3", + "ws": "^6.2.2", + "yaml": "~1.10.2", + "yauzl": "~2.10.0" + }, + "devDependencies": { + "@types/connect": "3.4.32", + "@types/express": "~4.16.1", + "@types/express-serve-static-core": "4.17.7", + "@types/node": "~6.0.0", + "@types/qs": "6.9.3", + "chai": "~4.2.0", + "chai-http": "~4.2.0", + "mocha": "~8.4.0", + "typescript": "2.7.1" + }, + "optionalDependencies": { + "keyring_js": "~1.1.0" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/zlux-server-framework": { + "resolved": "../zlux-server-framework", + "link": true + } + }, "dependencies": { "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "mkdirp": { "version": "0.5.5", @@ -20,12 +97,21 @@ "zlux-server-framework": { "version": "file:../zlux-server-framework", "requires": { + "@rocketsoftware/eureka-js-client": "~4.5.3", "@rocketsoftware/express-ws": "^5.0.0", + "@types/connect": "3.4.32", + "@types/express": "~4.16.1", + "@types/express-serve-static-core": "4.17.7", + "@types/node": "~6.0.0", + "@types/qs": "6.9.3", "accept-language-parser": "~1.5.0", + "axios": "~0.22.0", "bluebird": "~3.5.1", "body-parser": "~1.18.3", + "chai": "~4.2.0", + "chai-http": "~4.2.0", "cookie-parser": "~1.4.3", - "eureka-js-client": "~4.4.1", + "diffie-hellman": "^5.0.3", "express": "~4.16.3", "express-session": "~1.15.6", "express-static-gzip": "~1.1.3", @@ -33,14 +119,20 @@ "graceful-fs": "~4.1.15", "ipaddr.js": "~1.8.0", "js-yaml": "~3.13.1", + "keyring_js": "~1.1.0", + "lodash": "~4.17.21", "mkdirp": "~0.5.1", + "mocha": "~8.4.0", "ncp": "~2.0.0", - "normalize-url": "~4.3.0", + "node-forge": "~1.2.0", + "normalize-url": "~7.0.0", "require-from-string": "~2.0.2", "rimraf": "~2.6.3", "semver": "~5.5.1", - "swagger-parser": "~6.0.5", - "ws": "^6.0.0", + "swagger-parser": "~10.0.3", + "typescript": "2.7.1", + "ws": "^6.2.2", + "yaml": "~1.10.2", "yauzl": "~2.10.0" } } diff --git a/zss.apiml_static_reg.yaml.template b/zss.apiml_static_reg.yaml.template index dc3bbbfe..c9097702 100644 --- a/zss.apiml_static_reg.yaml.template +++ b/zss.apiml_static_reg.yaml.template @@ -12,7 +12,7 @@ services: apiInfo: - apiId: org.zowe.zss gatewayUrl: api/v1 - swaggerUrl: ${ZSS_PROTOCOL}://${ZWED_agent_host}:${ZSS_PORT}/api-docs/agent + swaggerUrl: https://${ZOWE_EXPLORER_HOST}:${ZOWE_ZLUX_SERVER_HTTPS_PORT:-8544}/api-docs/agent # documentationUrl: TODO catalogUiTiles: zss: