From 87036c398749b46799bce1a81f67fd2b38611e24 Mon Sep 17 00:00:00 2001 From: Gabo Date: Fri, 30 Oct 2020 14:16:21 -0500 Subject: [PATCH 1/7] Better pswh module validation --- lib/validation.sh | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/lib/validation.sh b/lib/validation.sh index f5bcdf50..55d25a5e 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -210,36 +210,16 @@ function GetValidationInfo() { #### Function ValidatePowershellModules ######################################## function ValidatePowershellModules() { VALIDATE_PSSA_MODULE=$(pwsh -c "(Get-Module -Name PSScriptAnalyzer -ListAvailable | Select-Object -First 1).Name" 2>&1) + VALIDATE_PSSA_CMD=$(pwsh -c "(Get-Command Invoke-ScriptAnalyzer | Select-Object -First 1).Name" 2>&1) # If module found, ensure Invoke-ScriptAnalyzer command is available - if [[ ${VALIDATE_PSSA_MODULE} == "PSScriptAnalyzer" ]]; then - VALIDATE_PSSA_CMD=$(pwsh -c "(Get-Command Invoke-ScriptAnalyzer | Select-Object -First 1).Name" 2>&1) - else - fatal "Failed to find module." - fi - - ######################################### - # validate we found the script analyzer # - ######################################### - if [[ ${VALIDATE_PSSA_CMD} != "Invoke-ScriptAnalyzer" ]]; then - fatal "Failed to find module." - fi - - ####################### - # Load the error code # - ####################### - ERROR_CODE=$? - - ############################## - # Check the shell for errors # - ############################## - if [ ${ERROR_CODE} -ne 0 ]; then - # Failed - error "Failed find module [PSScriptAnalyzer] for [${LINTER_NAME}] in system!" - fatal "[PSSA_MODULE ${VALIDATE_PSSA_MODULE}] [PSSA_CMD ${VALIDATE_PSSA_CMD}]" - else + if [[ ${VALIDATE_PSSA_MODULE} == "PSScriptAnalyzer" ]] && [[ ${VALIDATE_PSSA_CMD} == "Invoke-ScriptAnalyzer" ]]; then # Success debug "Successfully found module ${F[W]}[${VALIDATE_PSSA_MODULE}]${F[B]} in system" debug "Successfully found command ${F[W]}[${VALIDATE_PSSA_CMD}]${F[B]} in system" + else + # Failed + error "Failed find module [PSScriptAnalyzer] for [${LINTER_NAME}] in system!" + fatal "[PSSA_MODULE: ${VALIDATE_PSSA_MODULE}] [PSSA_CMD: ${VALIDATE_PSSA_CMD}]" fi } ################################################################################ From e4b007cd406479d8261c9d8ba72fb1df0366e2e2 Mon Sep 17 00:00:00 2001 From: Gabo Date: Fri, 30 Oct 2020 15:06:12 -0500 Subject: [PATCH 2/7] Move validation to build time --- .automation/validate-docker.sh | 79 ++++++++++++++++++++++++++++++++ .github/workflows/deploy-DEV.yml | 7 +++ lib/linter.sh | 1 - lib/validation.sh | 17 ------- 4 files changed, 86 insertions(+), 18 deletions(-) create mode 100755 .automation/validate-docker.sh diff --git a/.automation/validate-docker.sh b/.automation/validate-docker.sh new file mode 100755 index 00000000..de1f4888 --- /dev/null +++ b/.automation/validate-docker.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash + +############################################################################# +############# Validate build docker image for possible extra errors ######### +############################################################################# + +########### +# Globals # +########### +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch +BUILD_DATE="${BUILD_DATE}" # Date the container was built +ERROR=0 # Error count + +######################### +# Source Function Files # +######################### +# shellcheck source=/dev/null +source "${GITHUB_WORKSPACE}/lib/log.sh" # Source the function script(s) + +################################################################################ +############################ FUNCTIONS BELOW ################################### +################################################################################ +################################################################################ +#### Function Header ########################################################### +Header() { + info "-------------------------------------------" + info "----- GitHub Actions validate docker ------" + info "-------------------------------------------" +} +################################################################################ +#### Function ValidatePowershellModules ######################################## +function ValidatePowershellModules() { + VALIDATE_PSSA_MODULE=$(pwsh -c "(Get-Module -Name PSScriptAnalyzer -ListAvailable | Select-Object -First 1).Name" 2>&1) + VALIDATE_PSSA_CMD=$(pwsh -c "(Get-Command Invoke-ScriptAnalyzer | Select-Object -First 1).Name" 2>&1) + # If module found, ensure Invoke-ScriptAnalyzer command is available + if [[ ${VALIDATE_PSSA_MODULE} == "PSScriptAnalyzer" ]] && [[ ${VALIDATE_PSSA_CMD} == "Invoke-ScriptAnalyzer" ]]; then + # Success + debug "Successfully found module ${F[W]}[${VALIDATE_PSSA_MODULE}]${F[B]} in system" + debug "Successfully found command ${F[W]}[${VALIDATE_PSSA_CMD}]${F[B]} in system" + else + # Failed + ERROR=1 + error "Failed find module [PSScriptAnalyzer] in system!" + error "[PSSA_MODULE: ${VALIDATE_PSSA_MODULE}] [PSSA_CMD: ${VALIDATE_PSSA_CMD}]" + fi +} +################################################################################ +#### Function ValidateLabel #################################################### +ValidateLibs() { + ValidatePowershellModules +} +################################################################################ +#### Function Footer ########################################################### +Footer() { + ##################################### + # Check if any errors were reported # + ##################################### + if [[ ${ERROR} -gt 0 ]]; then + fatal "There were some failed assertions. See above" + else + info "-------------------------------------------------------" + info "The step has completed" + info "-------------------------------------------------------" + fi +} +################################################################################ +################################## MAIN ######################################## +################################################################################ + +################# +# Validate libs # +################# +ValidateLibs + +################# +# Report status # +################# +Footer diff --git a/.github/workflows/deploy-DEV.yml b/.github/workflows/deploy-DEV.yml index 706b4122..0d812e76 100644 --- a/.github/workflows/deploy-DEV.yml +++ b/.github/workflows/deploy-DEV.yml @@ -63,6 +63,13 @@ jobs: shell: bash run: .automation/validate-docker-labels.sh + ######################################### + # Validates the docker libs/executables # + ######################################### + - name: Run Docker libs/executables test cases + shell: bash + run: .automation/validate-docker.sh + ##################################### # Run Linter against Test code base # ##################################### diff --git a/lib/linter.sh b/lib/linter.sh index 5d159412..8e63b3bc 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1139,7 +1139,6 @@ REPORT_OUTPUT_FOLDER="${GITHUB_WORKSPACE}/${OUTPUT_FOLDER}" # Location for # Validate the environment # ############################ GetValidationInfo -ValidatePowershellModules ######################## # Get the linter rules # diff --git a/lib/validation.sh b/lib/validation.sh index 55d25a5e..1f0e04b0 100755 --- a/lib/validation.sh +++ b/lib/validation.sh @@ -206,20 +206,3 @@ function GetValidationInfo() { debug "${PRINTENV}" debug "---------------------------------------------" } -################################################################################ -#### Function ValidatePowershellModules ######################################## -function ValidatePowershellModules() { - VALIDATE_PSSA_MODULE=$(pwsh -c "(Get-Module -Name PSScriptAnalyzer -ListAvailable | Select-Object -First 1).Name" 2>&1) - VALIDATE_PSSA_CMD=$(pwsh -c "(Get-Command Invoke-ScriptAnalyzer | Select-Object -First 1).Name" 2>&1) - # If module found, ensure Invoke-ScriptAnalyzer command is available - if [[ ${VALIDATE_PSSA_MODULE} == "PSScriptAnalyzer" ]] && [[ ${VALIDATE_PSSA_CMD} == "Invoke-ScriptAnalyzer" ]]; then - # Success - debug "Successfully found module ${F[W]}[${VALIDATE_PSSA_MODULE}]${F[B]} in system" - debug "Successfully found command ${F[W]}[${VALIDATE_PSSA_CMD}]${F[B]} in system" - else - # Failed - error "Failed find module [PSScriptAnalyzer] for [${LINTER_NAME}] in system!" - fatal "[PSSA_MODULE: ${VALIDATE_PSSA_MODULE}] [PSSA_CMD: ${VALIDATE_PSSA_CMD}]" - fi -} -################################################################################ From 291489d6d951153d28186fc03c8fa05930de724f Mon Sep 17 00:00:00 2001 From: Gabo Date: Fri, 30 Oct 2020 18:50:43 -0500 Subject: [PATCH 3/7] Fix logging level for automation scripts --- .automation/clean-code-base-for-tests.sh | 9 +++++---- .automation/cleanup-docker.sh | 13 +++++++------ .automation/upload-docker.sh | 7 ++++--- .automation/validate-docker-labels.sh | 15 ++++++++------- .automation/validate-docker.sh | 9 +++++---- lib/linterVersions.sh | 5 +++++ 6 files changed, 34 insertions(+), 24 deletions(-) diff --git a/.automation/clean-code-base-for-tests.sh b/.automation/clean-code-base-for-tests.sh index c7c00494..1e7d6c14 100755 --- a/.automation/clean-code-base-for-tests.sh +++ b/.automation/clean-code-base-for-tests.sh @@ -7,10 +7,11 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch -TEST_FOLDER='.automation/test' # Folder where test are stored -CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch +TEST_FOLDER='.automation/test' # Folder where test are stored +CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip +let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging ############################ # Source additonal scripts # diff --git a/.automation/cleanup-docker.sh b/.automation/cleanup-docker.sh index 35e28878..f03f10b2 100755 --- a/.automation/cleanup-docker.sh +++ b/.automation/cleanup-docker.sh @@ -16,12 +16,13 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub -DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub -IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image -IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image -DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub +DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub +IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image +IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image +DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded +let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging ######################### # Source Function Files # diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index e1836836..de7b14c1 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -38,9 +38,10 @@ CONTAINER_URL='' # Final URL to upload ########################################################### # Dynamic build variables to pass to container when built # ########################################################### -BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # Current build date EX> "2017-08-28T09:24:41Z" -BUILD_REVISION=$(git rev-parse --short HEAD) # Current git commit EX> "e89faa7" -BUILD_VERSION='' # Current version of the container being built +BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # Current build date EX> "2017-08-28T09:24:41Z" +BUILD_REVISION=$(git rev-parse --short HEAD) # Current git commit EX> "e89faa7" +BUILD_VERSION='' # Current version of the container being built +let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging ######################### # Source Function Files # diff --git a/.automation/validate-docker-labels.sh b/.automation/validate-docker-labels.sh index cee8d4bd..ed60b3c9 100755 --- a/.automation/validate-docker-labels.sh +++ b/.automation/validate-docker-labels.sh @@ -7,13 +7,14 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch -BUILD_DATE="${BUILD_DATE}" # Date the container was built -BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha -BUILD_VERSION="${GITHUB_SHA}" # Version of the container -ORG_REPO="github/super-linter" # Org/repo -ERROR=0 # Error count +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch +BUILD_DATE="${BUILD_DATE}" # Date the container was built +BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha +BUILD_VERSION="${GITHUB_SHA}" # Version of the container +ORG_REPO="github/super-linter" # Org/repo +let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging +ERROR=0 # Error count ######################### # Source Function Files # diff --git a/.automation/validate-docker.sh b/.automation/validate-docker.sh index de1f4888..2e73a94f 100755 --- a/.automation/validate-docker.sh +++ b/.automation/validate-docker.sh @@ -7,10 +7,11 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch -BUILD_DATE="${BUILD_DATE}" # Date the container was built -ERROR=0 # Error count +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch +BUILD_DATE="${BUILD_DATE}" # Date the container was built +let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging +ERROR=0 # Error count ######################### # Source Function Files # diff --git a/lib/linterVersions.sh b/lib/linterVersions.sh index 9046895c..16fb0c68 100755 --- a/lib/linterVersions.sh +++ b/lib/linterVersions.sh @@ -6,6 +6,11 @@ ################################################################################ ################################################################################ +########### +# Globals # +########### +LOG_TRACE=true # Set log + ######################### # Source Function Files # ######################### From f826ac73c518700f390d3834d4eb0946a291377c Mon Sep 17 00:00:00 2001 From: Gabo Date: Fri, 30 Oct 2020 19:57:35 -0500 Subject: [PATCH 4/7] Validation should be inside container --- .github/workflows/deploy-DEV.yml | 7 ------- Dockerfile | 5 +++++ {.automation => lib}/validate-docker.sh | 16 +++++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) rename {.automation => lib}/validate-docker.sh (85%) diff --git a/.github/workflows/deploy-DEV.yml b/.github/workflows/deploy-DEV.yml index 0d812e76..706b4122 100644 --- a/.github/workflows/deploy-DEV.yml +++ b/.github/workflows/deploy-DEV.yml @@ -63,13 +63,6 @@ jobs: shell: bash run: .automation/validate-docker-labels.sh - ######################################### - # Validates the docker libs/executables # - ######################################### - - name: Run Docker libs/executables test cases - shell: bash - run: .automation/validate-docker.sh - ##################################### # Run Linter against Test code base # ##################################### diff --git a/Dockerfile b/Dockerfile index 08b3f8fd..689f3331 100644 --- a/Dockerfile +++ b/Dockerfile @@ -342,6 +342,11 @@ COPY TEMPLATES /action/lib/.automation ################################### RUN /action/lib/linterVersions.sh +##################################4 +# Run validations of built image # +################################## +RUN /action/lib/validate-docker.sh + ###################### # Set the entrypoint # ###################### diff --git a/.automation/validate-docker.sh b/lib/validate-docker.sh similarity index 85% rename from .automation/validate-docker.sh rename to lib/validate-docker.sh index 2e73a94f..9eb9391b 100755 --- a/.automation/validate-docker.sh +++ b/lib/validate-docker.sh @@ -7,9 +7,6 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch -BUILD_DATE="${BUILD_DATE}" # Date the container was built let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging ERROR=0 # Error count @@ -17,7 +14,7 @@ ERROR=0 # Error # Source Function Files # ######################### # shellcheck source=/dev/null -source "${GITHUB_WORKSPACE}/lib/log.sh" # Source the function script(s) +source /action/lib/log.sh ################################################################################ ############################ FUNCTIONS BELOW ################################### @@ -25,9 +22,9 @@ source "${GITHUB_WORKSPACE}/lib/log.sh" # Source the function script(s) ################################################################################ #### Function Header ########################################################### Header() { - info "-------------------------------------------" - info "----- GitHub Actions validate docker ------" - info "-------------------------------------------" + info "---------------------------------------" + info "----- Post-build validate docker ------" + info "---------------------------------------" } ################################################################################ #### Function ValidatePowershellModules ######################################## @@ -69,6 +66,11 @@ Footer() { ################################## MAIN ######################################## ################################################################################ +########## +# Header # +########## +Header + ################# # Validate libs # ################# From cc5556514f7046f4ab1dfef562a79850e4dd0092 Mon Sep 17 00:00:00 2001 From: Gabo Date: Fri, 30 Oct 2020 20:27:20 -0500 Subject: [PATCH 5/7] Fix shellcheck --- .automation/clean-code-base-for-tests.sh | 11 ++++++----- .automation/cleanup-docker.sh | 15 ++++++++------- .automation/upload-docker.sh | 9 +++++---- .automation/validate-docker-labels.sh | 22 ++++++++++++++-------- lib/validate-docker.sh | 4 +++- 5 files changed, 36 insertions(+), 25 deletions(-) diff --git a/.automation/clean-code-base-for-tests.sh b/.automation/clean-code-base-for-tests.sh index 1e7d6c14..966f798c 100755 --- a/.automation/clean-code-base-for-tests.sh +++ b/.automation/clean-code-base-for-tests.sh @@ -7,11 +7,12 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch -TEST_FOLDER='.automation/test' # Folder where test are stored -CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip -let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch +TEST_FOLDER='.automation/test' # Folder where test are stored +CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip +(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ############################ # Source additonal scripts # diff --git a/.automation/cleanup-docker.sh b/.automation/cleanup-docker.sh index f03f10b2..d7c3080b 100755 --- a/.automation/cleanup-docker.sh +++ b/.automation/cleanup-docker.sh @@ -16,13 +16,14 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub -DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub -IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image -IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image -DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded -let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub +DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub +IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image +IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image +DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded +(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ######################### # Source Function Files # diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index de7b14c1..8f14a92c 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -38,10 +38,11 @@ CONTAINER_URL='' # Final URL to upload ########################################################### # Dynamic build variables to pass to container when built # ########################################################### -BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # Current build date EX> "2017-08-28T09:24:41Z" -BUILD_REVISION=$(git rev-parse --short HEAD) # Current git commit EX> "e89faa7" -BUILD_VERSION='' # Current version of the container being built -let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging +BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # Current build date EX> "2017-08-28T09:24:41Z" +BUILD_REVISION=$(git rev-parse --short HEAD) # Current git commit EX> "e89faa7" +BUILD_VERSION='' # Current version of the container being built +(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ######################### # Source Function Files # diff --git a/.automation/validate-docker-labels.sh b/.automation/validate-docker-labels.sh index ed60b3c9..100b9812 100755 --- a/.automation/validate-docker-labels.sh +++ b/.automation/validate-docker-labels.sh @@ -7,14 +7,15 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch -BUILD_DATE="${BUILD_DATE}" # Date the container was built -BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha -BUILD_VERSION="${GITHUB_SHA}" # Version of the container -ORG_REPO="github/super-linter" # Org/repo -let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging -ERROR=0 # Error count +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch +BUILD_DATE="${BUILD_DATE}" # Date the container was built +BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha +BUILD_VERSION="${GITHUB_SHA}" # Version of the container +ORG_REPO="github/super-linter" # Org/repo +(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +ERROR=0 # Error count +export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ######################### # Source Function Files # @@ -74,6 +75,11 @@ Footer() { ################################## MAIN ######################################## ################################################################################ +########## +# Header # +########## +Header + #################### # Validate created # #################### diff --git a/lib/validate-docker.sh b/lib/validate-docker.sh index 9eb9391b..6e9da08e 100755 --- a/lib/validate-docker.sh +++ b/lib/validate-docker.sh @@ -7,9 +7,11 @@ ########### # Globals # ########### -let LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR=true # Enable all loging +(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging ERROR=0 # Error count +export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR + ######################### # Source Function Files # ######################### From 95ca6f00069122a6483d6b467b03acaf2ee6bbf7 Mon Sep 17 00:00:00 2001 From: Gabo Date: Fri, 30 Oct 2020 20:43:54 -0500 Subject: [PATCH 6/7] Fix shellchekc for linter versions --- lib/linterVersions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/linterVersions.sh b/lib/linterVersions.sh index 16fb0c68..6d1eeae9 100755 --- a/lib/linterVersions.sh +++ b/lib/linterVersions.sh @@ -9,7 +9,8 @@ ########### # Globals # ########### -LOG_TRACE=true # Set log +(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ######################### # Source Function Files # From 3c911cfe9986bd27f2d7dd9c65b15f9a59a7d0f1 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 2 Nov 2020 07:46:58 -0600 Subject: [PATCH 7/7] make fatal --- lib/linterVersions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linterVersions.sh b/lib/linterVersions.sh index 6d1eeae9..010b10c2 100755 --- a/lib/linterVersions.sh +++ b/lib/linterVersions.sh @@ -85,8 +85,8 @@ BuildLinterVersions() { # Check the shell for errors # ############################## if [ ${ERROR_CODE} -ne 0 ] || [ -z "${GET_VERSION_CMD[*]}" ]; then - warn "[${LINTER}]: Failed to get version info for:" WriteFile "${LINTER}" "Failed to get version info" + fatal "[${LINTER}]: Failed to get version info for:" else ########################## # Print the version info #