This is an automated email from the ASF dual-hosted git repository.

ricardozanini pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-images.git


The following commit(s) were added to refs/heads/main by this push:
     new 1e77d9e9 Fix #1755 - Fix SpellSheck runner and warning in script files 
(#1756)
1e77d9e9 is described below

commit 1e77d9e92e6e56ab3f6cac0cadc41deb2f5003c1
Author: Ricardo Zanini <[email protected]>
AuthorDate: Fri Apr 12 08:17:05 2024 -0300

    Fix #1755 - Fix SpellSheck runner and warning in script files (#1756)
    
    Signed-off-by: Ricardo Zanini <[email protected]>
---
 .github/workflows/kogito-images-pr-check.yml       | 23 +++++++++++++---------
 .../added/configure-custom-truststore.sh           |  3 ++-
 modules/kogito-launch-scripts/added/configure.sh   |  2 ++
 modules/kogito-maven/common/configure              |  2 +-
 .../common/build/added/cleanup_project.sh          |  2 +-
 .../common/scripts/added/add-extension.sh          |  3 ++-
 .../kogito-swf/common/scripts/added/build-app.sh   |  3 ++-
 .../kogito-swf/common/scripts/added/create-app.sh  |  3 ++-
 .../common/scripts/added/jvm-settings.sh           |  7 +++++--
 .../runtime/common/added/run-app-devmode.sh        |  3 ++-
 10 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/.github/workflows/kogito-images-pr-check.yml 
b/.github/workflows/kogito-images-pr-check.yml
index 98a5199b..31331b40 100644
--- a/.github/workflows/kogito-images-pr-check.yml
+++ b/.github/workflows/kogito-images-pr-check.yml
@@ -10,11 +10,12 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Install xmllint
         run: |
-          sudo apt-get update
-          sudo apt-get install libxml2-utils --fix-missing
+          sudo apt-get update &&\
+          sudo apt-get -y install --no-install-recommends --fix-missing \
+          libxml2-utils
       - name: Cache bats binaries
         uses: actions/cache@v1
         with:
@@ -25,7 +26,7 @@ jobs:
       - name: run bats
         run: |
           ./scripts/run-bats.sh
-          
+
   validate_kogito_imagestream:
     concurrency:
       group: ${{ github.repository.name }}_validate_kogito_imagestream-${{ 
github.head_ref }}
@@ -33,14 +34,14 @@ jobs:
     name: Validate Kogito imagestreams
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Download openshift-validator-tool
         run: |
           wget 
https://github.com/jboss-container-images/jboss-kie-modules/raw/main/tools/openshift-template-validator/openshift-template-validator-linux-amd64
       - name: Add execution permission to openshift-validator-tool
         run: |
           chmod +x openshift-template-validator-linux-amd64
-          mv openshift-template-validator-linux-amd64 ${HOME}  
+          mv openshift-template-validator-linux-amd64 ${HOME}
       - name: validate kogito imagestream
         run: |
           ${HOME}/openshift-template-validator-linux-amd64 validate -f 
kogito-imagestream.yaml
@@ -53,11 +54,15 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Install Shellcheck
-        run: sudo apt install shellcheck
+        run: |
+          sudo apt-get update &&\
+          sudo apt-get -y install --no-install-recommends \
+          shellcheck
       - name: Check configure scripts
         run: |
           # Ignore SC2034 since we have many var which are unused in the 
script but can be used while deployment at runtime by setting env. For eg: 
${KOGITO_QUARKUS_JVM_PROPS}
           # Ignore SC1090 since the source files in our case didn't need to be 
checked
-          shellcheck -e SC2034 -e SC1090 modules/**/configure modules/**/*.sh
\ No newline at end of file
+          shopt -s globstar nullglob
+          shellcheck -e SC2034 -e SC1090 -S warning modules/**/configure 
modules/**/*.sh
diff --git 
a/modules/kogito-custom-truststore/added/configure-custom-truststore.sh 
b/modules/kogito-custom-truststore/added/configure-custom-truststore.sh
index f3c180f8..3438a0d4 100755
--- a/modules/kogito-custom-truststore/added/configure-custom-truststore.sh
+++ b/modules/kogito-custom-truststore/added/configure-custom-truststore.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -20,6 +20,7 @@
 set -e
 
 # imports
+# shellcheck source=/dev/null
 source "${KOGITO_HOME}"/launch/logging.sh
 
 function prepareEnv() {
diff --git a/modules/kogito-launch-scripts/added/configure.sh 
b/modules/kogito-launch-scripts/added/configure.sh
index 638e9bbc..8244ba32 100644
--- a/modules/kogito-launch-scripts/added/configure.sh
+++ b/modules/kogito-launch-scripts/added/configure.sh
@@ -84,6 +84,7 @@ function prepareModule() {
 # $1 - module file
 # $2 - function name
 function executeModule() {
+  # shellcheck source=/dev/null
   source "$1"
   if [ -n "$(type -t "$2")" ]; then
     eval "$2"
@@ -93,6 +94,7 @@ function executeModule() {
 # Run through the list of scripts, executing the specified function for each.
 # $1 - function name
 function executeModules() {
+  # shellcheck disable=SC2048
   for module in ${CONFIGURE_SCRIPTS[*]}; do
     prepareModule
     executeModule "${module}" "${1}"
diff --git a/modules/kogito-maven/common/configure 
b/modules/kogito-maven/common/configure
index 7f530604..e28dccbb 100755
--- a/modules/kogito-maven/common/configure
+++ b/modules/kogito-maven/common/configure
@@ -25,7 +25,7 @@ SCRIPT_DIR=$(dirname "${0}")
 mvn_install_dir="/usr/share/maven"
 
 # Verify if mvn is installed
-if [ ! -d ${mvn_install_dir} ] && ! command -v mvn &> /dev/null ;
+if [ ! -d ${mvn_install_dir} ] && ! command -v mvn > /dev/null 2>&1 ;
 then
     echo "---> Maven not found, downloading and installing it"
     tar xzf "${SOURCES_DIR}"/apache-maven-"${MAVEN_VERSION}"-bin.tar.gz -C 
/usr/share
diff --git a/modules/kogito-swf/common/build/added/cleanup_project.sh 
b/modules/kogito-swf/common/build/added/cleanup_project.sh
index adfac1d5..69e0a61e 100755
--- a/modules/kogito-swf/common/build/added/cleanup_project.sh
+++ b/modules/kogito-swf/common/build/added/cleanup_project.sh
@@ -35,7 +35,7 @@ rm -rfv "${PROJECT_ARTIFACT_ID}"/*.bak
 echo 'Clean Maven useless files'
 find "${KOGITO_HOME}"/.m2/repository -name _remote.repositories -type f -delete
 find "${KOGITO_HOME}"/.m2/repository -name _maven.repositories -type f -delete
-find "${KOGITO_HOME}"/.m2/repository -name *.lastUpdated -type f -delete
+find "${KOGITO_HOME}"/.m2/repository -name '*.lastUpdated' -type f -delete
 
 # Remove files that include build timestamps to have reproducible images
 find "${KOGITO_HOME}"/.m2/ -name resolver-status.properties -delete 
diff --git a/modules/kogito-swf/common/scripts/added/add-extension.sh 
b/modules/kogito-swf/common/scripts/added/add-extension.sh
index 82a023ac..6dc158d2 100755
--- a/modules/kogito-swf/common/scripts/added/add-extension.sh
+++ b/modules/kogito-swf/common/scripts/added/add-extension.sh
@@ -20,12 +20,13 @@
 
 set -e
 
-script_dir_path="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
+script_dir_path="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 # extensions to be added, comma separated.
 extensions="$1"
 # parameter passed which will trigger or not the jvm/maven configuration.
 ignore_jvm_settings=${2:-false}
 
+# shellcheck source=/dev/null
 source "${script_dir_path}"/logging.sh
 
 if [ "${SCRIPT_DEBUG}" = "true" ] ; then
diff --git a/modules/kogito-swf/common/scripts/added/build-app.sh 
b/modules/kogito-swf/common/scripts/added/build-app.sh
index c85927c4..671d6e09 100755
--- a/modules/kogito-swf/common/scripts/added/build-app.sh
+++ b/modules/kogito-swf/common/scripts/added/build-app.sh
@@ -20,12 +20,13 @@
 
 set -e
 
-script_dir_path="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
+script_dir_path="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 resources_path="$1"
 if [ -n "${resources_path}" ]; then
     resources_path="$(realpath "${resources_path}")"
 fi
 
+# shellcheck source=/dev/null
 source "${script_dir_path}"/logging.sh
 
 if [ "${SCRIPT_DEBUG}" = "true" ] ; then
diff --git a/modules/kogito-swf/common/scripts/added/create-app.sh 
b/modules/kogito-swf/common/scripts/added/create-app.sh
index f965d9b7..ac8a5ebe 100755
--- a/modules/kogito-swf/common/scripts/added/create-app.sh
+++ b/modules/kogito-swf/common/scripts/added/create-app.sh
@@ -20,8 +20,9 @@
 
 set -e
 
-script_dir_path="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
+script_dir_path="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 
+# shellcheck source=/dev/null
 source "${script_dir_path}"/logging.sh
 
 if [ "${SCRIPT_DEBUG}" = "true" ] ; then
diff --git a/modules/kogito-swf/common/scripts/added/jvm-settings.sh 
b/modules/kogito-swf/common/scripts/added/jvm-settings.sh
index b8a1fce9..168e5321 100755
--- a/modules/kogito-swf/common/scripts/added/jvm-settings.sh
+++ b/modules/kogito-swf/common/scripts/added/jvm-settings.sh
@@ -30,14 +30,17 @@
 
 set -e
 
+# shellcheck source=/dev/null
 source "${KOGITO_HOME}"/launch/logging.sh
 
 log_info "--> checking if .mvn/jvm.config exists."
 if [ -f ".mvn/jvm.config" ]; then
   log_info "---> .mvn/jvm.config exists."
-  export JAVA_OPTIONS=$(cat .mvn/jvm.config)
+  JAVA_OPTIONS=$(cat .mvn/jvm.config)
+  export JAVA_OPTIONS
 else
   log_info "---> .mvn/jvm.config does not exists, memory will be calculated 
based on container limits."
 fi
 
-export MAVEN_OPTS="${JAVA_OPTIONS} 
$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-options) 
$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/debug-options)"
\ No newline at end of file
+MAVEN_OPTS="${JAVA_OPTIONS} 
$("${JBOSS_CONTAINER_JAVA_JVM_MODULE}"/java-default-options) 
$("${JBOSS_CONTAINER_JAVA_JVM_MODULE}"/debug-options)"
+export MAVEN_OPTS
\ No newline at end of file
diff --git a/modules/kogito-swf/devmode/runtime/common/added/run-app-devmode.sh 
b/modules/kogito-swf/devmode/runtime/common/added/run-app-devmode.sh
index ba8edc65..6f5ec361 100755
--- a/modules/kogito-swf/devmode/runtime/common/added/run-app-devmode.sh
+++ b/modules/kogito-swf/devmode/runtime/common/added/run-app-devmode.sh
@@ -20,8 +20,9 @@
 
 set -e
 
-script_dir_path="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
+script_dir_path="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 
+# shellcheck source=/dev/null
 source "${script_dir_path}"/logging.sh
 
 if [ "${SCRIPT_DEBUG}" = "true" ] ; then


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to