From 1a00fc37901207863f2831565c286b2b200ad5ed Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Tue, 4 May 2021 11:33:21 -0500 Subject: [PATCH] adding fixes (#1516) * adding fixes * happy * happy * fix local files * fix spacing * i hate space * spacing pt3 the space wars * further down the bunny trail --- .automation/upload-docker.sh | 34 +++++++++---------- .automation/validate-docker-labels.sh | 6 ++-- .github/workflows/deploy-DEV.yml | 10 ++++-- .github/workflows/deploy-PROD.yml | 1 + ...aft-release.yml.hold => draft-release.yml} | 17 +++++++--- Dockerfile | 14 ++++---- lib/functions/log.sh | 3 +- lib/linter.sh | 34 +++++++++---------- 8 files changed, 67 insertions(+), 52 deletions(-) rename .github/workflows/{HOLDING/draft-release.yml.hold => draft-release.yml} (51%) diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index f1398d28..649b0f37 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -17,23 +17,23 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system -DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub -DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub -GCR_USERNAME="${GCR_USERNAME}" # Username to login to GitHub package registry -GCR_TOKEN="${GCR_TOKEN}" # Password to login to GitHub package registry -REGISTRY="${REGISTRY}" # What registry to upload | or -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 -MAJOR_TAG='' # Major tag version if we need to update it -UPDATE_MAJOR_TAG=0 # Flag to deploy the major tag version as well -GCR_URL='ghcr.io' # URL to Github Container Registry -DOCKER_IMAGE_REPO='' # Docker tag for the image when created -GCR_IMAGE_REPO='' # Docker tag for the image when created -FOUND_IMAGE=0 # Flag for if the image has already been built -CONTAINER_URL='' # Final URL to upload +# GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +# GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system +# DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub +# DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub +# GCR_USERNAME="${GCR_USERNAME}" # Username to login to GitHub package registry +# GCR_TOKEN="${GCR_TOKEN}" # Password to login to GitHub package registry +# REGISTRY="${REGISTRY}" # What registry to upload | or +# 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 +MAJOR_TAG='' # Major tag version if we need to update it +UPDATE_MAJOR_TAG=0 # Flag to deploy the major tag version as well +GCR_URL='ghcr.io' # URL to Github Container Registry +DOCKER_IMAGE_REPO='' # Docker tag for the image when created +GCR_IMAGE_REPO='' # Docker tag for the image when created +FOUND_IMAGE=0 # Flag for if the image has already been built +CONTAINER_URL='' # Final URL to upload ########################################################### # Dynamic build variables to pass to container when built # diff --git a/.automation/validate-docker-labels.sh b/.automation/validate-docker-labels.sh index aaac71d1..fb3bee5f 100755 --- a/.automation/validate-docker-labels.sh +++ b/.automation/validate-docker-labels.sh @@ -7,9 +7,9 @@ ########### # 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 +# 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 diff --git a/.github/workflows/deploy-DEV.yml b/.github/workflows/deploy-DEV.yml index 92870b41..0cf9d3f5 100644 --- a/.github/workflows/deploy-DEV.yml +++ b/.github/workflows/deploy-DEV.yml @@ -103,9 +103,10 @@ jobs: VALIDATE_ALL_CODEBASE: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ########################################################################################### - # Fix file and dir ownership. Workaround for https://github.com/actions/runner/issues/434 # - ########################################################################################### + ############################################################### + # Fix file and dir ownership. # + # Workaround for https://github.com/actions/runner/issues/434 # + ############################################################### - name: Fix file and directory ownership shell: bash run: | @@ -124,6 +125,9 @@ jobs: ########################## - name: Upload the code coverage report uses: codacy/codacy-coverage-reporter-action@1.0.1 + # Dependabot does not have priv to see the secret, so will + # fail opn bump jobs... + continue-on-error: true with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: test/reports/cobertura/runTests.sh/cobertura.xml diff --git a/.github/workflows/deploy-PROD.yml b/.github/workflows/deploy-PROD.yml index fa19673f..94946cc4 100644 --- a/.github/workflows/deploy-PROD.yml +++ b/.github/workflows/deploy-PROD.yml @@ -17,6 +17,7 @@ on: push: branches: - 'master' + - 'main' ############### # Set the Job # diff --git a/.github/workflows/HOLDING/draft-release.yml.hold b/.github/workflows/draft-release.yml similarity index 51% rename from .github/workflows/HOLDING/draft-release.yml.hold rename to .github/workflows/draft-release.yml index defa1cb4..1e7339b9 100644 --- a/.github/workflows/HOLDING/draft-release.yml.hold +++ b/.github/workflows/draft-release.yml @@ -1,15 +1,24 @@ -# We have this file on hold as its an Action that would trigger another action, and not currently supported. -# This then causes the deployRelease action to never fun, which is far more important than auto drafting -# Until we have a better solution, this needs to remain on hold - +--- +########################################### +########################################### +## Draft releases on Push to master/main ## +########################################### +########################################### name: Release Drafter +########################### +# Start on push to master # +########################### on: push: # branches to consider in the event; optional, defaults to all branches: - master + - main +################# +# Start the job # +################# jobs: update_release_draft: runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index be1371e7..71485b70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,9 +18,9 @@ FROM wata727/tflint:0.28.0 as tflint FROM mvdan/shfmt:v3.2.4 as shfmt FROM accurics/terrascan:1.5.1 as terrascan FROM hadolint/hadolint:latest-alpine as dockerfile-lint -FROM ghcr.io/assignuser/lintr-lib:0.2.0 as lintr-lib FROM ghcr.io/assignuser/chktex-alpine:0.1.1 as chktex FROM garethr/kubeval:0.15.0 as kubeval +FROM ghcr.io/assignuser/lintr-lib:0.2.0 as lintr-lib ################## # Get base image # @@ -211,11 +211,6 @@ COPY --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker ############################### COPY --from=dockerfile-lint /bin/hadolint /usr/bin/hadolint -################# -# Install lintr # -################# -COPY --from=lintr-lib /usr/lib/R/library/ /home/r-library/ - ################## # Install chktex # ################## @@ -231,6 +226,11 @@ COPY --from=kubeval /kubeval /usr/bin/ ################# COPY --from=shfmt /bin/shfmt /usr/bin/ +################# +# Install Litnr # +################# +COPY --from=lintr-lib /usr/lib/R/library/ /home/r-library + ################## # Install ktlint # ################## @@ -376,7 +376,7 @@ COPY --from=base_image /usr/include/ /usr/include/ COPY --from=base_image /lib/ /lib/ COPY --from=base_image /bin/ /bin/ COPY --from=base_image /node_modules/ /node_modules/ -COPY --from=base_image /home/r-library/ /home/r-library/ +COPY --from=base_image /home/r-library /home/r-library ######################################## # Add node packages to path and dotnet # diff --git a/lib/functions/log.sh b/lib/functions/log.sh index 8f95de0f..e9e093c0 100755 --- a/lib/functions/log.sh +++ b/lib/functions/log.sh @@ -20,7 +20,8 @@ declare -Agr F=( [W]=$(echo -e "\e[0;37m") [Y]=$(echo -e "\e[0;33m") ) -readonly NC=$(echo -e "\e[0m") +NC=$(echo -e "\e[0m") +readonly NC export B export F diff --git a/lib/linter.sh b/lib/linter.sh index 330bb037..0ae21ed9 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -10,7 +10,7 @@ # Debug Vars # # Define these early, so we can use debug logging ASAP if needed # ################################################################## -RUN_LOCAL="${RUN_LOCAL}" # Boolean to see if we are running locally +# RUN_LOCAL="${RUN_LOCAL}" # Boolean to see if we are running locally ACTIONS_RUNNER_DEBUG="${ACTIONS_RUNNER_DEBUG:-false}" # Boolean to see even more info (debug) ################################################################## @@ -151,7 +151,7 @@ SNAKEMAKE_SNAKEFMT_FILE_NAME="${SNAKEMAKE_SNAKEFMT_CONFIG_FILE:-.snakefmt.toml}" # shellcheck disable=SC2034 # Variable is referenced indirectly SUPPRESS_POSSUM="${SUPPRESS_POSSUM:-false}" # shellcheck disable=SC2034 # Variable is referenced indirectly -SSL_CERT_SECRET="${SSL_CERT_SECRET}" +# SSL_CERT_SECRET="${SSL_CERT_SECRET}" # shellcheck disable=SC2034 # Variable is referenced indirectly SQL_FILE_NAME="${SQL_CONFIG_FILE:-.sql-config.json}" # shellcheck disable=SC2034 # Variable is referenced indirectly @@ -270,20 +270,20 @@ LINTED_LANGUAGES_ARRAY=() # Will be filled at run time with all languages that w ################### # GitHub ENV Vars # ################### -ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY}" # Ansible Directory -DEFAULT_BRANCH="${DEFAULT_BRANCH:-master}" # Default Git Branch to use (master by default) -DISABLE_ERRORS="${DISABLE_ERRORS}" # Boolean to enable warning-only output without throwing errors -FILTER_REGEX_INCLUDE="${FILTER_REGEX_INCLUDE}" # RegExp defining which files will be processed by linters (all by default) -FILTER_REGEX_EXCLUDE="${FILTER_REGEX_EXCLUDE}" # RegExp defining which files will be excluded from linting (none by default) -GITHUB_EVENT_PATH="${GITHUB_EVENT_PATH}" # Github Event Path -GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system -GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs -GITHUB_SHA="${GITHUB_SHA}" # GitHub sha from the commit -GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace -MULTI_STATUS="${MULTI_STATUS:-true}" # Multiple status are created for each check ran -TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases -VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files +# ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY}" # Ansible Directory +MULTI_STATUS="${MULTI_STATUS:-true}" # Multiple status are created for each check ran +DEFAULT_BRANCH="${DEFAULT_BRANCH:-master}" # Default Git Branch to use (master by default) +# DISABLE_ERRORS="${DISABLE_ERRORS}" # Boolean to enable warning-only output without throwing errors +# FILTER_REGEX_INCLUDE="${FILTER_REGEX_INCLUDE}" # RegExp defining which files will be processed by linters (all by default) +# FILTER_REGEX_EXCLUDE="${FILTER_REGEX_EXCLUDE}" # RegExp defining which files will be excluded from linting (none by default) +# GITHUB_EVENT_PATH="${GITHUB_EVENT_PATH}" # Github Event Path +# GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system +# GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs +# GITHUB_SHA="${GITHUB_SHA}" # GitHub sha from the commit +# GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment +# GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace +# TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases +# VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files IGNORE_GITIGNORED_FILES="${IGNORE_GITIGNORED_FILES:-false}" @@ -310,7 +310,7 @@ export TEST_CASE_FOLDER # Workaround SC2034 ############## # Format # ############## -OUTPUT_FORMAT="${OUTPUT_FORMAT}" # Output format to be generated. Default none +# OUTPUT_FORMAT="${OUTPUT_FORMAT}" # Output format to be generated. Default none OUTPUT_FOLDER="${OUTPUT_FOLDER:-super-linter.report}" # Folder where the reports are generated. Default super-linter.report OUTPUT_DETAILS="${OUTPUT_DETAILS:-simpler}" # What level of details. (simpler or detailed). Default simpler