Skip to content

Commit

Permalink
Merge branch 'v2.x/staging' into bugfix/v2/ZWENOKYR
Browse files Browse the repository at this point in the history
  • Loading branch information
ojcelis authored Aug 29, 2023
2 parents 33f7f1a + 1270f0d commit 86eb504
Show file tree
Hide file tree
Showing 58 changed files with 1,041 additions and 465 deletions.
129 changes: 129 additions & 0 deletions .github/workflows/server-bundle-base-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Build ompzowe/zowecicd-node-java builder
on:
# push:
# pull_request:
workflow_dispatch:
inputs:
release:
description: 'Set to "true" if we want to release the base images'
required: false
default: ''
RANDOM_DISPATCH_EVENT_ID:
description: 'random dispatch event id'
required: false
type: string
env:
IMAGE_BASE_DIR: containers/server-bundle

jobs:
display-dispatch-event-id:
if: github.event.inputs.RANDOM_DISPATCH_EVENT_ID != ''
runs-on: ubuntu-latest
steps:
- name: RANDOM_DISPATCH_EVENT_ID is ${{ github.event.inputs.RANDOM_DISPATCH_EVENT_ID }}
run: echo "prints random dispatch event id sent from workflow dispatch event"

build-ubuntu-amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: zowe-actions/shared-actions/prepare-workflow@main

- uses: zowe-actions/shared-actions/docker-prepare@main
with:
registry-user: ${{ secrets.ARTIFACTORY_X_USERNAME }}
registry-password: ${{ secrets.ARTIFACTORY_X_PASSWORD }}
release: ${{ github.event.inputs.release }}
base-directory: ${{ env.IMAGE_BASE_DIR }}
image-name: zowecicd-node-java
linux-distro: ubuntu
cpu-arch: amd64

- uses: zowe-actions/shared-actions/docker-build-local@main
with:
build-arg-list: NODE_CPU_ARCH=x64
timeout-minutes: 5

- name: Run Snyk to check Docker image for vulnerabilities
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true
uses: snyk/actions/docker@master
with:
image: ${{ env.IMAGE_NAME_FULL_REMOTE }}
args: --file=${{ env.IMAGE_DIRECTORY }}/Dockerfile.nodejava.amd64
command: test

- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v1
if: hashFiles('snyk.sarif') != ''
with:
sarif_file: snyk.sarif

build-ubuntu-s390x:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: zowe-actions/shared-actions/prepare-workflow@main

- uses: zowe-actions/shared-actions/docker-prepare@main
with:
registry-user: ${{ secrets.ARTIFACTORY_X_USERNAME }}
registry-password: ${{ secrets.ARTIFACTORY_X_PASSWORD }}
release: ${{ github.event.inputs.release }}
base-directory: ${{ env.IMAGE_BASE_DIR }}
image-name: zowecicd-node-java
linux-distro: ubuntu
cpu-arch: s390x

- uses: zowe-actions/shared-actions/docker-build-zlinux@main
with:
zlinux-host: ${{ secrets.ZLINUX_HOST }}
zlinux-ssh-user: ${{ secrets.ZLINUX_SSH_USER }}
zlinux-ssh-key: ${{ secrets.ZLINUX_SSH_KEY }}
zlinux-ssh-passphrase: ${{ secrets.ZLINUX_SSH_PASSPHRASE }}
build-arg-list: NODE_CPU_ARCH=s390x
timeout-minutes: 10

- name: Run Snyk to check Docker image for vulnerabilities
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true
uses: snyk/actions/docker@master
with:
image: ${{ env.IMAGE_NAME_FULL_REMOTE }}
args: --file=${{ env.IMAGE_DIRECTORY }}/Dockerfile.nodejava.s390x
command: test

- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v1
if: hashFiles('snyk.sarif') != ''
with:
sarif_file: snyk.sarif

define-ubuntu-manifest:
needs:
- build-ubuntu-amd64
- build-ubuntu-s390x
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: zowe-actions/shared-actions/prepare-workflow@main

- uses: zowe-actions/shared-actions/docker-prepare@main
with:
registry-user: ${{ secrets.ARTIFACTORY_X_USERNAME }}
registry-password: ${{ secrets.ARTIFACTORY_X_PASSWORD }}
release: ${{ github.event.inputs.release }}
base-directory: ${{ env.IMAGE_BASE_DIR }}
image-name: zowecicd-node-java
linux-distro: ubuntu

- uses: zowe-actions/shared-actions/docker-manifest@main
with:
linux-distro: ubuntu
cpu-arch-list: "amd64 s390x"
timeout-minutes: 2
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
All notable changes to the Zowe Installer will be documented in this file.
<!--Add the PR or issue number to the entry if available.-->

## `2.11.0`

### Minor enhancements/defect fixes
- Bugfix: Fixed that Zowe would allow newer Java versions to generate PKCS12 keystores that was not compatible with some components. Newer versions of Java by default create PKCS12 keystores that aren't compatible with GSK / SystemSSL which components such as ZSS use, but include flags to restore a compatibility mode, which Zowe now uses. (#3507)

## `2.10.0`

### New features and enhancements
- Enhancement: Added a new zwe "diagnose" command to find help on zowe error messages. (#3455)

#### Minor enhancements/defect fixes
- Enhancement: Check for node v18 which is now supported, but disallow v18.12.1 because it is known not to work for Zowe. (#3485)

## `2.9.0`

### New features and enhancements
Expand Down
1 change: 1 addition & 0 deletions bin/commands/diagnose/.errors
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ZWEL0102E|102|Invalid parameter %s.
1 change: 1 addition & 0 deletions bin/commands/diagnose/.examples
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zwe diagnose -e ZWES0014I
1 change: 1 addition & 0 deletions bin/commands/diagnose/.help
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Display the message corresponding to the error code.
1 change: 1 addition & 0 deletions bin/commands/diagnose/.parameters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
error-code|e|string|required||||Error Code.
13 changes: 13 additions & 0 deletions bin/commands/diagnose/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
This program and the accompanying materials are made available
under the terms of the Eclipse Public License v2.0 which
accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
*/

import * as index from './index';
index.execute();
35 changes: 35 additions & 0 deletions bin/commands/diagnose/index.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh

#######################################################################
# This program and the accompanying materials are made available
# under the terms of the Eclipse Public License v2.0 which
# accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-v20.html
#
# SPDX-License-Identifier: EPL-2.0
#
# Copyright Contributors to the Zowe Project.
#######################################################################

error_code="${ZWE_CLI_PARAMETER_ERROR_CODE}"

server_code=$(echo "${error_code}" | cut -c4)

if echo $error_code | grep -q -E "^[zZ][wW][eE][AaSsDdLl][A-Za-z]?[0-9]{3,4}[A-Za-z]$"; then
if [[ "$server_code" == [Dd] ]]; then
print_message "This code corresponds to the errors related to the ZOWE Desktop and the App Server."
print_message "To find the description of this error code, refer to the Zowe documentation at https://github.com/zowe/docs-site/blob/master/docs/troubleshoot/app-framework/appserver-error-codes.md"
elif [[ "$server_code" == [Ss] ]]; then
print_message "This code corresponds to the errors related to the Zowe Subsystem Services (ZSS) and Zowe Installation Services (ZIS)"
print_message "To find the description of this error code, refer to the Zowe documentation for ZSS at https://docs.zowe.org/stable/troubleshoot/app-framework/zss-error-codes and for ZIS at https://github.com/zowe/docs-site/blob/master/docs/troubleshoot/app-framework/zis-error-codes.md"
elif [[ "$server_code" == [Aa] ]]; then
print_message "This code corresponds to the errors related to the Zowe API Mediation Layer (APIML)."
print_message "To find the description of this error code, refer to the Zowe documentation at https://docs.zowe.org/stable/troubleshoot/troubleshoot-apiml-error-codes"
elif [[ "$server_code" == [Ll] ]]; then
print_message "This code corresponds to the errors related to the Zowe Launcher and ZWE"
print_message "To find the description of this error code, refer to the Zowe documentation for the Launcher at https://docs.zowe.org/stable/troubleshoot/launcher/launcher-error-codes and https://github.com/zowe/launcher/blob/v2.x/master/src/msg.h, and for ZWE at https://docs.zowe.org/stable/appendix/zwe_server_command_reference/zwe/ "
fi
print_message "You may also explore reports from other users experiencing the same error by searching here https://github.com/search?q=org%3Azowe+${error_code}&type=discussions"
else
print_error_and_exit "Invalid Error Code" "" 102
fi
38 changes: 38 additions & 0 deletions bin/commands/diagnose/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
This program and the accompanying materials are made available
under the terms of the Eclipse Public License v2.0 which
accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
*/

import * as std from 'cm_std';
import * as common from '../../libs/common';

export function execute() {
const errorCode: string = std.getenv('ZWE_CLI_PARAMETER_ERROR_CODE');

const serverCode: string = errorCode.charAt(3);

if (/^[zZ][wW][eE][AaSsDdLl][A-Za-z]?[0-9]{3,4}[A-Za-z]$/.test(errorCode)) {
if (serverCode.toLowerCase() === 'd') {
common.printMessage("This code corresponds to the errors related to the ZOWE Desktop and the App Server.");
common.printMessage("To find the description of this error code, refer to the Zowe documentation at https://github.com/zowe/docs-site/blob/master/docs/troubleshoot/app-framework/appserver-error-codes.md");
} else if (serverCode.toLowerCase() === 's') {
common.printMessage("This code corresponds to the errors related to the Zowe Subsystem Services (ZSS) and Zowe Installation Services (ZIS)");
common.printMessage("To find the description of this error code, refer to the Zowe documentation for ZSS at https://docs.zowe.org/stable/troubleshoot/app-framework/zss-error-codes and for ZIS at https://github.com/zowe/docs-site/blob/master/docs/troubleshoot/app-framework/zis-error-codes.md");
} else if (serverCode.toLowerCase() === 'a') {
common.printMessage("This code corresponds to the errors related to the Zowe API Mediation Layer (APIML).");
common.printMessage("To find the description of this error code, refer to the Zowe documentation at https://docs.zowe.org/stable/troubleshoot/troubleshoot-apiml-error-codes");
} else if (serverCode.toLowerCase() === 'l') {
common.printMessage("This code corresponds to the errors related to the Zowe Launcher and ZWE");
common.printMessage("To find the description of this error code, refer to the Zowe documentation for the Launcher at https://docs.zowe.org/stable/troubleshoot/launcher/launcher-error-codes and https://github.com/zowe/launcher/blob/v2.x/master/src/msg.h, and for ZWE at https://docs.zowe.org/stable/appendix/zwe_server_command_reference/zwe/");
}
common.printMessage(`You may also explore reports from other users experiencing the same error by searching here https://github.com/search?q=org%3Azowe+${errorCode}&type=discussions`)
} else {
common.printErrorAndExit("Invalid Error Code", undefined, 102);
}
}
2 changes: 1 addition & 1 deletion bin/commands/internal/start/prepare/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function prepareRunningInContainer() {

// Prepare log directory
function prepareLogDirectory() {
const logDir = std.getenv('ZWE_zowe_logDirectory');
const logDir = ZOWE_CONFIG.zowe.logDirectory;
if (logDir) {
os.mkdir(logDir, 0o750);
if (!fs.isDirectoryWritable(logDir)) {
Expand Down
Loading

0 comments on commit 86eb504

Please sign in to comment.