From 167a5783182947a6c8904fac597a6fdddd1340fb Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 30 Jul 2024 10:13:23 -0400 Subject: [PATCH 1/3] Fix to support ARM based systems Signed-off-by: Andrew W. Harn --- cli/basic-with-nvm/install_zowe.sh | 23 ++++++++++++++++++++++- cli/basic/install_zowe.sh | 23 ++++++++++++++++++++++- cli/jenkins-agent/install_zowe.sh | 23 ++++++++++++++++++++++- cli/minimal/Dockerfile | 3 ++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/cli/basic-with-nvm/install_zowe.sh b/cli/basic-with-nvm/install_zowe.sh index bd7456c..b57fd28 100755 --- a/cli/basic-with-nvm/install_zowe.sh +++ b/cli/basic-with-nvm/install_zowe.sh @@ -27,7 +27,8 @@ npm config set @zowe:registry https://zowe.jfrog.io/zowe/api/npm/npm-local-relea rm -rf ~/.zowe/plugins npm install -g @zowe/cli@${PKG_TAG} -plugins=( @zowe/zos-ftp-for-zowe-cli@${PKG_TAG} @zowe/cics-for-zowe-cli@${PKG_TAG} @zowe/db2-for-zowe-cli@${PKG_TAG} @zowe/ims-for-zowe-cli@${PKG_TAG} @zowe/mq-for-zowe-cli@${PKG_TAG}) +plugins=( @zowe/zos-ftp-for-zowe-cli@${PKG_TAG} @zowe/cics-for-zowe-cli@${PKG_TAG} @zowe/ims-for-zowe-cli@${PKG_TAG} @zowe/mq-for-zowe-cli@${PKG_TAG}) +noarm_plugins=( @zowe/db2-for-zowe-cli@${PKG_TAG} ) for i in "${plugins[@]}"; do if [ ! -z "${ALLOW_PLUGIN_INSTALL_FAIL}" ]; then @@ -37,4 +38,24 @@ for i in "${plugins[@]}"; do fi done +if uname -m | grep -q 'arm'; then + echo "Unable to install the following plug-ins due to CPU architecture:" + for i in "${noarm_plugins[@]}"; do + echo $i + done +elif uname -m | grep -q 'aarch'; then + echo "Unable to install the following plug-ins due to CPU architecture:" + for i in "${noarm_plugins[@]}"; do + echo $i + done +else + for i in "${noarm_plugins[@]}"; do + if [ ! -z "${ALLOW_PLUGIN_INSTALL_FAIL}" ]; then + zowe plugins install $i || true + else + zowe plugins install $i || exit 1 + fi + done +fi + exit 0 diff --git a/cli/basic/install_zowe.sh b/cli/basic/install_zowe.sh index f942fba..db1606a 100755 --- a/cli/basic/install_zowe.sh +++ b/cli/basic/install_zowe.sh @@ -22,7 +22,8 @@ npm config set @zowe:registry https://zowe.jfrog.io/zowe/api/npm/npm-local-relea rm -rf ~/.zowe/plugins npm install -g @zowe/cli@${PKG_TAG} -plugins=( @zowe/zos-ftp-for-zowe-cli@${PKG_TAG} @zowe/cics-for-zowe-cli@${PKG_TAG} @zowe/db2-for-zowe-cli@${PKG_TAG} @zowe/ims-for-zowe-cli@${PKG_TAG} @zowe/mq-for-zowe-cli@${PKG_TAG}) +plugins=( @zowe/zos-ftp-for-zowe-cli@${PKG_TAG} @zowe/cics-for-zowe-cli@${PKG_TAG} @zowe/ims-for-zowe-cli@${PKG_TAG} @zowe/mq-for-zowe-cli@${PKG_TAG}) +noarm_plugins=( @zowe/db2-for-zowe-cli@${PKG_TAG} ) for i in "${plugins[@]}"; do if [ ! -z "${ALLOW_PLUGIN_INSTALL_FAIL}" ]; then @@ -32,4 +33,24 @@ for i in "${plugins[@]}"; do fi done +if uname -m | grep -q 'arm'; then + echo "Unable to install the following plug-ins due to CPU architecture:" + for i in "${noarm_plugins[@]}"; do + echo $i + done +elif uname -m | grep -q 'aarch'; then + echo "Unable to install the following plug-ins due to CPU architecture:" + for i in "${noarm_plugins[@]}"; do + echo $i + done +else + for i in "${noarm_plugins[@]}"; do + if [ ! -z "${ALLOW_PLUGIN_INSTALL_FAIL}" ]; then + zowe plugins install $i || true + else + zowe plugins install $i || exit 1 + fi + done +fi + exit 0 diff --git a/cli/jenkins-agent/install_zowe.sh b/cli/jenkins-agent/install_zowe.sh index bd7456c..b57fd28 100755 --- a/cli/jenkins-agent/install_zowe.sh +++ b/cli/jenkins-agent/install_zowe.sh @@ -27,7 +27,8 @@ npm config set @zowe:registry https://zowe.jfrog.io/zowe/api/npm/npm-local-relea rm -rf ~/.zowe/plugins npm install -g @zowe/cli@${PKG_TAG} -plugins=( @zowe/zos-ftp-for-zowe-cli@${PKG_TAG} @zowe/cics-for-zowe-cli@${PKG_TAG} @zowe/db2-for-zowe-cli@${PKG_TAG} @zowe/ims-for-zowe-cli@${PKG_TAG} @zowe/mq-for-zowe-cli@${PKG_TAG}) +plugins=( @zowe/zos-ftp-for-zowe-cli@${PKG_TAG} @zowe/cics-for-zowe-cli@${PKG_TAG} @zowe/ims-for-zowe-cli@${PKG_TAG} @zowe/mq-for-zowe-cli@${PKG_TAG}) +noarm_plugins=( @zowe/db2-for-zowe-cli@${PKG_TAG} ) for i in "${plugins[@]}"; do if [ ! -z "${ALLOW_PLUGIN_INSTALL_FAIL}" ]; then @@ -37,4 +38,24 @@ for i in "${plugins[@]}"; do fi done +if uname -m | grep -q 'arm'; then + echo "Unable to install the following plug-ins due to CPU architecture:" + for i in "${noarm_plugins[@]}"; do + echo $i + done +elif uname -m | grep -q 'aarch'; then + echo "Unable to install the following plug-ins due to CPU architecture:" + for i in "${noarm_plugins[@]}"; do + echo $i + done +else + for i in "${noarm_plugins[@]}"; do + if [ ! -z "${ALLOW_PLUGIN_INSTALL_FAIL}" ]; then + zowe plugins install $i || true + else + zowe plugins install $i || exit 1 + fi + done +fi + exit 0 diff --git a/cli/minimal/Dockerfile b/cli/minimal/Dockerfile index 5a38659..298df4e 100644 --- a/cli/minimal/Dockerfile +++ b/cli/minimal/Dockerfile @@ -23,7 +23,8 @@ RUN apt-get update && apt-get install -y curl build-essential python3 && curl -f # Install Zowe CLI RUN npm install -g @zowe/cli@${ZOWE_VERSION} --ignore-scripts USER zowe -RUN zowe plugins install @zowe/cics-for-zowe-cli@${ZOWE_VERSION} @zowe/db2-for-zowe-cli@${ZOWE_VERSION} @zowe/ims-for-zowe-cli@${ZOWE_VERSION} @zowe/mq-for-zowe-cli@${ZOWE_VERSION} @zowe/zos-ftp-for-zowe-cli@${ZOWE_VERSION} +RUN zowe plugins install @zowe/cics-for-zowe-cli@${ZOWE_VERSION} @zowe/ims-for-zowe-cli@${ZOWE_VERSION} @zowe/mq-for-zowe-cli@${ZOWE_VERSION} @zowe/zos-ftp-for-zowe-cli@${ZOWE_VERSION} +RUN if uname -m | grep -q 'arm'; then echo "Unable to install the DB2 Plug-in due to CPU architecture"; elif uname -m | grep -q 'aarch'; then echo "Unable to install the DB2 Plug-in due to CPU architecture"; else zowe plugins install @zowe/db2-for-zowe-cli@${ZOWE_VERSION}; fi RUN mkdir -p ~/.zowe/settings && echo '{"overrides":{"CredentialManager":false}}' > ~/.zowe/settings/imperative.json # Uncomment to enable daemon mode by default From dd414529abbd38fd40f66f2775c13372a7bd4b09 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 30 Jul 2024 11:36:44 -0400 Subject: [PATCH 2/3] Do some cleanup Signed-off-by: Andrew W. Harn --- cli/basic-with-nvm/install_zowe.sh | 7 +------ cli/basic/install_zowe.sh | 7 +------ cli/jenkins-agent/install_zowe.sh | 7 +------ cli/minimal/Dockerfile | 3 +-- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/cli/basic-with-nvm/install_zowe.sh b/cli/basic-with-nvm/install_zowe.sh index b57fd28..7d329a3 100755 --- a/cli/basic-with-nvm/install_zowe.sh +++ b/cli/basic-with-nvm/install_zowe.sh @@ -38,12 +38,7 @@ for i in "${plugins[@]}"; do fi done -if uname -m | grep -q 'arm'; then - echo "Unable to install the following plug-ins due to CPU architecture:" - for i in "${noarm_plugins[@]}"; do - echo $i - done -elif uname -m | grep -q 'aarch'; then +if uname -m | grep -q 'arm\|aarch'; then echo "Unable to install the following plug-ins due to CPU architecture:" for i in "${noarm_plugins[@]}"; do echo $i diff --git a/cli/basic/install_zowe.sh b/cli/basic/install_zowe.sh index db1606a..7c5963a 100755 --- a/cli/basic/install_zowe.sh +++ b/cli/basic/install_zowe.sh @@ -33,12 +33,7 @@ for i in "${plugins[@]}"; do fi done -if uname -m | grep -q 'arm'; then - echo "Unable to install the following plug-ins due to CPU architecture:" - for i in "${noarm_plugins[@]}"; do - echo $i - done -elif uname -m | grep -q 'aarch'; then +if uname -m | grep -q 'arm\|aarch'; then echo "Unable to install the following plug-ins due to CPU architecture:" for i in "${noarm_plugins[@]}"; do echo $i diff --git a/cli/jenkins-agent/install_zowe.sh b/cli/jenkins-agent/install_zowe.sh index b57fd28..7d329a3 100755 --- a/cli/jenkins-agent/install_zowe.sh +++ b/cli/jenkins-agent/install_zowe.sh @@ -38,12 +38,7 @@ for i in "${plugins[@]}"; do fi done -if uname -m | grep -q 'arm'; then - echo "Unable to install the following plug-ins due to CPU architecture:" - for i in "${noarm_plugins[@]}"; do - echo $i - done -elif uname -m | grep -q 'aarch'; then +if uname -m | grep -q 'arm\|aarch'; then echo "Unable to install the following plug-ins due to CPU architecture:" for i in "${noarm_plugins[@]}"; do echo $i diff --git a/cli/minimal/Dockerfile b/cli/minimal/Dockerfile index 298df4e..e28e9ed 100644 --- a/cli/minimal/Dockerfile +++ b/cli/minimal/Dockerfile @@ -23,8 +23,7 @@ RUN apt-get update && apt-get install -y curl build-essential python3 && curl -f # Install Zowe CLI RUN npm install -g @zowe/cli@${ZOWE_VERSION} --ignore-scripts USER zowe -RUN zowe plugins install @zowe/cics-for-zowe-cli@${ZOWE_VERSION} @zowe/ims-for-zowe-cli@${ZOWE_VERSION} @zowe/mq-for-zowe-cli@${ZOWE_VERSION} @zowe/zos-ftp-for-zowe-cli@${ZOWE_VERSION} -RUN if uname -m | grep -q 'arm'; then echo "Unable to install the DB2 Plug-in due to CPU architecture"; elif uname -m | grep -q 'aarch'; then echo "Unable to install the DB2 Plug-in due to CPU architecture"; else zowe plugins install @zowe/db2-for-zowe-cli@${ZOWE_VERSION}; fi +RUN zowe plugins install @zowe/cics-for-zowe-cli@${ZOWE_VERSION} @zowe/ims-for-zowe-cli@${ZOWE_VERSION} @zowe/mq-for-zowe-cli@${ZOWE_VERSION} @zowe/zos-ftp-for-zowe-cli@${ZOWE_VERSION} && if uname -m | grep -q 'arm\|aarch'; then echo "Unable to install the DB2 Plug-in due to CPU architecture"; else zowe plugins install @zowe/db2-for-zowe-cli@${ZOWE_VERSION}; fi RUN mkdir -p ~/.zowe/settings && echo '{"overrides":{"CredentialManager":false}}' > ~/.zowe/settings/imperative.json # Uncomment to enable daemon mode by default From 59b79df2c18a9df748295be583d9f651fd4a1d8e Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 30 Jul 2024 11:41:55 -0400 Subject: [PATCH 3/3] Update workflow name because it was wrong Signed-off-by: Andrew W. Harn --- .github/workflows/cli-basic-with-nvm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-basic-with-nvm.yaml b/.github/workflows/cli-basic-with-nvm.yaml index 01c49f4..e707203 100644 --- a/.github/workflows/cli-basic-with-nvm.yaml +++ b/.github/workflows/cli-basic-with-nvm.yaml @@ -1,4 +1,4 @@ -name: Build CLI Basic With NPM +name: Build CLI Basic With NVM on: push: paths: